Skip to content

Commit fa5c480

Browse files
committed
Merge branch 'release/1.4.0'
2 parents a83126e + 32e880a commit fa5c480

File tree

3 files changed

+1899
-1968
lines changed

3 files changed

+1899
-1968
lines changed

package.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuex-map-fields",
3-
"version": "1.3.6",
3+
"version": "1.4.0",
44
"description": "Enable two-way data binding for form fields saved in a Vuex store",
55
"keywords": [
66
"vue",
@@ -29,22 +29,22 @@
2929
},
3030
"devDependencies": {
3131
"@avalanche/eslint-config": "^4.0.0",
32-
"@babel/core": "^7.7.5",
33-
"@babel/preset-env": "^7.7.6",
32+
"@babel/core": "^7.8.4",
33+
"@babel/preset-env": "^7.8.4",
3434
"@vue/test-utils": "1.0.0-beta.29",
3535
"babel-core": "^7.0.0-bridge.0",
36-
"babel-jest": "^24.9.0",
36+
"babel-jest": "^25.1.0",
3737
"coveralls": "^3.0.9",
38-
"eslint": "^6.7.2",
39-
"eslint-plugin-compat": "^3.3.0",
40-
"eslint-plugin-import": "^2.19.1",
38+
"eslint": "^6.8.0",
39+
"eslint-plugin-compat": "^3.5.1",
40+
"eslint-plugin-import": "^2.20.1",
4141
"eslint-plugin-markdown": "^1.0.1",
42-
"jest": "^24.9.0",
43-
"rollup": "^1.27.9",
42+
"jest": "^25.1.0",
43+
"rollup": "^1.31.1",
4444
"rollup-plugin-babel": "^4.3.3",
4545
"uglify-es": "^3.3.9",
46-
"vue": "^2.6.10",
47-
"vue-template-compiler": "^2.6.10",
46+
"vue": "^2.6.11",
47+
"vue-template-compiler": "^2.6.11",
4848
"vuex": "^3.1.2"
4949
},
5050
"main": "dist/index.js",
@@ -57,7 +57,9 @@
5757
"url": "https://github.com/maoberlehner/vuex-map-fields/issues"
5858
},
5959
"browserslist": [
60-
"last 2 versions"
60+
"> 0.5%",
61+
"not ie <= 10",
62+
"not op_mini all"
6163
],
6264
"jest": {
6365
"coveragePathIgnorePatterns": [

src/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import arrayToObject from './lib/array-to-object';
22

3+
function objectEntries(obj) {
4+
return Object.keys(obj).map(key => [key, obj[key]]);
5+
}
6+
37
function normalizeNamespace(fn) {
48
return (...params) => {
59
// eslint-disable-next-line prefer-const
@@ -69,10 +73,10 @@ export const mapMultiRowFields = normalizeNamespace((
6973
entries[key] = {
7074
get() {
7175
const store = this.$store;
72-
const rows = Object.entries(store.getters[getterType](path));
76+
const rows = objectEntries(store.getters[getterType](path));
7377

7478
return rows
75-
.map((fieldsObject, index) => Object.keys(fieldsObject[1]).reduce((prev, fieldKey) => {
79+
.map(fieldsObject => Object.keys(fieldsObject[1]).reduce((prev, fieldKey) => {
7680
const fieldPath = `${path}[${fieldsObject[0]}].${fieldKey}`;
7781

7882
return Object.defineProperty(prev, fieldKey, {

0 commit comments

Comments
 (0)