fezbox 0.0.1-security → 1.2.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.

Potentially problematic release.


This version of fezbox might be problematic. Click here for more details.

Files changed (78) hide show
  1. package/README.md +320 -3
  2. package/crypto.d.ts +1 -0
  3. package/crypto.js +1 -0
  4. package/data.d.ts +1 -0
  5. package/data.js +1 -0
  6. package/dist/crypto/decrypt.d.ts +8 -0
  7. package/dist/crypto/decrypt.d.ts.map +1 -0
  8. package/dist/crypto/index.cjs +1 -0
  9. package/dist/crypto/index.d.ts +2 -0
  10. package/dist/crypto/index.d.ts.map +1 -0
  11. package/dist/crypto/index.js +4 -0
  12. package/dist/crypto.d.ts +2 -0
  13. package/dist/data/clone.d.ts +7 -0
  14. package/dist/data/clone.d.ts.map +1 -0
  15. package/dist/data/index.cjs +1 -0
  16. package/dist/data/index.d.ts +2 -0
  17. package/dist/data/index.d.ts.map +1 -0
  18. package/dist/data/index.js +4 -0
  19. package/dist/data.d.ts +2 -0
  20. package/dist/decrypt-B6fiICsn.js +1 -0
  21. package/dist/decrypt-DwrxsWcv.mjs +11 -0
  22. package/dist/dom/index.cjs +1 -0
  23. package/dist/dom/index.d.ts +2 -0
  24. package/dist/dom/index.d.ts.map +1 -0
  25. package/dist/dom/index.js +28 -0
  26. package/dist/dom/outsideClick.d.ts +27 -0
  27. package/dist/dom/outsideClick.d.ts.map +1 -0
  28. package/dist/dom.d.ts +2 -0
  29. package/dist/fezbox.cjs +1 -0
  30. package/dist/fezbox.js +141 -0
  31. package/dist/file/fetch.d.ts +9 -0
  32. package/dist/file/fetch.d.ts.map +1 -0
  33. package/dist/file/format.d.ts +7 -0
  34. package/dist/file/format.d.ts.map +1 -0
  35. package/dist/file/index.cjs +1 -0
  36. package/dist/file/index.d.ts +4 -0
  37. package/dist/file/index.d.ts.map +1 -0
  38. package/dist/file/index.js +25 -0
  39. package/dist/file/upload.d.ts +12 -0
  40. package/dist/file/upload.d.ts.map +1 -0
  41. package/dist/file.d.ts +2 -0
  42. package/dist/index.d.ts +17 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/qr/index.cjs +1 -0
  45. package/dist/qr/index.d.ts +94 -0
  46. package/dist/qr/index.d.ts.map +1 -0
  47. package/dist/qr/index.js +323 -0
  48. package/dist/qr.d.ts +2 -0
  49. package/dist/relative-5TnWB4bl.js +1 -0
  50. package/dist/relative-D0OTNLYG.mjs +8 -0
  51. package/dist/storage/index.d.ts +39 -0
  52. package/dist/storage/index.d.ts.map +1 -0
  53. package/dist/time/index.cjs +1 -0
  54. package/dist/time/index.d.ts +2 -0
  55. package/dist/time/index.d.ts.map +1 -0
  56. package/dist/time/index.js +4 -0
  57. package/dist/time/relative.d.ts +8 -0
  58. package/dist/time/relative.d.ts.map +1 -0
  59. package/dist/time.d.ts +2 -0
  60. package/dist/url/index.cjs +1 -0
  61. package/dist/url/index.d.ts +2 -0
  62. package/dist/url/index.d.ts.map +1 -0
  63. package/dist/url/index.js +19 -0
  64. package/dist/url/query.d.ts +51 -0
  65. package/dist/url/query.d.ts.map +1 -0
  66. package/dist/url.d.ts +2 -0
  67. package/dom.d.ts +1 -0
  68. package/dom.js +1 -0
  69. package/eslint.config.js +46 -0
  70. package/file.d.ts +1 -0
  71. package/file.js +1 -0
  72. package/package.json +109 -3
  73. package/qr.d.ts +1 -0
  74. package/qr.js +1 -0
  75. package/time.d.ts +1 -0
  76. package/time.js +1 -0
  77. package/url.d.ts +1 -0
  78. package/url.js +1 -0
@@ -0,0 +1,19 @@
1
+ const l = (r) => {
2
+ const e = (r || (typeof window != "undefined" ? window.location.href : "")).split("#")[0], n = e.substring(e.lastIndexOf("?") + 1);
3
+ if (!n || n === e)
4
+ return {};
5
+ const o = {}, a = /([^?&=]+)=([^?&=]*)/g;
6
+ let t;
7
+ for (; (t = a.exec(n)) !== null; )
8
+ try {
9
+ const s = decodeURIComponent(t[1]), u = decodeURIComponent(t[2]);
10
+ o[s] = u;
11
+ } catch (s) {
12
+ o[t[1]] = t[2];
13
+ }
14
+ return o;
15
+ }, i = (r, c) => l(c)[r];
16
+ export {
17
+ l as getQueryObject,
18
+ i as getQueryParam
19
+ };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * 获取 URL 查询参数对象
3
+ *
4
+ * 解析 URL 中的查询字符串,返回包含所有查询参数的对象。
5
+ * 自动处理 URL 编码和解码,支持空值参数。
6
+ *
7
+ * @param url - 可选的 URL 字符串,默认为当前页面 URL(仅浏览器环境)
8
+ * @returns 包含所有查询参数的对象,如果没有查询参数则返回空对象
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * // 从指定 URL 获取参数
13
+ * getQueryObject('https://example.com?id=123&name=test&empty=')
14
+ * // 返回: { id: '123', name: 'test', empty: '' }
15
+ *
16
+ * // 从当前页面 URL 获取参数(浏览器环境)
17
+ * getQueryObject()
18
+ * // 返回: 当前页面的查询参数对象
19
+ *
20
+ * // 处理特殊字符和编码
21
+ * getQueryObject('https://example.com?query=hello%20world&chinese=%E4%B8%AD%E6%96%87')
22
+ * // 返回: { query: 'hello world', chinese: '中文' }
23
+ *
24
+ * // 没有查询参数的情况
25
+ * getQueryObject('https://example.com')
26
+ * // 返回: {}
27
+ * ```
28
+ */
29
+ export declare const getQueryObject: (url?: string) => Record<string, string>;
30
+ /**
31
+ * 获取单个 URL 查询参数
32
+ *
33
+ * 这是 getQueryObject 的便捷方法,用于获取单个查询参数。
34
+ *
35
+ * @param name - 参数名
36
+ * @param url - 可选的 URL 字符串,默认为当前页面 URL
37
+ * @returns 参数值,如果不存在则返回 undefined
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * // 获取单个参数
42
+ * getQueryParam('id', 'https://example.com?id=123&name=test')
43
+ * // 返回: '123'
44
+ *
45
+ * // 参数不存在的情况
46
+ * getQueryParam('notExist', 'https://example.com?id=123')
47
+ * // 返回: undefined
48
+ * ```
49
+ */
50
+ export declare const getQueryParam: (name: string, url?: string) => string | undefined;
51
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/url/query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAoClE,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,KAAG,MAAM,GAAG,SAGnE,CAAA"}
package/dist/url.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './url/index'
2
+ export {}
package/dom.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/dom/index';
package/dom.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/dom/index.cjs');
@@ -0,0 +1,46 @@
1
+ import js from '@eslint/js'
2
+ import tseslint from '@typescript-eslint/eslint-plugin'
3
+ import tsparser from '@typescript-eslint/parser'
4
+ import prettierConfig from 'eslint-config-prettier'
5
+ import prettierPlugin from 'eslint-plugin-prettier'
6
+
7
+ export default [
8
+ js.configs.recommended,
9
+ {
10
+ files: ['**/*.{ts,tsx}'],
11
+ languageOptions: {
12
+ parser: tsparser,
13
+ parserOptions: {
14
+ ecmaVersion: 'latest',
15
+ sourceType: 'module'
16
+ },
17
+ globals: {
18
+ ...globalThis,
19
+ document: 'readonly',
20
+ window: 'readonly',
21
+ console: 'readonly',
22
+ process: 'readonly',
23
+ Buffer: 'readonly',
24
+ __dirname: 'readonly',
25
+ __filename: 'readonly',
26
+ global: 'readonly'
27
+ }
28
+ },
29
+ plugins: {
30
+ '@typescript-eslint': tseslint,
31
+ prettier: prettierPlugin
32
+ },
33
+ rules: {
34
+ ...tseslint.configs.recommended.rules,
35
+ ...prettierConfig.rules,
36
+ 'prettier/prettier': 'error',
37
+ '@typescript-eslint/no-unused-vars': 'error',
38
+ '@typescript-eslint/no-explicit-any': 'warn',
39
+ '@typescript-eslint/explicit-function-return-type': 'off',
40
+ '@typescript-eslint/explicit-module-boundary-types': 'off'
41
+ }
42
+ },
43
+ {
44
+ ignores: ['dist/', 'node_modules/', '*.config.js', '*.config.ts', 'coverage/']
45
+ }
46
+ ]
package/file.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/file/index';
package/file.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/file/index.cjs');
package/package.json CHANGED
@@ -1,6 +1,112 @@
1
1
  {
2
2
  "name": "fezbox",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.2.0",
4
+ "description": "A comprehensive JavaScript/TypeScript utility library with modular design, complete test coverage, and optimized performance",
5
+ "main": "./dist/fezbox.cjs",
6
+ "module": "./dist/fezbox.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/fezbox.js",
12
+ "require": "./dist/fezbox.cjs"
13
+ },
14
+ "./crypto": {
15
+ "types": "./dist/crypto/index.d.ts",
16
+ "import": "./dist/crypto/index.js",
17
+ "require": "./dist/crypto/index.cjs"
18
+ },
19
+ "./data": {
20
+ "types": "./dist/data/index.d.ts",
21
+ "import": "./dist/data/index.js",
22
+ "require": "./dist/data/index.cjs"
23
+ },
24
+ "./dom": {
25
+ "types": "./dist/dom/index.d.ts",
26
+ "import": "./dist/dom/index.js",
27
+ "require": "./dist/dom/index.cjs"
28
+ },
29
+ "./file": {
30
+ "types": "./dist/file/index.d.ts",
31
+ "import": "./dist/file/index.js",
32
+ "require": "./dist/file/index.cjs"
33
+ },
34
+ "./time": {
35
+ "types": "./dist/time/index.d.ts",
36
+ "import": "./dist/time/index.js",
37
+ "require": "./dist/time/index.cjs"
38
+ },
39
+ "./url": {
40
+ "types": "./dist/url/index.d.ts",
41
+ "import": "./dist/url/index.js",
42
+ "require": "./dist/url/index.cjs"
43
+ },
44
+ "./qr": {
45
+ "types": "./dist/qr/index.d.ts",
46
+ "import": "./dist/qr/index.js",
47
+ "require": "./dist/qr/index.cjs"
48
+ },
49
+ "./storage": {
50
+ "types": "./dist/storage/index.d.ts",
51
+ "import": "./dist/storage/index.js",
52
+ "require": "./dist/storage/index.cjs"
53
+ }
54
+ },
55
+ "typesVersions": {
56
+ "*": {
57
+ "*": [
58
+ "dist/*",
59
+ "dist/*/index.d.ts"
60
+ ]
61
+ }
62
+ },
63
+ "files": [
64
+ "dist",
65
+ "README.md",
66
+ "*.js",
67
+ "*.d.ts"
68
+ ],
69
+ "scripts": {
70
+ "build": "vite build",
71
+ "dev": "vitest --watch",
72
+ "docs": "vitepress dev docs",
73
+ "test": "vitest",
74
+ "test:coverage": "vitest --coverage",
75
+ "lint": "eslint src --ext .ts,.tsx,.js,.jsx",
76
+ "lint:fix": "eslint src --ext .ts,.tsx,.js,.jsx --fix",
77
+ "format": "prettier --write \"src/**/*.{ts,tsx,.js,jsx,json,md}\"",
78
+ "typecheck": "tsc --noEmit",
79
+ "prepublishOnly": "pnpm run build"
80
+ },
81
+ "keywords": [
82
+ "utils",
83
+ "typescript"
84
+ ],
85
+ "author": "jane",
86
+ "license": "MIT",
87
+ "devDependencies": {
88
+ "@types/crypto-js": "^4.2.2",
89
+ "@typescript-eslint/eslint-plugin": "^8.40.0",
90
+ "@typescript-eslint/parser": "^8.40.0",
91
+ "@vitest/coverage-v8": "^3.2.4",
92
+ "eslint": "^9.33.0",
93
+ "eslint-config-prettier": "^10.1.8",
94
+ "eslint-plugin-prettier": "^5.0.0",
95
+ "jsdom": "^26.1.0",
96
+ "prettier": "^3.0.0",
97
+ "typescript": "^5.0.0",
98
+ "vite": "^7.1.2",
99
+ "vite-plugin-dts": "^4.5.4",
100
+ "vitepress": "^1.6.4",
101
+ "vitest": "^3.2.4"
102
+ },
103
+ "dependencies": {
104
+ "crypto-js": "^4.2.0",
105
+ "dayjs": "^1.11.0"
106
+ },
107
+ "packageManager": "pnpm@10.0.0",
108
+ "engines": {
109
+ "node": ">=18.0.0",
110
+ "pnpm": ">=9.0.0"
111
+ }
6
112
  }
package/qr.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/qr/index';
package/qr.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/qr/index.cjs');
package/time.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/time/index';
package/time.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/time/index.cjs');
package/url.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/url/index';
package/url.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/url/index.cjs');