Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"extends": "@avalanche/eslint-config",
"rules": {
"compat/compat": "error"
}
},
"ignorePatterns": ["**/*.d.ts"]
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"scripts:umd": "rollup --config --output.format umd --name vuex-map-fields --output.file dist/index.js src/index.js",
"scripts:es": "rollup --config --output.format es --name vuex-map-fields --output.file dist/index.esm.js src/index.js",
"scripts:minify": "uglifyjs --compress --mangle --comments --output dist/index.min.js dist/index.js && uglifyjs --compress --mangle --comments --output dist/index.esm.min.js dist/index.esm.js",
"scripts": "yarn run scripts:umd && yarn run scripts:es && yarn run scripts:minify",
"scripts:typing": "tsc --project tsconfig.build-types.json",
"scripts": "yarn run scripts:umd && yarn run scripts:es && yarn run scripts:minify && yarn run scripts:typing",
"build": "yarn run scripts",
"fake-publish": "yarn run build && sh test/utils/fake-publish.sh",
"lint:scripts": "yarn run fake-publish && eslint --ignore-path .gitignore .",
Expand Down Expand Up @@ -42,12 +43,14 @@
"jest": "^26.4.2",
"rollup": "^2.28.2",
"rollup-plugin-babel": "^4.4.0",
"typescript": "^4.2.4",
"uglify-es": "^3.3.9",
"vue": "^2.6.12",
"vue-template-compiler": "^2.6.12",
"vuex": "^3.5.1"
},
"main": "dist/index.js",
"types": "types/vuex-map-fields/index.d.ts",
"module": "dist/index.esm.js",
"repository": {
"type": "git",
Expand Down
10 changes: 10 additions & 0 deletions tsconfig.build-types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"include": ["src/**/*"],
"exclude": ["src/**/*.spec.js"],
"compilerOptions": {
"allowJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "types/vuex-map-fields"
}
}
15 changes: 15 additions & 0 deletions types/vuex-map-fields/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export function getField(state: any): (path: any) => any;
export function updateField(state: any, { path, value }: {
path: any;
value: any;
}): void;
export function mapFields(...params: any[]): any;
export function mapMultiRowFields(...params: any[]): any;
export function createHelpers({ getterType, mutationType }: {
getterType: any;
mutationType: any;
}): {
[x: number]: typeof updateField;
mapFields: (...params: any[]) => any;
mapMultiRowFields: (...params: any[]) => any;
};
1 change: 1 addition & 0 deletions types/vuex-map-fields/lib/array-to-object.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function arrayToObject(fields?: any[]): any;
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5093,6 +5093,11 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

typescript@^4.2.4:
version "4.2.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961"
integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==

uglify-es@^3.3.9:
version "3.3.9"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"
Expand Down