a-js-tools 1.0.7 → 1.0.9
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/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/getRandomString.cjs +1 -1
- package/src/getRandomString.mjs +1 -1
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateConstructor, createConstructor } from 'src/object/createConstructor';
|
|
1
|
+
import { CreateConstructor, createConstructor } from './src/object/createConstructor';
|
|
2
2
|
export { toLowerCamelCase, toSplitCase, getRandomFloat, getRandomInt, getRandomString, } from './src/index';
|
|
3
3
|
export { throttle, debounce } from './src/performance';
|
|
4
4
|
export type { DebounceAndThrottleReturnType } from './src/performance';
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"name": "a-js-tools",
|
|
5
5
|
"description": "一点点 🤏 js 函数",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"a-type-of-js": "^1.0.
|
|
8
|
+
"a-type-of-js": "^1.0.5"
|
|
9
9
|
},
|
|
10
10
|
"main": "index.cjs",
|
|
11
11
|
"module": "index.mjs",
|
package/src/getRandomString.cjs
CHANGED
|
@@ -71,7 +71,7 @@ function getRandomString(options) {
|
|
|
71
71
|
if (initOptions.includeSpecial)
|
|
72
72
|
interleaveString(templateCharsArr, initOptions.chars3);
|
|
73
73
|
// 使用密码学安全的随机数生成器
|
|
74
|
-
const bytes =
|
|
74
|
+
const bytes = globalThis.crypto.getRandomValues(new Uint8Array(initOptions.length));
|
|
75
75
|
let result = '';
|
|
76
76
|
/** 获取最后的 chars 数据 */
|
|
77
77
|
const chars = templateCharsArr.join('');
|
package/src/getRandomString.mjs
CHANGED
|
@@ -69,7 +69,7 @@ function getRandomString(options) {
|
|
|
69
69
|
if (initOptions.includeSpecial)
|
|
70
70
|
interleaveString(templateCharsArr, initOptions.chars3);
|
|
71
71
|
// 使用密码学安全的随机数生成器
|
|
72
|
-
const bytes =
|
|
72
|
+
const bytes = globalThis.crypto.getRandomValues(new Uint8Array(initOptions.length));
|
|
73
73
|
let result = '';
|
|
74
74
|
/** 获取最后的 chars 数据 */
|
|
75
75
|
const chars = templateCharsArr.join('');
|