Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

Commit c530f3b

Browse files
authored
Merge pull request #39 from rawilk/remove-core-js-dep
2 parents fa7e382 + 493e584 commit c530f3b

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

package-lock.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
},
2727
"homepage": "https://vue-context.com/docs",
2828
"dependencies": {
29-
"core-js": ">=2.6.5 <3.0.0",
3029
"vue-clickaway": "^2.2.2"
3130
},
3231
"devDependencies": {

src/js/utils.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
import fromPolyfill from 'core-js/library/fn/array/from';
2-
import isArrayPolyfill from 'core-js/library/fn/array/is-array';
1+
if (! Array.from) {
2+
Array.from = object => {
3+
'use strict';
4+
5+
return [].slice.call(object);
6+
};
7+
}
8+
9+
if (! Array.isArray) {
10+
Array.isArray = arg => Object.prototype.toString.call(arg) === '[object Array]';
11+
}
312

413
// --- Constants ---
5-
const arrayFrom = Array.from || fromPolyfill;
14+
const arrayFrom = Array.from;
615

7-
export const isArray = Array.isArray || isArrayPolyfill;
16+
export const isArray = Array.isArray;
817

918
export const keyCodes = {
1019
ESC: 27,

0 commit comments

Comments
 (0)