Skip to content

Commit 8f81c15

Browse files
committed
Merge branch 'release/1.3.5'
2 parents 38a3198 + efe6d47 commit 8f81c15

File tree

6 files changed

+1199
-1114
lines changed

6 files changed

+1199
-1114
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"plugins": ["compat"],
1111
"extends": "@avalanche/eslint-config",
1212
"rules": {
13-
"compat/compat": 2
13+
"compat/compat": "error"
1414
}
1515
}

.eslintrc-md.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"extends": ".eslintrc",
44
"rules": {
55
"quotes": [2, "single", { "avoidEscape": true }],
6-
"import/extensions": false,
7-
"import/no-extraneous-dependencies": false,
8-
"import/no-unresolved": false
6+
"import/extensions": "off",
7+
"import/no-extraneous-dependencies": "off",
8+
"import/no-unresolved": "off"
99
}
1010
}

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuex-map-fields",
3-
"version": "1.3.4",
3+
"version": "1.3.5",
44
"description": "Enable two-way data binding for form fields saved in a Vuex store",
55
"keywords": [
66
"vue",
@@ -28,24 +28,24 @@
2828
"prepublishOnly": "yarn run lint && yarn test && yarn run build"
2929
},
3030
"devDependencies": {
31-
"@avalanche/eslint-config": "^3.0.0",
32-
"@babel/core": "^7.4.4",
33-
"@babel/preset-env": "^7.4.4",
31+
"@avalanche/eslint-config": "^4.0.0",
32+
"@babel/core": "^7.5.5",
33+
"@babel/preset-env": "^7.5.5",
3434
"@vue/test-utils": "1.0.0-beta.29",
3535
"babel-core": "^7.0.0-bridge.0",
36-
"babel-jest": "^24.8.0",
37-
"coveralls": "^3.0.3",
38-
"eslint": "^5.16.0",
39-
"eslint-plugin-compat": "^3.1.1",
40-
"eslint-plugin-import": "^2.17.2",
36+
"babel-jest": "^24.9.0",
37+
"coveralls": "^3.0.6",
38+
"eslint": "^6.2.1",
39+
"eslint-plugin-compat": "^3.3.0",
40+
"eslint-plugin-import": "^2.18.2",
4141
"eslint-plugin-markdown": "^1.0.0",
42-
"jest": "^24.8.0",
43-
"rollup": "^1.11.3",
44-
"rollup-plugin-babel": "^4.3.2",
42+
"jest": "^24.9.0",
43+
"rollup": "^1.19.4",
44+
"rollup-plugin-babel": "^4.3.3",
4545
"uglify-es": "^3.3.9",
4646
"vue": "^2.6.10",
4747
"vue-template-compiler": "^2.6.10",
48-
"vuex": "^3.1.0"
48+
"vuex": "^3.1.1"
4949
},
5050
"main": "dist/index.js",
5151
"module": "dist/index.esm.js",

src/index.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import arrayToObject from './lib/array-to-object';
33
function normalizeNamespace(fn) {
44
return (...params) => {
55
// eslint-disable-next-line prefer-const
6-
let [namespace, map, getterType, mutationType] =
7-
typeof params[0] === `string` ? [...params] : [``, ...params];
6+
let [namespace, map, getterType, mutationType] = typeof params[0] === `string`
7+
? [...params]
8+
: [``, ...params];
89

910
if (namespace.length && namespace.charAt(namespace.length - 1) !== `/`) {
1011
namespace += `/`;
@@ -70,8 +71,8 @@ export const mapMultiRowFields = normalizeNamespace((
7071
const store = this.$store;
7172
const rows = store.getters[getterType](path);
7273

73-
return rows.map((fieldsObject, index) =>
74-
Object.keys(fieldsObject).reduce((prev, fieldKey) => {
74+
return rows
75+
.map((fieldsObject, index) => Object.keys(fieldsObject).reduce((prev, fieldKey) => {
7576
const fieldPath = `${path}[${index}].${fieldKey}`;
7677

7778
return Object.defineProperty(prev, fieldKey, {
@@ -93,8 +94,16 @@ export const mapMultiRowFields = normalizeNamespace((
9394
export const createHelpers = ({ getterType, mutationType }) => ({
9495
[getterType]: getField,
9596
[mutationType]: updateField,
96-
mapFields: normalizeNamespace((namespace, fields) =>
97-
mapFields(namespace, fields, getterType, mutationType)),
98-
mapMultiRowFields: normalizeNamespace((namespace, paths) =>
99-
mapMultiRowFields(namespace, paths, getterType, mutationType)),
97+
mapFields: normalizeNamespace((namespace, fields) => mapFields(
98+
namespace,
99+
fields,
100+
getterType,
101+
mutationType,
102+
)),
103+
mapMultiRowFields: normalizeNamespace((namespace, paths) => mapMultiRowFields(
104+
namespace,
105+
paths,
106+
getterType,
107+
mutationType,
108+
)),
100109
});

src/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
mapFields,
55
mapMultiRowFields,
66
updateField,
7-
} from './';
7+
} from '.';
88

99
describe(`index`, () => {
1010
describe(`getField()`, () => {

0 commit comments

Comments
 (0)