@dnax/core 0.74.7 → 0.74.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.
@@ -340,10 +340,14 @@ async function randomCode(
340
340
  excludeSymbols: f?.random?.excludeSymbols || [],
341
341
  });
342
342
 
343
- if (f?.random?.startWith) {
343
+ if (f?.random?.startWith && typeof f?.random?.startWith == "string") {
344
344
  code = f?.random?.startWith + code;
345
345
  }
346
346
 
347
+ if (f?.random?.startWith && typeof f?.random?.startWith == "function") {
348
+ code = f?.random?.startWith(code);
349
+ }
350
+
347
351
  if (f?.random?.endWith) {
348
352
  code = code + f?.random?.endWith;
349
353
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.74.7",
3
+ "version": "0.74.9",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {},
package/types/index.ts CHANGED
@@ -116,7 +116,7 @@ export type Field = {
116
116
  useNumbers?: boolean;
117
117
  includeSymbols?: Array<any>;
118
118
  excludeSymbols?: Array<any>;
119
- startWith?: string;
119
+ startWith?: string | ((code: string) => string);
120
120
  endWith?: string;
121
121
  toUpperCase?: boolean;
122
122
  toLowerCase?: boolean;