xdl
Version:
The Expo Development Library
25 lines (24 loc) • 731 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.domainify = domainify;
exports.randomIdentifier = randomIdentifier;
exports.someRandomness = someRandomness;
function domainify(s) {
return s.toLowerCase().replace(/[^a-z0-9-]/g, '-').replace(/^-+/, '').replace(/-+$/, '');
}
function randomIdentifier(length = 6) {
const alphabet = '23456789qwertyuipasdfghjkzxcvbnm';
let result = '';
for (let i = 0; i < length; i++) {
const j = Math.floor(Math.random() * alphabet.length);
const c = alphabet.substr(j, 1);
result += c;
}
return result;
}
function someRandomness() {
return [randomIdentifier(2), randomIdentifier(3)].join('-');
}
//# sourceMappingURL=ngrokUrl.js.map
;