@anjianshi/utils 1.3.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /* eslint-env node */
2
2
  module.exports = {
3
3
  root: true,
4
- extends: ['./node_modules/@anjianshi/presets-eslint-base/index.js'],
4
+ extends: [require.resolve('@anjianshi/presets-eslint-base')],
5
5
  rules: {},
6
6
  }
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
1
  {
2
2
  "name": "@anjianshi/utils",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "Common JavaScript Utils",
5
- "homepage": "https://github.com/anjianshi/js-utils",
5
+ "homepage": "https://github.com/anjianshi/js-packages/utils",
6
6
  "bugs": {
7
- "url": "https://github.com/anjianshi/js-utils/issues",
7
+ "url": "https://github.com/anjianshi/js-packages/issues",
8
8
  "email": "anjianshi@gmail.com"
9
9
  },
10
10
  "license": "MIT",
11
11
  "author": "anjianshi <anjianshi@gmail.com>",
12
- "repository": "github:anjianshi/js-utils",
12
+ "repository": "github:anjianshi/js-packages",
13
13
  "publishConfig": {
14
14
  "registry": "https://registry.npmjs.org/",
15
15
  "access": "public"
16
16
  },
17
17
  "type": "module",
18
- "scripts": {
19
- "watch": "npm run clear && tsc --watch",
20
- "build": "npm run clear && tsc",
21
- "clear": "rm -rf dist",
22
- "prepublishOnly": "npm run build && cp -R dist/* ./",
23
- "postpublish": "node ./build-cleanup.cjs",
24
- "lint": "tsc --noEmit && eslint './src/**/*'"
25
- },
26
18
  "main": "index.js",
27
19
  "dependencies": {
28
20
  "dayjs": "^1.11.10",
29
21
  "lodash": "^4.17.21"
30
22
  },
31
23
  "devDependencies": {
32
- "@anjianshi/presets-eslint-node": "^1.0.3",
33
- "@anjianshi/presets-eslint-typescript": "^1.0.3",
34
- "@anjianshi/presets-prettier": "^1.0.0",
35
- "@anjianshi/presets-typescript": "^1.0.2",
36
24
  "@types/debug": "^4.1.9",
37
25
  "@types/lodash": "^4.14.199",
38
26
  "@types/node": "^20.8.6",
39
27
  "chalk": "^5.3.0",
40
28
  "dotenv": "^16.4.5",
41
29
  "typeorm": "^0.3.20",
42
- "vconsole": "^3.15.1"
30
+ "vconsole": "^3.15.1",
31
+ "typescript": "^5.4.3",
32
+ "@anjianshi/presets-eslint-node": "3.1.0",
33
+ "@anjianshi/presets-eslint-base": "3.0.0",
34
+ "@anjianshi/presets-prettier": "3.0.0",
35
+ "@anjianshi/presets-typescript": "3.0.0",
36
+ "@anjianshi/presets-eslint-typescript": "3.1.0"
43
37
  },
44
38
  "eslintIgnore": [],
45
- "prettier": "@anjianshi/presets-prettier/prettierrc"
46
- }
39
+ "prettier": "@anjianshi/presets-prettier/prettierrc",
40
+ "scripts": {
41
+ "watch": "npm run clear && tsc --watch",
42
+ "build": "npm run clear && tsc",
43
+ "clear": "rm -rf dist",
44
+ "lint": "tsc --noEmit && eslint './src/**/*'"
45
+ }
46
+ }
package/src/.eslintrc.cjs CHANGED
@@ -1,4 +1,4 @@
1
1
  /* eslint-env node */
2
2
  module.exports = {
3
- extends: ['../node_modules/@anjianshi/presets-eslint-typescript/exclusive.js'],
3
+ extends: [require.resolve('@anjianshi/presets-eslint-typescript/exclusive.cjs')],
4
4
  }
@@ -1,4 +1,4 @@
1
1
  /* eslint-env node */
2
2
  module.exports = {
3
- extends: ['../../node_modules/@anjianshi/presets-eslint-node/exclusive.js'],
3
+ extends: [require.resolve('@anjianshi/presets-eslint-node/exclusive.cjs')],
4
4
  }
@@ -16,5 +16,5 @@ export type TupleOptions = {
16
16
  tuple: Validator[];
17
17
  };
18
18
  export declare class ArrayValidator extends Validator<ArrayOptions | TupleOptions> {
19
- validate(field: string, value: unknown): import("@/lang/may-success.js").Failed<void> | import("@/lang/may-success.js").Success<unknown>;
19
+ validate(field: string, value: unknown): import("../lang/may-success.js").Failed<void> | import("../lang/may-success.js").Success<unknown>;
20
20
  }
@@ -1,4 +1,4 @@
1
1
  import { Validator } from './base.js';
2
2
  export declare class BooleanValidator extends Validator {
3
- validate(field: string, value: unknown): import("@/lang/may-success.js").Failed<void> | import("@/lang/may-success.js").Success<unknown>;
3
+ validate(field: string, value: unknown): import("../lang/may-success.js").Failed<void> | import("../lang/may-success.js").Success<unknown>;
4
4
  }
@@ -11,5 +11,5 @@ export interface NumberOptions {
11
11
  }
12
12
  export declare class NumberValidator extends Validator<NumberOptions> {
13
13
  constructor(options?: Partial<BaseOptions & NumberOptions>);
14
- validate(field: string, value: unknown): import("@/lang/may-success.js").Failed<void> | import("@/lang/may-success.js").Success<unknown>;
14
+ validate(field: string, value: unknown): import("../lang/may-success.js").Failed<void> | import("../lang/may-success.js").Success<unknown>;
15
15
  }
@@ -16,5 +16,5 @@ export type RecordOptions = {
16
16
  max?: number;
17
17
  };
18
18
  export declare class ObjectValidator extends Validator<StructOptions | RecordOptions> {
19
- validate(field: string, value: unknown): import("@/lang/may-success.js").Failed<void> | import("@/lang/may-success.js").Success<unknown>;
19
+ validate(field: string, value: unknown): import("../lang/may-success.js").Failed<void> | import("../lang/may-success.js").Success<unknown>;
20
20
  }
@@ -13,5 +13,5 @@ export interface StringOptions {
13
13
  }
14
14
  export declare class StringValidator extends Validator<StringOptions> {
15
15
  constructor(options?: Partial<BaseOptions & StringOptions>);
16
- validate(field: string, value: unknown): import("@/lang/may-success.js").Failed<void> | import("@/lang/may-success.js").Success<unknown>;
16
+ validate(field: string, value: unknown): import("../lang/may-success.js").Failed<void> | import("../lang/may-success.js").Success<unknown>;
17
17
  }