You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
731 B

"use strict";
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