fezbox 0.0.1-security → 1.3.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.
- package/README.md +319 -3
- package/crypto.d.ts +1 -0
- package/crypto.js +1 -0
- package/data.d.ts +1 -0
- package/data.js +1 -0
- package/dist/crypto/decrypt.d.ts +8 -0
- package/dist/crypto/decrypt.d.ts.map +1 -0
- package/dist/crypto/index.cjs +1 -0
- package/dist/crypto/index.d.ts +2 -0
- package/dist/crypto/index.d.ts.map +1 -0
- package/dist/crypto/index.js +4 -0
- package/dist/crypto.d.ts +2 -0
- package/dist/data/clone.d.ts +7 -0
- package/dist/data/clone.d.ts.map +1 -0
- package/dist/data/index.cjs +1 -0
- package/dist/data/index.d.ts +2 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +4 -0
- package/dist/data.d.ts +2 -0
- package/dist/decrypt-B6fiICsn.js +1 -0
- package/dist/decrypt-DwrxsWcv.mjs +11 -0
- package/dist/dom/index.cjs +1 -0
- package/dist/dom/index.d.ts +2 -0
- package/dist/dom/index.d.ts.map +1 -0
- package/dist/dom/index.js +28 -0
- package/dist/dom/outsideClick.d.ts +27 -0
- package/dist/dom/outsideClick.d.ts.map +1 -0
- package/dist/dom.d.ts +2 -0
- package/dist/env/env.d.ts +32 -0
- package/dist/env/env.d.ts.map +1 -0
- package/dist/env/index.cjs +1 -0
- package/dist/env/index.d.ts +2 -0
- package/dist/env/index.d.ts.map +1 -0
- package/dist/env/index.js +48 -0
- package/dist/env.d.ts +2 -0
- package/dist/fezbox.cjs +1 -0
- package/dist/fezbox.js +162 -0
- package/dist/file/fetch.d.ts +9 -0
- package/dist/file/fetch.d.ts.map +1 -0
- package/dist/file/format.d.ts +7 -0
- package/dist/file/format.d.ts.map +1 -0
- package/dist/file/index.cjs +1 -0
- package/dist/file/index.d.ts +4 -0
- package/dist/file/index.d.ts.map +1 -0
- package/dist/file/index.js +25 -0
- package/dist/file/upload.d.ts +12 -0
- package/dist/file/upload.d.ts.map +1 -0
- package/dist/file.d.ts +2 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/qr/index.cjs +1 -0
- package/dist/qr/index.d.ts +95 -0
- package/dist/qr/index.d.ts.map +1 -0
- package/dist/qr/index.js +366 -0
- package/dist/qr/qrtest.d.ts +2 -0
- package/dist/qr/qrtest.d.ts.map +1 -0
- package/dist/qr.d.ts +2 -0
- package/dist/random/index.cjs +1 -0
- package/dist/random/index.d.ts +5 -0
- package/dist/random/index.d.ts.map +1 -0
- package/dist/random/index.js +46 -0
- package/dist/random/probability.d.ts +90 -0
- package/dist/random/probability.d.ts.map +1 -0
- package/dist/random.d.ts +2 -0
- package/dist/relative-5TnWB4bl.js +1 -0
- package/dist/relative-D0OTNLYG.mjs +8 -0
- package/dist/storage/index.d.ts +39 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/time/index.cjs +1 -0
- package/dist/time/index.d.ts +2 -0
- package/dist/time/index.d.ts.map +1 -0
- package/dist/time/index.js +4 -0
- package/dist/time/relative.d.ts +8 -0
- package/dist/time/relative.d.ts.map +1 -0
- package/dist/time.d.ts +2 -0
- package/dist/url/index.cjs +1 -0
- package/dist/url/index.d.ts +2 -0
- package/dist/url/index.d.ts.map +1 -0
- package/dist/url/index.js +19 -0
- package/dist/url/query.d.ts +51 -0
- package/dist/url/query.d.ts.map +1 -0
- package/dist/url.d.ts +2 -0
- package/dom.d.ts +1 -0
- package/dom.js +1 -0
- package/eslint.config.js +46 -0
- package/file.d.ts +1 -0
- package/file.js +1 -0
- package/package.json +119 -3
- package/qr.d.ts +1 -0
- package/qr.js +1 -0
- package/time.d.ts +1 -0
- package/time.js +1 -0
- package/url.d.ts +1 -0
- package/url.js +1 -0
@@ -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
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');
|
package/eslint.config.js
ADDED
@@ -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,122 @@
|
|
1
1
|
{
|
2
2
|
"name": "fezbox",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "1.3.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
|
+
"./random": {
|
50
|
+
"types": "./dist/random/index.d.ts",
|
51
|
+
"import": "./dist/random/index.js",
|
52
|
+
"require": "./dist/random/index.cjs"
|
53
|
+
},
|
54
|
+
"./storage": {
|
55
|
+
"types": "./dist/storage/index.d.ts",
|
56
|
+
"import": "./dist/storage/index.js",
|
57
|
+
"require": "./dist/storage/index.cjs"
|
58
|
+
},
|
59
|
+
"./env": {
|
60
|
+
"types": "./dist/env/index.d.ts",
|
61
|
+
"import": "./dist/env/index.js",
|
62
|
+
"require": "./dist/env/index.cjs"
|
63
|
+
}
|
64
|
+
},
|
65
|
+
"typesVersions": {
|
66
|
+
"*": {
|
67
|
+
"*": [
|
68
|
+
"dist/*",
|
69
|
+
"dist/*/index.d.ts"
|
70
|
+
]
|
71
|
+
}
|
72
|
+
},
|
73
|
+
"files": [
|
74
|
+
"dist",
|
75
|
+
"README.md",
|
76
|
+
"*.js",
|
77
|
+
"*.d.ts"
|
78
|
+
],
|
79
|
+
"scripts": {
|
80
|
+
"build": "vite build",
|
81
|
+
"dev": "vitest --watch",
|
82
|
+
"docs": "vitepress dev docs",
|
83
|
+
"test": "vitest",
|
84
|
+
"test:coverage": "vitest --coverage",
|
85
|
+
"lint": "eslint src --ext .ts,.tsx,.js,.jsx",
|
86
|
+
"lint:fix": "eslint src --ext .ts,.tsx,.js,.jsx --fix",
|
87
|
+
"format": "prettier --write \"src/**/*.{ts,tsx,.js,jsx,json,md}\"",
|
88
|
+
"typecheck": "tsc --noEmit",
|
89
|
+
"prepublishOnly": "pnpm run build"
|
90
|
+
},
|
91
|
+
"keywords": [
|
92
|
+
"utils",
|
93
|
+
"typescript"
|
94
|
+
],
|
95
|
+
"author": "jane",
|
96
|
+
"license": "MIT",
|
97
|
+
"devDependencies": {
|
98
|
+
"@types/crypto-js": "^4.2.2",
|
99
|
+
"@typescript-eslint/eslint-plugin": "^8.40.0",
|
100
|
+
"@typescript-eslint/parser": "^8.40.0",
|
101
|
+
"@vitest/coverage-v8": "^3.2.4",
|
102
|
+
"eslint": "^9.33.0",
|
103
|
+
"eslint-config-prettier": "^10.1.8",
|
104
|
+
"eslint-plugin-prettier": "^5.0.0",
|
105
|
+
"jsdom": "^26.1.0",
|
106
|
+
"prettier": "^3.0.0",
|
107
|
+
"typescript": "^5.0.0",
|
108
|
+
"vite": "^7.1.2",
|
109
|
+
"vite-plugin-dts": "^4.5.4",
|
110
|
+
"vitepress": "^1.6.4",
|
111
|
+
"vitest": "^3.2.4"
|
112
|
+
},
|
113
|
+
"dependencies": {
|
114
|
+
"crypto-js": "^4.2.0",
|
115
|
+
"dayjs": "^1.11.0"
|
116
|
+
},
|
117
|
+
"packageManager": "pnpm@10.0.0",
|
118
|
+
"engines": {
|
119
|
+
"node": ">=18.0.0",
|
120
|
+
"pnpm": ">=9.0.0"
|
121
|
+
}
|
6
122
|
}
|
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');
|