@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.
- package/package.json +1 -1
- package/utils/func.ts +13 -3
package/package.json
CHANGED
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
|
-
|
|
469
|
-
|
|
470
|
-
|
|
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();
|