outers
Version:
outers - a all in one package for your day to day use
61 lines • 2.26 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// import Gen functions
const SymbolGen_1 = __importDefault(require("../gen/SymbolGen")); // function for generating a random word
// function for generating a random number
/**
* This is a TypeScript function that generates a random string of symbols with a specified length and
* custom symbols if provided.
* @param {num} [length=1] - The length parameter is a number that specifies the length of the
* generated symbol ID. By default, it is set to 1 if no value is provided.
* @param {str[] | undefined} CustomSymbols - CustomSymbols is an optional parameter that allows the
* user to provide their own array of symbols to be used in generating the random string. If this
* parameter is not provided, the function will use the default array of symbols defined in the code.
* @returns The function `GenerateSymbolIDsync` is returning a promise that resolves to a string
* (`Promise<str>`). The string is a randomly generated sequence of symbols of length `length`, using
* either the default symbol array or a custom symbol array if provided.
*/
function GenerateSymbolID(length = 1, CustomSymbols) {
/* Defining an array of symbols that will be used to generate a random string of symbols in the
`GenerateSymbol` function. The array contains various symbols such as exclamation mark, at sign,
hash, dollar sign, etc. */
// Symbol Array
const Symbols = [
"!",
"@",
"#",
"$",
"%",
"^",
"&",
"*",
"(",
")",
"-",
"_",
"=",
"+",
"[",
"]",
"{",
"}",
";",
":",
"<",
".",
">",
"/",
"?",
"|",
"\\",
"~",
"`",
]; // Symbol Array
const Result = (0, SymbolGen_1.default)(length, CustomSymbols !== undefined ? CustomSymbols : Symbols); // Generate the Random Number
return Result; // Return the Result
}
exports.default = GenerateSymbolID;
//# sourceMappingURL=SymbolFunction.js.map