@anteros/core 0.0.5 → 0.0.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/func.ts +13 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@anteros/core",
3
3
  "module": "index.ts",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "type": "module",
6
6
  "description": "Anteros Core",
7
7
  "private": false,
package/utils/func.ts CHANGED
@@ -465,9 +465,19 @@ async function generateRandom(options: GenerateRandomOptions, ctx: {
465
465
  result += charset[randomIndex];
466
466
  }
467
467
 
468
- const start = typeof startWith === 'function' ? startWith(result) : startWith;
469
- const end = typeof endWith === 'function' ? endWith(result) : endWith;
470
- result = start + result + end;
468
+ // String → préfixe/suffixe classique. Fonction → elle reçoit la valeur
469
+ // et retourne le résultat final (pas de re-concaténation pour éviter la duplication).
470
+ if (typeof startWith === 'function') {
471
+ result = startWith(result);
472
+ } else {
473
+ result = startWith + result;
474
+ }
475
+
476
+ if (typeof endWith === 'function') {
477
+ result = endWith(result);
478
+ } else {
479
+ result = result + endWith;
480
+ }
471
481
 
472
482
  if (toLowerCase) {
473
483
  result = result.toLowerCase();