@sqlrooms/utils 0.26.0-rc.0 → 0.26.0-rc.2

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/dist/random.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  /**
2
2
  * Generates a random string of specified length with optional seed
3
3
  * @param length - The length of the random string to generate
4
- * @param seed - Optional seed string for reproducible random generation
4
+ * @param seed - Seed will be ignored.
5
5
  * @returns Random string containing uppercase letters, lowercase letters, and numbers
6
6
  * @example
7
7
  * ```ts
8
8
  * const random = genRandomStr(10); // e.g., "aB3kF9mN2x"
9
- * const seeded = genRandomStr(10, "myseed"); // Will always generate the same string for "myseed"
10
9
  * ```
11
10
  */
12
11
  export declare function genRandomStr(length: number, seed?: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,UAgBzD"}
1
+ {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,UAezD"}
package/dist/random.js CHANGED
@@ -1,20 +1,17 @@
1
- import { alea } from 'seedrandom';
2
1
  /**
3
2
  * Generates a random string of specified length with optional seed
4
3
  * @param length - The length of the random string to generate
5
- * @param seed - Optional seed string for reproducible random generation
4
+ * @param seed - Seed will be ignored.
6
5
  * @returns Random string containing uppercase letters, lowercase letters, and numbers
7
6
  * @example
8
7
  * ```ts
9
8
  * const random = genRandomStr(10); // e.g., "aB3kF9mN2x"
10
- * const seeded = genRandomStr(10, "myseed"); // Will always generate the same string for "myseed"
11
9
  * ```
12
10
  */
13
11
  export function genRandomStr(length, seed) {
14
- const rnd = seed ? alea(seed) : Math.random;
15
12
  return Array.from((function* () {
16
13
  for (let i = 0; i < length; i++) {
17
- const v = Math.floor(rnd() * (26 * 2 + 10));
14
+ const v = Math.floor(Math.random() * (26 * 2 + 10));
18
15
  if (v < 26) {
19
16
  yield String.fromCharCode(v + 65); // 'A' - 'Z'
20
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"random.js","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAC;AAChC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,IAAa;IACxD,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAC5C,OAAO,KAAK,CAAC,IAAI,CACf,CAAC,QAAQ,CAAC;QACR,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAC5C,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;gBACX,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,YAAY;YACjD,CAAC;iBAAM,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;gBAClB,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,YAAY;YACjD,CAAC;iBAAM,CAAC;gBACN,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,YAAY;YACjD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,EAAE,CACL,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACb,CAAC","sourcesContent":["import {alea} from 'seedrandom';\n/**\n * Generates a random string of specified length with optional seed\n * @param length - The length of the random string to generate\n * @param seed - Optional seed string for reproducible random generation\n * @returns Random string containing uppercase letters, lowercase letters, and numbers\n * @example\n * ```ts\n * const random = genRandomStr(10); // e.g., \"aB3kF9mN2x\"\n * const seeded = genRandomStr(10, \"myseed\"); // Will always generate the same string for \"myseed\"\n * ```\n */\nexport function genRandomStr(length: number, seed?: string) {\n const rnd = seed ? alea(seed) : Math.random;\n return Array.from(\n (function* () {\n for (let i = 0; i < length; i++) {\n const v = Math.floor(rnd() * (26 * 2 + 10));\n if (v < 26) {\n yield String.fromCharCode(v + 65); // 'A' - 'Z'\n } else if (v < 52) {\n yield String.fromCharCode(v + 71); // 'a' - 'z'\n } else {\n yield String.fromCharCode(v + 48); // '0' - '9'\n }\n }\n })(),\n ).join('');\n}\n"]}
1
+ {"version":3,"file":"random.js","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,IAAa;IACxD,OAAO,KAAK,CAAC,IAAI,CACf,CAAC,QAAQ,CAAC;QACR,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACpD,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;gBACX,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,YAAY;YACjD,CAAC;iBAAM,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;gBAClB,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,YAAY;YACjD,CAAC;iBAAM,CAAC;gBACN,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,YAAY;YACjD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,EAAE,CACL,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACb,CAAC","sourcesContent":["/**\n * Generates a random string of specified length with optional seed\n * @param length - The length of the random string to generate\n * @param seed - Seed will be ignored.\n * @returns Random string containing uppercase letters, lowercase letters, and numbers\n * @example\n * ```ts\n * const random = genRandomStr(10); // e.g., \"aB3kF9mN2x\"\n * ```\n */\nexport function genRandomStr(length: number, seed?: string) {\n return Array.from(\n (function* () {\n for (let i = 0; i < length; i++) {\n const v = Math.floor(Math.random() * (26 * 2 + 10));\n if (v < 26) {\n yield String.fromCharCode(v + 65); // 'A' - 'Z'\n } else if (v < 52) {\n yield String.fromCharCode(v + 71); // 'a' - 'z'\n } else {\n yield String.fromCharCode(v + 48); // '0' - '9'\n }\n }\n })(),\n ).join('');\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sqlrooms/utils",
3
- "version": "0.26.0-rc.0",
3
+ "version": "0.26.0-rc.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/index.js",
@@ -30,19 +30,17 @@
30
30
  "d3-color": "^3.1.0",
31
31
  "d3-format": "^3.1.0",
32
32
  "d3-time-format": "^4.1.0",
33
- "dayjs": "^1.11.13",
34
- "seedrandom": "^3.0.5"
33
+ "dayjs": "^1.11.18"
35
34
  },
36
35
  "devDependencies": {
37
36
  "@types/d3-color": "^3.1.3",
38
37
  "@types/d3-format": "^3.0.4",
39
38
  "@types/d3-time-format": "^4.0.3",
40
- "@types/seedrandom": "^3.0.8",
41
39
  "usehooks-ts": "^3.1.1"
42
40
  },
43
41
  "peerDependencies": {
44
42
  "react": ">=18",
45
43
  "react-dom": ">=18"
46
44
  },
47
- "gitHead": "05d355acee6ea65b33b09c6e49d7746ffacb866e"
45
+ "gitHead": "86e1f2915278944e6bec6b19ab8ac16dc094cbb9"
48
46
  }