2
0
mirror of https://github.com/tenrok/vue-context.git synced 2026-06-14 00:02:23 +03:00

Remove core-js as a dependency - resolves #33

This commit is contained in:
Randall Wilk
2019-10-11 22:21:37 -05:00
parent 3d3463860c
commit e90007298c
5 changed files with 312 additions and 626 deletions
+13 -4
View File
@@ -1,10 +1,19 @@
import fromPolyfill from 'core-js/library/fn/array/from';
import isArrayPolyfill from 'core-js/library/fn/array/is-array';
if (! Array.from) {
Array.from = object => {
'use strict';
return [].slice.call(object);
};
}
if (! Array.isArray) {
Array.isArray = arg => Object.prototype.toString.call(arg) === '[object Array]';
}
// --- Constants ---
const arrayFrom = Array.from || fromPolyfill;
const arrayFrom = Array.from;
export const isArray = Array.isArray || isArrayPolyfill;
export const isArray = Array.isArray;
export const keyCodes = {
ESC: 27,