UNPKG

uniquegen

Version:

uniquegen is an package for Node.js projects, enabling the generation of random numbers and words. It offers flexibility and ease of use, making it a valuable tool for developers.

120 lines (119 loc) 4.22 kB
/** * @fileoverview This file contains the implementation of the `Generate` object that provides functions for generating random numbers, words, symbols, mixed strings, and booleans. * @module uniquegen * @license COPYRIGHT BY @AnkanSaha * @license COPYRIGHT YEAR 2024 */ (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define(["require", "exports", "./Function/NumFunction", "./Function/WordFunction", "./Function/SymbolFunction", "./Function/MixedFunction", "./Function/BooleanFunction"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.randomBoolean = exports.randomMixed = exports.randomSymbol = exports.randomWord = exports.randomNumber = void 0; /** * Import the Random Number Generator Function. * @internal */ const NumFunction_1 = require("./Function/NumFunction"); /** * Import the Random Word Generator Function. * @internal */ const WordFunction_1 = require("./Function/WordFunction"); /** * Import the Random Symbol Generator Function. * @internal */ const SymbolFunction_1 = require("./Function/SymbolFunction"); /** * Import the Random Mixed Generator Function. * @internal */ const MixedFunction_1 = require("./Function/MixedFunction"); /** * Import the Random Boolean Generator Function. * @internal */ const BooleanFunction_1 = require("./Function/BooleanFunction"); /** * This code block is creating an object named `Generate` that implements the `Generate` interface. It * is assigning the four functions `GenerateNumberID`, `GenerateWordID`, `GenerateSymbolID`, and * `GenerateMixedID` to the properties `randomNumber`, `randomWord`, `randomSymbol`, and `randomMixed` * respectively. These functions are exported from separate files and are used to generate random * numbers, words, symbols, and mixed strings. The `Generate` object is then exported as the default * export of the module. */ const Generate = Object.freeze({ /** * Generate a random number. * @function * @name Generate.randomNumber * @returns {number} The generated random number. */ randomNumber: NumFunction_1.default, /** * Generate a random word. * @function * @name Generate.randomWord * @returns {string} The generated random word. */ randomWord: WordFunction_1.default, /** * Generate a random symbol. * @function * @name Generate.randomSymbol * @returns {string} The generated random symbol. */ randomSymbol: SymbolFunction_1.default, /** * Generate a random mixed string. * @function * @name Generate.randomMixed * @returns {string} The generated random mixed string. */ randomMixed: MixedFunction_1.default, /** * Generate a random boolean value. * @function * @name Generate.randomBoolean * @returns {boolean} The generated random boolean value. */ randomBoolean: BooleanFunction_1.default, }); /** * Export the Function for Random Number. * @public */ exports.randomNumber = NumFunction_1.default; /** * Export the Function for Random Word. * @public */ exports.randomWord = WordFunction_1.default; /** * Export the Function for Random Symbol. * @public */ exports.randomSymbol = SymbolFunction_1.default; /** * Export the Function for Random Mixed. * @public */ exports.randomMixed = MixedFunction_1.default; /** * Export the Function for Random Boolean. * @public */ exports.randomBoolean = BooleanFunction_1.default; /** * Export the default function. * @public */ exports.default = Generate; });