@springworks/random-string
Advanced tools
Comparing version
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getRandomString = exports.alphabet_19_AY_omit_0IOQUZ = exports.alphabet_09_AZ_omit_IOQ = exports.alphabet_09_az_AZ = exports.alphabet_09_az = exports.alphabet_az = exports.alphabet_09_af = exports.alphabet_09 = void 0; | ||
const nanoid_1 = require("nanoid"); | ||
/** | ||
@@ -77,5 +76,13 @@ * Characters in the range `0-9`. | ||
} | ||
return (0, nanoid_1.customAlphabet)(alphabet, length)(); | ||
return fill(alphabet, length); | ||
} | ||
exports.getRandomString = getRandomString; | ||
function fill(alphabet, length) { | ||
const max = alphabet.length - 1; | ||
let value = ''; | ||
for (let i = 0; i < length; i++) { | ||
value += alphabet.charAt(Math.min(Math.random() * max, max)); | ||
} | ||
return value; | ||
} | ||
//# sourceMappingURL=main.js.map |
{ | ||
"name": "@springworks/random-string", | ||
"version": "3005.229.0", | ||
"version": "3005.329.0", | ||
"description": "Generate random strings", | ||
@@ -11,5 +11,2 @@ "main": "build/main.js", | ||
"scripts": {}, | ||
"dependencies": { | ||
"nanoid": "^3.1.20" | ||
}, | ||
"publishConfig": { | ||
@@ -24,3 +21,3 @@ "access": "public" | ||
"homepage": "https://github.com/Springworks/m2h-mono/tree/master/packages/random-string#readme", | ||
"gitHead": "2a017ae43cc3cf43d48a34b0a973e807f153e4c3" | ||
"gitHead": "4af801214f2a5243c9396014b2f838e3c86557d5" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
13519
4.97%0
-100%152
4.83%0
-100%- Removed
- Removed