baja-lite 1.6.2 → 1.6.4

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.
Files changed (73) hide show
  1. package/.eslintignore +7 -0
  2. package/.eslintrc.cjs +89 -0
  3. package/.prettierrc +7 -0
  4. package/.vscode/settings.json +9 -0
  5. package/ci.js +33 -0
  6. package/package-cjs.json +17 -0
  7. package/package.json +80 -80
  8. package/pnpm-lock.yaml +2840 -0
  9. package/pnpm-workspace.yaml +2 -0
  10. package/{boot-remote.js → src/boot-remote.ts} +64 -63
  11. package/{boot.js → src/boot.ts} +170 -163
  12. package/{code.js → src/code.ts} +526 -517
  13. package/{convert-xml.js → src/convert-xml.ts} +460 -410
  14. package/src/error.ts +11 -0
  15. package/src/event.ts +34 -0
  16. package/src/fn.ts +295 -0
  17. package/{index.d.ts → src/index.ts} +11 -10
  18. package/src/math.ts +405 -0
  19. package/src/object.ts +342 -0
  20. package/{snowflake.js → src/snowflake.ts} +127 -108
  21. package/src/sql.ts +5529 -0
  22. package/{sqlite.js → src/sqlite.ts} +157 -156
  23. package/src/string.ts +111 -0
  24. package/src/test-mysql.ts +148 -0
  25. package/{test-postgresql.js → src/test-postgresql.ts} +80 -91
  26. package/{test-sqlite.js → src/test-sqlite.ts} +80 -90
  27. package/{test-xml.js → src/test-xml.ts} +70 -70
  28. package/{test.js → src/test.ts} +3 -2
  29. package/src/wx/base.ts +77 -0
  30. package/src/wx/mini.ts +147 -0
  31. package/src/wx/organ.ts +290 -0
  32. package/{wx/types.d.ts → src/wx/types.ts} +549 -560
  33. package/{wx.d.ts → src/wx.ts} +3 -3
  34. package/tsconfig.cjs.json +42 -0
  35. package/tsconfig.json +44 -0
  36. package/xml/event-report.xml +13 -0
  37. package/yarn.lock +1977 -0
  38. package/boot-remote.d.ts +0 -2
  39. package/boot.d.ts +0 -2
  40. package/code.d.ts +0 -2
  41. package/convert-xml.d.ts +0 -10
  42. package/error.d.ts +0 -5
  43. package/error.js +0 -13
  44. package/event.d.ts +0 -10
  45. package/event.js +0 -38
  46. package/fn.d.ts +0 -128
  47. package/fn.js +0 -172
  48. package/index.js +0 -10
  49. package/math.d.ts +0 -83
  50. package/math.js +0 -451
  51. package/object.d.ts +0 -126
  52. package/object.js +0 -321
  53. package/snowflake.d.ts +0 -12
  54. package/sql.d.ts +0 -2148
  55. package/sql.js +0 -5372
  56. package/sqlite.d.ts +0 -32
  57. package/string.d.ts +0 -17
  58. package/string.js +0 -105
  59. package/test-mysql.d.ts +0 -2
  60. package/test-mysql.js +0 -114
  61. package/test-postgresql.d.ts +0 -2
  62. package/test-sqlite.d.ts +0 -1
  63. package/test-xml.d.ts +0 -1
  64. package/test.d.ts +0 -1
  65. package/wx/base.d.ts +0 -11
  66. package/wx/base.js +0 -78
  67. package/wx/mini.d.ts +0 -52
  68. package/wx/mini.js +0 -112
  69. package/wx/organ.d.ts +0 -65
  70. package/wx/organ.js +0 -171
  71. package/wx/types.js +0 -1
  72. package/wx.js +0 -3
  73. /package/{README.md → Readme.md} +0 -0
package/.eslintignore ADDED
@@ -0,0 +1,7 @@
1
+ /dist
2
+ /src-capacitor
3
+ /src-cordova
4
+ /.quasar
5
+ /node_modules
6
+ .eslintrc.cjs
7
+ /quasar.config.*.temporary.compiled*
package/.eslintrc.cjs ADDED
@@ -0,0 +1,89 @@
1
+ module.exports = {
2
+ // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
3
+ // This option interrupts the configuration hierarchy at this file
4
+ // Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
5
+ root: true,
6
+
7
+ // https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
8
+ // Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working
9
+ // `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted
10
+ parserOptions: {
11
+ parser: require.resolve('@typescript-eslint/parser'),
12
+ extraFileExtensions: [ '.vue' ]
13
+ },
14
+
15
+ env: {
16
+ browser: true,
17
+ es2021: true,
18
+ node: true
19
+ },
20
+
21
+ // Rules order is important, please avoid shuffling them
22
+ extends: [
23
+ // Base ESLint recommended rules
24
+ // 'eslint:recommended',
25
+
26
+ // https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage
27
+ // ESLint typescript rules
28
+ 'plugin:@typescript-eslint/recommended',
29
+
30
+ // Uncomment any of the lines below to choose desired strictness,
31
+ // but leave only one uncommented!
32
+ // See https://eslint.vuejs.org/rules/#available-rules
33
+ 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
34
+ // 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
35
+ // 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
36
+
37
+ // https://github.com/prettier/eslint-config-prettier#installation
38
+ // usage with Prettier, provided by 'eslint-config-prettier'.
39
+ 'prettier'
40
+ ],
41
+
42
+ plugins: [
43
+ // required to apply rules which need type information
44
+ '@typescript-eslint',
45
+
46
+ // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files
47
+ // required to lint *.vue files
48
+ 'vue'
49
+
50
+ // https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674
51
+ // Prettier has not been included as plugin to avoid performance impact
52
+ // add it as an extension for your IDE
53
+
54
+ ],
55
+
56
+ globals: {
57
+ ga: 'readonly', // Google Analytics
58
+ cordova: 'readonly',
59
+ __statics: 'readonly',
60
+ __QUASAR_SSR__: 'readonly',
61
+ __QUASAR_SSR_SERVER__: 'readonly',
62
+ __QUASAR_SSR_CLIENT__: 'readonly',
63
+ __QUASAR_SSR_PWA__: 'readonly',
64
+ process: 'readonly',
65
+ Capacitor: 'readonly',
66
+ chrome: 'readonly'
67
+ },
68
+
69
+ // add your custom rules here
70
+ rules: {
71
+
72
+ 'prefer-promise-reject-errors': 'off',
73
+
74
+ quotes: ['warn', 'single', { avoidEscape: true }],
75
+
76
+ // this rule, if on, would require explicit return type on the `render` function
77
+ '@typescript-eslint/explicit-function-return-type': 'off',
78
+
79
+ // in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled
80
+ '@typescript-eslint/no-var-requires': 'off',
81
+
82
+ // The core 'no-unused-vars' rules (in the eslint:recommended ruleset)
83
+ // does not work with type definitions
84
+ 'no-unused-vars': 'off',
85
+
86
+ // allow debugger during development only
87
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
88
+ }
89
+ }
package/.prettierrc ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "singleQuote": true,
3
+ "trailingComma": "all",
4
+ "semi": true,
5
+ "printWidth": 9999,
6
+ "proseWrap": "never"
7
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ // 控制相关文件嵌套展示
3
+ "explorer.fileNesting.enabled": true,
4
+ "explorer.fileNesting.expand": false,
5
+ "explorer.fileNesting.patterns": {
6
+ "package.json": "ci.js,nest-cli.json,.eslintrc.cjs,.eslintignore,eslint.config.js,package-cjs.json,bun.lockb,baja.code.json,.prettierrc,.eslintrc.js,$(capture).env.*,,pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,README*,.npmrc,.browserslistrc,yarn.lock,verify-commit.mjs,tsconfig.json,nuxt.config.ts,uno.config.ts",
7
+ },
8
+ "vue-vine.dataTrack": false
9
+ }
package/ci.js ADDED
@@ -0,0 +1,33 @@
1
+ // import { rm, exec, cp } from 'shelljs';
2
+ import fs from 'fs';
3
+ import pkg from 'shelljs';
4
+ import cjs from './package-cjs.json' with { type: "json" };
5
+ import def from './package.json' with { type: "json" };
6
+ const { rm, exec, cp } = pkg;
7
+
8
+ rm('-rf', './dist/');
9
+ rm('-rf', './tsconfig.tsbuildinfo');
10
+ exec('yarn tsc --module esnext');
11
+ rm('-rf', './tsconfig.tsbuildinfo');
12
+ cp('./package.json', './dist/package.json');
13
+ cp('./README.md', './dist/README.md');
14
+ cp('./LICENSE', './dist/LICENSE');
15
+ rm('-rf', './dist/tsconfig.tsbuildinfo');
16
+
17
+ rm('-rf', './dist-cjs/');
18
+ rm('-rf', './tsconfig.cjs.tsbuildinfo');
19
+ exec('yarn tsc -p tsconfig.cjs.json');
20
+ rm('-rf', './tsconfig.cjs.tsbuildinfo');
21
+ fs.writeFileSync('./dist-cjs/package.json', JSON.stringify(Object.assign(def, cjs), null, 2));
22
+ cp('./README.md', './dist-cjs/README.md');
23
+ cp('./LICENSE', './dist-cjs/LICENSE');
24
+
25
+
26
+ console.log('build over');
27
+ // cp('-R', './dist/*', '../fast-start/node_modules/baja-lite');
28
+ // console.log('fast-start over');
29
+ // cp('-R', './dist/*', '../attack-service/node_modules/baja-lite');
30
+ // console.log('attack-service over');
31
+ // cp('-R', './dist/*', '../attack-front/node_modules/baja-lite');
32
+ // console.log('attack-front over');
33
+ // console.log('cp over');
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "baja-lite-cjs",
3
+ "type": "commonjs",
4
+ "exports": {
5
+ ".": {
6
+ "require": "./index.js"
7
+ },
8
+ "./boot.js":"./boot.js",
9
+ "./boot-remote.js":"./boot-remote.js",
10
+ "./wx.js": "./wx.js"
11
+ },
12
+ "types": "./index.d.ts",
13
+ "bin": {
14
+ "baja": "./code.js"
15
+ },
16
+ "main": "./index.js"
17
+ }
package/package.json CHANGED
@@ -1,80 +1,80 @@
1
- {
2
- "name": "baja-lite",
3
- "version": "1.6.2",
4
- "description": "some util for self",
5
- "homepage": "https://github.com/void-soul/baja-lite",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/void-soul/baja-lite.git"
9
- },
10
- "license": "MIT",
11
- "author": "void-soul",
12
- "type": "module",
13
- "exports": {
14
- ".": {
15
- "types": "./index.d.ts",
16
- "import": "./index.js"
17
- },
18
- "./boot.js": "./boot.js",
19
- "./boot-remote.js": "./boot-remote.js",
20
- "./wx.js": "./wx.js"
21
- },
22
- "types": "./index.d.ts",
23
- "bin": {
24
- "baja": "./code.js"
25
- },
26
- "scripts": {
27
- "dist": "node ./ci.js",
28
- "mysql": "bun --inspect ./src/test-mysql.ts",
29
- "mysql2": "node inspect ./dist/cjs/test-mysql.js",
30
- "postgres": "bun --inspect ./src/test-postgresql.ts",
31
- "postgres2": "node inspect ./dist/cjs/test-postgresql.js",
32
- "sqlite": "node inspect ./dist/cjs/test-sqlite.js",
33
- "test": "bun --inspect ./src/test.ts",
34
- "test2": "node inspect ./dist/cjs/tes.js",
35
- "xml": "bun --inspect ./src/test-xml.ts"
36
- },
37
- "dependencies": {
38
- "@msgpack/msgpack": "3.1.2",
39
- "@types/request-promise": "4.1.51",
40
- "axios": "1.11.0",
41
- "baja-lite-field": "1.4.20",
42
- "decimal.js": "10.6.0",
43
- "html-parse-stringify": "3.0.1",
44
- "iterare": "1.2.1",
45
- "mustache": "4.2.0",
46
- "pino": "9.9.0",
47
- "pino-pretty": "13.1.1",
48
- "reflect-metadata": "0.2.2",
49
- "request": "2.88.2",
50
- "request-promise": "4.2.6",
51
- "sql-formatter": "15.6.6",
52
- "sqlstring": "2.3.3",
53
- "tslib": "2.8.1"
54
- },
55
- "devDependencies": {
56
- "@types/better-sqlite3": "7.6.13",
57
- "@types/mustache": "4.2.6",
58
- "@types/node": "24.3.0",
59
- "@types/shelljs": "0.8.17",
60
- "@types/sqlstring": "2.3.2",
61
- "@typescript-eslint/eslint-plugin": "8.40.0",
62
- "@typescript-eslint/parser": "8.40.0",
63
- "better-sqlite3": "12.2.0",
64
- "ioredis": "5.7.0",
65
- "mongodb": "6.18.0",
66
- "mysql2": "3.14.3",
67
- "pg": "8.16.3",
68
- "pg-pool": "3.10.1",
69
- "redlock": "5.0.0-beta.2",
70
- "shelljs": "0.10.0",
71
- "typescript": "5.9.2"
72
- },
73
- "engines": {
74
- "node": ">=20"
75
- },
76
- "publishConfig": {
77
- "access": "public"
78
- },
79
- "models": "./index.js"
80
- }
1
+ {
2
+ "name": "baja-lite",
3
+ "version": "1.6.4",
4
+ "description": "some util for self",
5
+ "homepage": "https://github.com/void-soul/baja-lite",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/void-soul/baja-lite.git"
9
+ },
10
+ "license": "MIT",
11
+ "author": "void-soul",
12
+ "type": "module",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./index.d.ts",
16
+ "import": "./index.js"
17
+ },
18
+ "./boot.js": "./boot.js",
19
+ "./boot-remote.js": "./boot-remote.js",
20
+ "./wx.js": "./wx.js"
21
+ },
22
+ "types": "./index.d.ts",
23
+ "bin": {
24
+ "baja": "./code.js"
25
+ },
26
+ "scripts": {
27
+ "dist": "node ./ci.js",
28
+ "mysql": "bun --inspect ./src/test-mysql.ts",
29
+ "mysql2": "node inspect ./dist/cjs/test-mysql.js",
30
+ "postgres": "bun --inspect ./src/test-postgresql.ts",
31
+ "postgres2": "node inspect ./dist/cjs/test-postgresql.js",
32
+ "sqlite": "node inspect ./dist/cjs/test-sqlite.js",
33
+ "test": "bun --inspect ./src/test.ts",
34
+ "test2": "node inspect ./dist/cjs/tes.js",
35
+ "xml": "bun --inspect ./src/test-xml.ts"
36
+ },
37
+ "dependencies": {
38
+ "@msgpack/msgpack": "3.1.2",
39
+ "@types/request-promise": "4.1.51",
40
+ "axios": "1.11.0",
41
+ "baja-lite-field": "1.4.20",
42
+ "decimal.js": "10.6.0",
43
+ "html-parse-stringify": "3.0.1",
44
+ "iterare": "1.2.1",
45
+ "mustache": "4.2.0",
46
+ "pino": "9.9.0",
47
+ "pino-pretty": "13.1.1",
48
+ "reflect-metadata": "0.2.2",
49
+ "request": "2.88.2",
50
+ "request-promise": "4.2.6",
51
+ "sql-formatter": "15.6.6",
52
+ "sqlstring": "2.3.3",
53
+ "tslib": "2.8.1"
54
+ },
55
+ "devDependencies": {
56
+ "@types/better-sqlite3": "7.6.13",
57
+ "@types/mustache": "4.2.6",
58
+ "@types/node": "24.3.0",
59
+ "@types/shelljs": "0.8.17",
60
+ "@types/sqlstring": "2.3.2",
61
+ "@typescript-eslint/eslint-plugin": "8.40.0",
62
+ "@typescript-eslint/parser": "8.40.0",
63
+ "better-sqlite3": "12.2.0",
64
+ "ioredis": "5.7.0",
65
+ "mongodb": "6.18.0",
66
+ "mysql2": "3.14.3",
67
+ "pg": "8.16.3",
68
+ "pg-pool": "3.10.1",
69
+ "redlock": "5.0.0-beta.2",
70
+ "shelljs": "0.10.0",
71
+ "typescript": "5.9.2"
72
+ },
73
+ "engines": {
74
+ "node": ">=20"
75
+ },
76
+ "publishConfig": {
77
+ "access": "public"
78
+ },
79
+ "models": "./index.js"
80
+ }