Skip to content

Commit 9893810

Browse files
committed
Replace es6-map with a simple implementation of a map.
1 parent e1b4a3d commit 9893810

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
},
2121
"license": "BSD-3-Clause",
2222
"dependencies": {
23-
"es6-map": "^0.1.3",
2423
"hoist-non-react-statics": "^1.0.5",
2524
"lodash": "^4.6.1",
2625
"object-unfreeze": "^1.0.2"
@@ -35,7 +34,7 @@
3534
"react-dom": "^15.0.0-rc.1"
3635
},
3736
"scripts": {
38-
"pragmatist": "node ./node_modules/.bin/pragmatist --es5",
37+
"pragmatist": "pragmatist --es5",
3938
"lint": "npm run pragmatist lint",
4039
"test": "npm run pragmatist test --type-annotations",
4140
"build": "npm run pragmatist build",

src/generateAppendClassName.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Map from 'es6-map';
1+
import Map from './simple-map';
22

33
const stylesIndex = new Map();
44

src/makeConfiguration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import _ from 'lodash';
2-
import Map from 'es6-map';
2+
import Map from './simple-map';
33

44
const userConfigurationIndex = new Map();
55

src/simple-map.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export default class SimpleMap {
2+
constructor() {
3+
this.keys = [];
4+
this.values = [];
5+
}
6+
7+
get(key) {
8+
const index = this.keys.indexOf(key);
9+
if (index === -1) {
10+
return;
11+
}
12+
return this.values[index];
13+
}
14+
15+
set(key, value) {
16+
this.keys.push(key);
17+
this.values.push(value);
18+
return value;
19+
}
20+
}

0 commit comments

Comments
 (0)