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 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.7",
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.4"
8
+ "a-type-of-js": "^1.0.5"
9
9
  },
10
10
  "main": "index.cjs",
11
11
  "module": "index.mjs",
@@ -71,7 +71,7 @@ function getRandomString(options) {
71
71
  if (initOptions.includeSpecial)
72
72
  interleaveString(templateCharsArr, initOptions.chars3);
73
73
  // 使用密码学安全的随机数生成器
74
- const bytes = global.crypto.getRandomValues(new Uint8Array(initOptions.length));
74
+ const bytes = globalThis.crypto.getRandomValues(new Uint8Array(initOptions.length));
75
75
  let result = '';
76
76
  /** 获取最后的 chars 数据 */
77
77
  const chars = templateCharsArr.join('');
@@ -69,7 +69,7 @@ function getRandomString(options) {
69
69
  if (initOptions.includeSpecial)
70
70
  interleaveString(templateCharsArr, initOptions.chars3);
71
71
  // 使用密码学安全的随机数生成器
72
- const bytes = global.crypto.getRandomValues(new Uint8Array(initOptions.length));
72
+ const bytes = globalThis.crypto.getRandomValues(new Uint8Array(initOptions.length));
73
73
  let result = '';
74
74
  /** 获取最后的 chars 数据 */
75
75
  const chars = templateCharsArr.join('');