@art-suite/art-core-ts-string-lib 0.2.12 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +531 -474
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -12
- package/dist/{index.d.ts → index.d.mts} +9 -12
- package/dist/index.mjs +533 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +8 -8
- package/dist/index.js +0 -467
- package/dist/index.js.map +0 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/pluralize/pluralize.js","../src/index.ts","../src/commaize.ts","../src/pluralize.ts","../src/randomString.ts"],"sourcesContent":["/* global define */\n\n(function (root, pluralize) {\n /* istanbul ignore else */\n if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {\n // Node.\n module.exports = pluralize();\n } else if (typeof define === 'function' && define.amd) {\n // AMD, registers as an anonymous module.\n define(function () {\n return pluralize();\n });\n } else {\n // Browser global.\n root.pluralize = pluralize();\n }\n})(this, function () {\n // Rule storage - pluralize and singularize need to be run sequentially,\n // while other rules can be optimized using an object for instant lookups.\n var pluralRules = [];\n var singularRules = [];\n var uncountables = {};\n var irregularPlurals = {};\n var irregularSingles = {};\n\n /**\n * Sanitize a pluralization rule to a usable regular expression.\n *\n * @param {(RegExp|string)} rule\n * @return {RegExp}\n */\n function sanitizeRule (rule) {\n if (typeof rule === 'string') {\n return new RegExp('^' + rule + '$', 'i');\n }\n\n return rule;\n }\n\n /**\n * Pass in a word token to produce a function that can replicate the case on\n * another word.\n *\n * @param {string} word\n * @param {string} token\n * @return {Function}\n */\n function restoreCase (word, token) {\n // Tokens are an exact match.\n if (word === token) return token;\n\n // Lower cased words. E.g. \"hello\".\n if (word === word.toLowerCase()) return token.toLowerCase();\n\n // Upper cased words. E.g. \"WHISKY\".\n if (word === word.toUpperCase()) return token.toUpperCase();\n\n // Title cased words. E.g. \"Title\".\n if (word[0] === word[0].toUpperCase()) {\n return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n }\n\n // Lower cased words. E.g. \"test\".\n return token.toLowerCase();\n }\n\n /**\n * Interpolate a regexp string.\n *\n * @param {string} str\n * @param {Array} args\n * @return {string}\n */\n function interpolate (str, args) {\n return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n return args[index] || '';\n });\n }\n\n /**\n * Replace a word using a rule.\n *\n * @param {string} word\n * @param {Array} rule\n * @return {string}\n */\n function replace (word, rule) {\n return word.replace(rule[0], function (match, index) {\n var result = interpolate(rule[1], arguments);\n\n if (match === '') {\n return restoreCase(word[index - 1], result);\n }\n\n return restoreCase(match, result);\n });\n }\n\n /**\n * Sanitize a word by passing in the word and sanitization rules.\n *\n * @param {string} token\n * @param {string} word\n * @param {Array} rules\n * @return {string}\n */\n function sanitizeWord (token, word, rules) {\n // Empty string or doesn't need fixing.\n if (!token.length || uncountables.hasOwnProperty(token)) {\n return word;\n }\n\n var len = rules.length;\n\n // Iterate over the sanitization rules and use the first one to match.\n while (len--) {\n var rule = rules[len];\n\n if (rule[0].test(word)) return replace(word, rule);\n }\n\n return word;\n }\n\n /**\n * Replace a word with the updated word.\n *\n * @param {Object} replaceMap\n * @param {Object} keepMap\n * @param {Array} rules\n * @return {Function}\n */\n function replaceWord (replaceMap, keepMap, rules) {\n return function (word) {\n // Get the correct token and case restoration functions.\n var token = word.toLowerCase();\n\n // Check against the keep object map.\n if (keepMap.hasOwnProperty(token)) {\n return restoreCase(word, token);\n }\n\n // Check against the replacement map for a direct word replacement.\n if (replaceMap.hasOwnProperty(token)) {\n return restoreCase(word, replaceMap[token]);\n }\n\n // Run all the rules against the word.\n return sanitizeWord(token, word, rules);\n };\n }\n\n /**\n * Check if a word is part of the map.\n */\n function checkWord (replaceMap, keepMap, rules, bool) {\n return function (word) {\n var token = word.toLowerCase();\n\n if (keepMap.hasOwnProperty(token)) return true;\n if (replaceMap.hasOwnProperty(token)) return false;\n\n return sanitizeWord(token, token, rules) === token;\n };\n }\n\n /**\n * Pluralize or singularize a word based on the passed in count.\n *\n * @param {string} word The word to pluralize\n * @param {number} count How many of the word exist\n * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n * @return {string}\n */\n function pluralize (word, count, inclusive) {\n var pluralized = count === 1\n ? pluralize.singular(word) : pluralize.plural(word);\n\n return (inclusive ? count + ' ' : '') + pluralized;\n }\n\n /**\n * Pluralize a word.\n *\n * @type {Function}\n */\n pluralize.plural = replaceWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Check if a word is plural.\n *\n * @type {Function}\n */\n pluralize.isPlural = checkWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Singularize a word.\n *\n * @type {Function}\n */\n pluralize.singular = replaceWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Check if a word is singular.\n *\n * @type {Function}\n */\n pluralize.isSingular = checkWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Add a pluralization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addPluralRule = function (rule, replacement) {\n pluralRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add a singularization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addSingularRule = function (rule, replacement) {\n singularRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add an uncountable word rule.\n *\n * @param {(string|RegExp)} word\n */\n pluralize.addUncountableRule = function (word) {\n if (typeof word === 'string') {\n uncountables[word.toLowerCase()] = true;\n return;\n }\n\n // Set singular and plural references for the word.\n pluralize.addPluralRule(word, '$0');\n pluralize.addSingularRule(word, '$0');\n };\n\n /**\n * Add an irregular word definition.\n *\n * @param {string} single\n * @param {string} plural\n */\n pluralize.addIrregularRule = function (single, plural) {\n plural = plural.toLowerCase();\n single = single.toLowerCase();\n\n irregularSingles[single] = plural;\n irregularPlurals[plural] = single;\n };\n\n /**\n * Irregular rules.\n */\n [\n // Pronouns.\n ['I', 'we'],\n ['me', 'us'],\n ['he', 'they'],\n ['she', 'they'],\n ['them', 'them'],\n ['myself', 'ourselves'],\n ['yourself', 'yourselves'],\n ['itself', 'themselves'],\n ['herself', 'themselves'],\n ['himself', 'themselves'],\n ['themself', 'themselves'],\n ['is', 'are'],\n ['was', 'were'],\n ['has', 'have'],\n ['this', 'these'],\n ['that', 'those'],\n // Words ending in with a consonant and `o`.\n ['echo', 'echoes'],\n ['dingo', 'dingoes'],\n ['volcano', 'volcanoes'],\n ['tornado', 'tornadoes'],\n ['torpedo', 'torpedoes'],\n // Ends with `us`.\n ['genus', 'genera'],\n ['viscus', 'viscera'],\n // Ends with `ma`.\n ['stigma', 'stigmata'],\n ['stoma', 'stomata'],\n ['dogma', 'dogmata'],\n ['lemma', 'lemmata'],\n ['schema', 'schemata'],\n ['anathema', 'anathemata'],\n // Other irregular rules.\n ['ox', 'oxen'],\n ['axe', 'axes'],\n ['die', 'dice'],\n ['yes', 'yeses'],\n ['foot', 'feet'],\n ['eave', 'eaves'],\n ['goose', 'geese'],\n ['tooth', 'teeth'],\n ['quiz', 'quizzes'],\n ['human', 'humans'],\n ['proof', 'proofs'],\n ['carve', 'carves'],\n ['valve', 'valves'],\n ['looey', 'looies'],\n ['thief', 'thieves'],\n ['groove', 'grooves'],\n ['pickaxe', 'pickaxes'],\n ['passerby', 'passersby']\n ].forEach(function (rule) {\n return pluralize.addIrregularRule(rule[0], rule[1]);\n });\n\n /**\n * Pluralization rules.\n */\n [\n [/s?$/i, 's'],\n [/[^\\u0000-\\u007F]$/i, '$0'],\n [/([^aeiou]ese)$/i, '$1'],\n [/(ax|test)is$/i, '$1es'],\n [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n [/(e[mn]u)s?$/i, '$1s'],\n [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n [/(seraph|cherub)(?:im)?$/i, '$1im'],\n [/(her|at|gr)o$/i, '$1oes'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/([^ch][ieo][ln])ey$/i, '$1ies'],\n [/(x|ch|ss|sh|zz)$/i, '$1es'],\n [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n [/(pe)(?:rson|ople)$/i, '$1ople'],\n [/(child)(?:ren)?$/i, '$1ren'],\n [/eaux$/i, '$0'],\n [/m[ae]n$/i, 'men'],\n ['thou', 'you']\n ].forEach(function (rule) {\n return pluralize.addPluralRule(rule[0], rule[1]);\n });\n\n /**\n * Singularization rules.\n */\n [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n [/ies$/i, 'y'],\n [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n [/\\b(mon|smil)ies$/i, '$1ey'],\n [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n [/(seraph|cherub)im$/i, '$1'],\n [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n [/(test)(?:is|es)$/i, '$1is'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n [/(alumn|alg|vertebr)ae$/i, '$1a'],\n [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n [/(matr|append)ices$/i, '$1ix'],\n [/(pe)(rson|ople)$/i, '$1rson'],\n [/(child)ren$/i, '$1'],\n [/(eau)x?$/i, '$1'],\n [/men$/i, 'man']\n ].forEach(function (rule) {\n return pluralize.addSingularRule(rule[0], rule[1]);\n });\n\n /**\n * Uncountable rules.\n */\n [\n // Singular words with no plurals.\n 'adulthood',\n 'advice',\n 'agenda',\n 'aid',\n 'aircraft',\n 'alcohol',\n 'ammo',\n 'analytics',\n 'anime',\n 'athletics',\n 'audio',\n 'bison',\n 'blood',\n 'bream',\n 'buffalo',\n 'butter',\n 'carp',\n 'cash',\n 'chassis',\n 'chess',\n 'clothing',\n 'cod',\n 'commerce',\n 'cooperation',\n 'corps',\n 'debris',\n 'diabetes',\n 'digestion',\n 'elk',\n 'energy',\n 'equipment',\n 'excretion',\n 'expertise',\n 'firmware',\n 'flounder',\n 'fun',\n 'gallows',\n 'garbage',\n 'graffiti',\n 'hardware',\n 'headquarters',\n 'health',\n 'herpes',\n 'highjinks',\n 'homework',\n 'housework',\n 'information',\n 'jeans',\n 'justice',\n 'kudos',\n 'labour',\n 'literature',\n 'machinery',\n 'mackerel',\n 'mail',\n 'media',\n 'mews',\n 'moose',\n 'music',\n 'mud',\n 'manga',\n 'news',\n 'only',\n 'personnel',\n 'pike',\n 'plankton',\n 'pliers',\n 'police',\n 'pollution',\n 'premises',\n 'rain',\n 'research',\n 'rice',\n 'salmon',\n 'scissors',\n 'series',\n 'sewage',\n 'shambles',\n 'shrimp',\n 'software',\n 'species',\n 'staff',\n 'swine',\n 'tennis',\n 'traffic',\n 'transportation',\n 'trout',\n 'tuna',\n 'wealth',\n 'welfare',\n 'whiting',\n 'wildebeest',\n 'wildlife',\n 'you',\n /pok[eé]mon$/i,\n // Regexes.\n /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n /deer$/i, // \"deer\", \"reindeer\"\n /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n /measles$/i,\n /o[iu]s$/i, // \"carnivorous\"\n /pox$/i, // \"chickpox\", \"smallpox\"\n /sheep$/i\n ].forEach(pluralize.addUncountableRule);\n\n return pluralize;\n});\n","export * from './commaize'\nexport * from './pluralize'\nexport * from './randomString'","/**\n * Adds commas to a number or string\n * @param x - The number or string to commaize\n * @returns The commaized number or string\n */\nexport const commaize = (x: number | string) => x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")\n","import npmPluralize from 'pluralize'\nimport { isString, isNumber } from '@art-suite/art-core-ts-types'\n\nconst patchedNpmPluralize = (noun: string, count?: number | undefined, inclusive?: boolean | undefined) => {\n const match = /^(.*?)([_\\W]+)$/.exec(noun)\n if (match) {\n const [__, mainNoun, append] = match\n const out = npmPluralize(mainNoun, count, inclusive)\n return out + append\n }\n return npmPluralize(noun, count, inclusive)\n}\n\nexport const {\n plural,\n singular,\n isSingular,\n isPlural,\n addPluralRule,\n addSingularRule,\n addIrregularRule,\n addUncountableRule,\n} = npmPluralize\n\n/**\n * Pluralize a word based on the passed in count. Call signatures:\n *\n * 1 input:\n * pluralize(singleForm: string)\n *\n * 2 inputS:\n * pluralize(singleForm: string, count: number)\n * pluralize(count: number, singleForm: string)\n *\n * 3 inputs:\n * pluralize(singleForm: string, count: number, pluralForm: string)\n * pluralize(count: number, singleForm: string, pluralForm: string)\n *\n * @param a: string | number - The word to pluralize if a string, or the count if a number\n * @param b: string | number - The count to pluralize the word by if a number, or the singleForm if a string\n * @param pluralForm: string - Explicitly provide the plural form of the word (optional)\n * @returns The pluralized word\n */\nexport const pluralize = (a: number | string, b?: number | string, pluralForm?: string) => {\n let singleForm: string\n let number: number | null = null\n if (isNumber(b)) {\n if (!isString(a)) {\n throw new Error(`singleForm and pluralForm(optional) should be non-empty strings (inputs: ${JSON.stringify({ a, b, pluralForm })}`)\n }\n singleForm = a\n number = b\n } else if (isNumber(a)) {\n if (!isString(b)) {\n throw new Error(`singleForm and pluralForm(optional) should be non-empty strings (inputs: ${JSON.stringify({ a, b, pluralForm })}`)\n }\n singleForm = b\n number = a\n } else {\n if (!isString(a)) throw new Error(`singleForm and pluralForm(optional) should be non-empty strings (inputs: ${JSON.stringify({ a, b, pluralForm })}`)\n singleForm = a\n number = null\n }\n if (pluralForm) return `${number} ${number == 1 ? singleForm : pluralForm}`\n if (number != null) return patchedNpmPluralize(singleForm, number, true)\n return patchedNpmPluralize(singleForm)\n}\n","export const base62Characters = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\nconst intRand = (max: number): number => {\n return Math.floor(Math.random() * max)\n}\n/**\n * Generates a Uint8Array of cryptographically secure random bytes.\n * @param size Number of bytes to generate.\n * @returns A Uint8Array filled with random bytes.\n */\nconst generateRandomBytes = (size: number): Uint8Array =>\n typeof crypto?.getRandomValues === 'function'\n ? crypto.getRandomValues(new Uint8Array(size))\n : require('crypto').randomFillSync(new Uint8Array(size));\n\n/*\n @randomString: randomString = (length = 32, chars = base62Characters, randomNumbers) ->\n result = ''\n charsLength = chars.length\n if randomNumbers\n (chars[randomNumbers[i] % charsLength] for i in [0...length] by 1).join ''\n else\n (chars[intRand charsLength] for i in [0...length] by 1).join ''\n*/\nexport const randomString = (length = 32, chars = base62Characters, randomNumbers?: Uint8Array | number[]): string => {\n const charsLength = chars.length\n let result = ''\n if (randomNumbers) {\n for (let i = 0; i < length; i++) result += chars[randomNumbers[i] % charsLength]\n } else {\n for (let i = 0; i < length; i++) result += chars[intRand(charsLength)]\n }\n return result\n}\n\nexport const cryptoRandomString = (length = 32, chars = base62Characters): string =>\n randomString(length, chars, generateRandomBytes(length).map(b => b % chars.length))"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,8CAAAA,UAAAC,SAAA;AAAA;AAEA,KAAC,SAAU,MAAMC,YAAW;AAE1B,UAAI,OAAO,YAAY,cAAc,OAAOF,aAAY,YAAY,OAAOC,YAAW,UAAU;AAE9F,QAAAA,QAAO,UAAUC,WAAU;AAAA,MAC7B,WAAW,OAAO,WAAW,cAAc,OAAO,KAAK;AAErD,eAAO,WAAY;AACjB,iBAAOA,WAAU;AAAA,QACnB,CAAC;AAAA,MACH,OAAO;AAEL,aAAK,YAAYA,WAAU;AAAA,MAC7B;AAAA,IACF,GAAGF,UAAM,WAAY;AAGnB,UAAI,cAAc,CAAC;AACnB,UAAI,gBAAgB,CAAC;AACrB,UAAI,eAAe,CAAC;AACpB,UAAI,mBAAmB,CAAC;AACxB,UAAI,mBAAmB,CAAC;AAQxB,eAAS,aAAc,MAAM;AAC3B,YAAI,OAAO,SAAS,UAAU;AAC5B,iBAAO,IAAI,OAAO,MAAM,OAAO,KAAK,GAAG;AAAA,QACzC;AAEA,eAAO;AAAA,MACT;AAUA,eAAS,YAAa,MAAM,OAAO;AAEjC,YAAI,SAAS,MAAO,QAAO;AAG3B,YAAI,SAAS,KAAK,YAAY,EAAG,QAAO,MAAM,YAAY;AAG1D,YAAI,SAAS,KAAK,YAAY,EAAG,QAAO,MAAM,YAAY;AAG1D,YAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,YAAY,GAAG;AACrC,iBAAO,MAAM,OAAO,CAAC,EAAE,YAAY,IAAI,MAAM,OAAO,CAAC,EAAE,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AoB,aAC/B,OAAO,gBAAgB,IAAI,WAAW,IAAI,CAAC,IAC3C,QAAQ,QAAQ,EAAE,eAAe,IAAI,WAAW,IAAI,CAAC;AAWpD,IAAM,eAAe,CAAC,SAAS,IAAI,QAAQ,kBAAkB,kBAAkD;AACpH,QAAM,cAAc,MAAM;AAC1B,MAAI,SAAS;AACb,MAAI,eAAe;AACjB,aAAS,IAAI,GAAG,IAAI,QAAQ,IAAK,WAAU,MAAM,cAAc,CAAC,IAAI,WAAW;AAAA,EACjF,OAAO;AACL,aAAS,IAAI,GAAG,IAAI,QAAQ,IAAK,WAAU,MAAM,QAAQ,WAAW,CAAC;AAAA,EACvE;AACA,SAAO;AACT;AAEO,IAAM,qBAAqB,CAAC,SAAS,IAAI,QAAQ,qBACtD,aAAa,QAAQ,OAAO,oBAAoB,MAAM,EAAE,IAAI,OAAK,IAAI,MAAM,MAAM,CAAC;","names":["exports","module","pluralize","plural","npmPluralize"]}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["npmPluralize"],"sources":["../src/commaize.ts","../../../node_modules/pluralize/pluralize.js","../src/pluralize.ts","../src/randomString.ts"],"sourcesContent":["/**\n * Adds commas to a number or string\n * @param x - The number or string to commaize\n * @returns The commaized number or string\n */\nexport const commaize = (x: number | string) => x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")\n","/* global define */\n\n(function (root, pluralize) {\n /* istanbul ignore else */\n if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {\n // Node.\n module.exports = pluralize();\n } else if (typeof define === 'function' && define.amd) {\n // AMD, registers as an anonymous module.\n define(function () {\n return pluralize();\n });\n } else {\n // Browser global.\n root.pluralize = pluralize();\n }\n})(this, function () {\n // Rule storage - pluralize and singularize need to be run sequentially,\n // while other rules can be optimized using an object for instant lookups.\n var pluralRules = [];\n var singularRules = [];\n var uncountables = {};\n var irregularPlurals = {};\n var irregularSingles = {};\n\n /**\n * Sanitize a pluralization rule to a usable regular expression.\n *\n * @param {(RegExp|string)} rule\n * @return {RegExp}\n */\n function sanitizeRule (rule) {\n if (typeof rule === 'string') {\n return new RegExp('^' + rule + '$', 'i');\n }\n\n return rule;\n }\n\n /**\n * Pass in a word token to produce a function that can replicate the case on\n * another word.\n *\n * @param {string} word\n * @param {string} token\n * @return {Function}\n */\n function restoreCase (word, token) {\n // Tokens are an exact match.\n if (word === token) return token;\n\n // Lower cased words. E.g. \"hello\".\n if (word === word.toLowerCase()) return token.toLowerCase();\n\n // Upper cased words. E.g. \"WHISKY\".\n if (word === word.toUpperCase()) return token.toUpperCase();\n\n // Title cased words. E.g. \"Title\".\n if (word[0] === word[0].toUpperCase()) {\n return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n }\n\n // Lower cased words. E.g. \"test\".\n return token.toLowerCase();\n }\n\n /**\n * Interpolate a regexp string.\n *\n * @param {string} str\n * @param {Array} args\n * @return {string}\n */\n function interpolate (str, args) {\n return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n return args[index] || '';\n });\n }\n\n /**\n * Replace a word using a rule.\n *\n * @param {string} word\n * @param {Array} rule\n * @return {string}\n */\n function replace (word, rule) {\n return word.replace(rule[0], function (match, index) {\n var result = interpolate(rule[1], arguments);\n\n if (match === '') {\n return restoreCase(word[index - 1], result);\n }\n\n return restoreCase(match, result);\n });\n }\n\n /**\n * Sanitize a word by passing in the word and sanitization rules.\n *\n * @param {string} token\n * @param {string} word\n * @param {Array} rules\n * @return {string}\n */\n function sanitizeWord (token, word, rules) {\n // Empty string or doesn't need fixing.\n if (!token.length || uncountables.hasOwnProperty(token)) {\n return word;\n }\n\n var len = rules.length;\n\n // Iterate over the sanitization rules and use the first one to match.\n while (len--) {\n var rule = rules[len];\n\n if (rule[0].test(word)) return replace(word, rule);\n }\n\n return word;\n }\n\n /**\n * Replace a word with the updated word.\n *\n * @param {Object} replaceMap\n * @param {Object} keepMap\n * @param {Array} rules\n * @return {Function}\n */\n function replaceWord (replaceMap, keepMap, rules) {\n return function (word) {\n // Get the correct token and case restoration functions.\n var token = word.toLowerCase();\n\n // Check against the keep object map.\n if (keepMap.hasOwnProperty(token)) {\n return restoreCase(word, token);\n }\n\n // Check against the replacement map for a direct word replacement.\n if (replaceMap.hasOwnProperty(token)) {\n return restoreCase(word, replaceMap[token]);\n }\n\n // Run all the rules against the word.\n return sanitizeWord(token, word, rules);\n };\n }\n\n /**\n * Check if a word is part of the map.\n */\n function checkWord (replaceMap, keepMap, rules, bool) {\n return function (word) {\n var token = word.toLowerCase();\n\n if (keepMap.hasOwnProperty(token)) return true;\n if (replaceMap.hasOwnProperty(token)) return false;\n\n return sanitizeWord(token, token, rules) === token;\n };\n }\n\n /**\n * Pluralize or singularize a word based on the passed in count.\n *\n * @param {string} word The word to pluralize\n * @param {number} count How many of the word exist\n * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)\n * @return {string}\n */\n function pluralize (word, count, inclusive) {\n var pluralized = count === 1\n ? pluralize.singular(word) : pluralize.plural(word);\n\n return (inclusive ? count + ' ' : '') + pluralized;\n }\n\n /**\n * Pluralize a word.\n *\n * @type {Function}\n */\n pluralize.plural = replaceWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Check if a word is plural.\n *\n * @type {Function}\n */\n pluralize.isPlural = checkWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Singularize a word.\n *\n * @type {Function}\n */\n pluralize.singular = replaceWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Check if a word is singular.\n *\n * @type {Function}\n */\n pluralize.isSingular = checkWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Add a pluralization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addPluralRule = function (rule, replacement) {\n pluralRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add a singularization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addSingularRule = function (rule, replacement) {\n singularRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add an uncountable word rule.\n *\n * @param {(string|RegExp)} word\n */\n pluralize.addUncountableRule = function (word) {\n if (typeof word === 'string') {\n uncountables[word.toLowerCase()] = true;\n return;\n }\n\n // Set singular and plural references for the word.\n pluralize.addPluralRule(word, '$0');\n pluralize.addSingularRule(word, '$0');\n };\n\n /**\n * Add an irregular word definition.\n *\n * @param {string} single\n * @param {string} plural\n */\n pluralize.addIrregularRule = function (single, plural) {\n plural = plural.toLowerCase();\n single = single.toLowerCase();\n\n irregularSingles[single] = plural;\n irregularPlurals[plural] = single;\n };\n\n /**\n * Irregular rules.\n */\n [\n // Pronouns.\n ['I', 'we'],\n ['me', 'us'],\n ['he', 'they'],\n ['she', 'they'],\n ['them', 'them'],\n ['myself', 'ourselves'],\n ['yourself', 'yourselves'],\n ['itself', 'themselves'],\n ['herself', 'themselves'],\n ['himself', 'themselves'],\n ['themself', 'themselves'],\n ['is', 'are'],\n ['was', 'were'],\n ['has', 'have'],\n ['this', 'these'],\n ['that', 'those'],\n // Words ending in with a consonant and `o`.\n ['echo', 'echoes'],\n ['dingo', 'dingoes'],\n ['volcano', 'volcanoes'],\n ['tornado', 'tornadoes'],\n ['torpedo', 'torpedoes'],\n // Ends with `us`.\n ['genus', 'genera'],\n ['viscus', 'viscera'],\n // Ends with `ma`.\n ['stigma', 'stigmata'],\n ['stoma', 'stomata'],\n ['dogma', 'dogmata'],\n ['lemma', 'lemmata'],\n ['schema', 'schemata'],\n ['anathema', 'anathemata'],\n // Other irregular rules.\n ['ox', 'oxen'],\n ['axe', 'axes'],\n ['die', 'dice'],\n ['yes', 'yeses'],\n ['foot', 'feet'],\n ['eave', 'eaves'],\n ['goose', 'geese'],\n ['tooth', 'teeth'],\n ['quiz', 'quizzes'],\n ['human', 'humans'],\n ['proof', 'proofs'],\n ['carve', 'carves'],\n ['valve', 'valves'],\n ['looey', 'looies'],\n ['thief', 'thieves'],\n ['groove', 'grooves'],\n ['pickaxe', 'pickaxes'],\n ['passerby', 'passersby']\n ].forEach(function (rule) {\n return pluralize.addIrregularRule(rule[0], rule[1]);\n });\n\n /**\n * Pluralization rules.\n */\n [\n [/s?$/i, 's'],\n [/[^\\u0000-\\u007F]$/i, '$0'],\n [/([^aeiou]ese)$/i, '$1'],\n [/(ax|test)is$/i, '$1es'],\n [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],\n [/(e[mn]u)s?$/i, '$1s'],\n [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n [/(seraph|cherub)(?:im)?$/i, '$1im'],\n [/(her|at|gr)o$/i, '$1oes'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/([^ch][ieo][ln])ey$/i, '$1ies'],\n [/(x|ch|ss|sh|zz)$/i, '$1es'],\n [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n [/\\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],\n [/(pe)(?:rson|ople)$/i, '$1ople'],\n [/(child)(?:ren)?$/i, '$1ren'],\n [/eaux$/i, '$0'],\n [/m[ae]n$/i, 'men'],\n ['thou', 'you']\n ].forEach(function (rule) {\n return pluralize.addPluralRule(rule[0], rule[1]);\n });\n\n /**\n * Singularization rules.\n */\n [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n [/ies$/i, 'y'],\n [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n [/\\b(mon|smil)ies$/i, '$1ey'],\n [/\\b((?:tit)?m|l)ice$/i, '$1ouse'],\n [/(seraph|cherub)im$/i, '$1'],\n [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],\n [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],\n [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n [/(test)(?:is|es)$/i, '$1is'],\n [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n [/(alumn|alg|vertebr)ae$/i, '$1a'],\n [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n [/(matr|append)ices$/i, '$1ix'],\n [/(pe)(rson|ople)$/i, '$1rson'],\n [/(child)ren$/i, '$1'],\n [/(eau)x?$/i, '$1'],\n [/men$/i, 'man']\n ].forEach(function (rule) {\n return pluralize.addSingularRule(rule[0], rule[1]);\n });\n\n /**\n * Uncountable rules.\n */\n [\n // Singular words with no plurals.\n 'adulthood',\n 'advice',\n 'agenda',\n 'aid',\n 'aircraft',\n 'alcohol',\n 'ammo',\n 'analytics',\n 'anime',\n 'athletics',\n 'audio',\n 'bison',\n 'blood',\n 'bream',\n 'buffalo',\n 'butter',\n 'carp',\n 'cash',\n 'chassis',\n 'chess',\n 'clothing',\n 'cod',\n 'commerce',\n 'cooperation',\n 'corps',\n 'debris',\n 'diabetes',\n 'digestion',\n 'elk',\n 'energy',\n 'equipment',\n 'excretion',\n 'expertise',\n 'firmware',\n 'flounder',\n 'fun',\n 'gallows',\n 'garbage',\n 'graffiti',\n 'hardware',\n 'headquarters',\n 'health',\n 'herpes',\n 'highjinks',\n 'homework',\n 'housework',\n 'information',\n 'jeans',\n 'justice',\n 'kudos',\n 'labour',\n 'literature',\n 'machinery',\n 'mackerel',\n 'mail',\n 'media',\n 'mews',\n 'moose',\n 'music',\n 'mud',\n 'manga',\n 'news',\n 'only',\n 'personnel',\n 'pike',\n 'plankton',\n 'pliers',\n 'police',\n 'pollution',\n 'premises',\n 'rain',\n 'research',\n 'rice',\n 'salmon',\n 'scissors',\n 'series',\n 'sewage',\n 'shambles',\n 'shrimp',\n 'software',\n 'species',\n 'staff',\n 'swine',\n 'tennis',\n 'traffic',\n 'transportation',\n 'trout',\n 'tuna',\n 'wealth',\n 'welfare',\n 'whiting',\n 'wildebeest',\n 'wildlife',\n 'you',\n /pok[eé]mon$/i,\n // Regexes.\n /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n /deer$/i, // \"deer\", \"reindeer\"\n /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n /measles$/i,\n /o[iu]s$/i, // \"carnivorous\"\n /pox$/i, // \"chickpox\", \"smallpox\"\n /sheep$/i\n ].forEach(pluralize.addUncountableRule);\n\n return pluralize;\n});\n","import npmPluralize from 'pluralize'\nimport { isString, isNumber } from '@art-suite/art-core-ts-types'\n\nconst patchedNpmPluralize = (noun: string, count?: number | undefined, inclusive?: boolean | undefined) => {\n const match = /^(.*?)([_\\W]+)$/.exec(noun)\n if (match) {\n const [__, mainNoun, append] = match\n const out = npmPluralize(mainNoun, count, inclusive)\n return out + append\n }\n return npmPluralize(noun, count, inclusive)\n}\n\nexport const {\n plural,\n singular,\n isSingular,\n isPlural,\n addPluralRule,\n addSingularRule,\n addIrregularRule,\n addUncountableRule,\n} = npmPluralize\n\n/**\n * Pluralize a word based on the passed in count. Call signatures:\n *\n * 1 input:\n * pluralize(singleForm: string)\n *\n * 2 inputS:\n * pluralize(singleForm: string, count: number)\n * pluralize(count: number, singleForm: string)\n *\n * 3 inputs:\n * pluralize(singleForm: string, count: number, pluralForm: string)\n * pluralize(count: number, singleForm: string, pluralForm: string)\n *\n * @param a: string | number - The word to pluralize if a string, or the count if a number\n * @param b: string | number - The count to pluralize the word by if a number, or the singleForm if a string\n * @param pluralForm: string - Explicitly provide the plural form of the word (optional)\n * @returns The pluralized word\n */\nexport const pluralize = (a: number | string, b?: number | string, pluralForm?: string) => {\n let singleForm: string\n let number: number | null = null\n if (isNumber(b)) {\n if (!isString(a)) {\n throw new Error(`singleForm and pluralForm(optional) should be non-empty strings (inputs: ${JSON.stringify({ a, b, pluralForm })}`)\n }\n singleForm = a\n number = b\n } else if (isNumber(a)) {\n if (!isString(b)) {\n throw new Error(`singleForm and pluralForm(optional) should be non-empty strings (inputs: ${JSON.stringify({ a, b, pluralForm })}`)\n }\n singleForm = b\n number = a\n } else {\n if (!isString(a)) throw new Error(`singleForm and pluralForm(optional) should be non-empty strings (inputs: ${JSON.stringify({ a, b, pluralForm })}`)\n singleForm = a\n number = null\n }\n if (pluralForm) return `${number} ${number == 1 ? singleForm : pluralForm}`\n if (number != null) return patchedNpmPluralize(singleForm, number, true)\n return patchedNpmPluralize(singleForm)\n}\n","export const base62Characters = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\nconst intRand = (max: number): number => {\n return Math.floor(Math.random() * max)\n}\n/**\n * Generates a Uint8Array of cryptographically secure random bytes.\n * @param size Number of bytes to generate.\n * @returns A Uint8Array filled with random bytes.\n */\nconst generateRandomBytes = (size: number): Uint8Array =>\n typeof crypto?.getRandomValues === 'function'\n ? crypto.getRandomValues(new Uint8Array(size))\n : require('crypto').randomFillSync(new Uint8Array(size));\n\n/*\n @randomString: randomString = (length = 32, chars = base62Characters, randomNumbers) ->\n result = ''\n charsLength = chars.length\n if randomNumbers\n (chars[randomNumbers[i] % charsLength] for i in [0...length] by 1).join ''\n else\n (chars[intRand charsLength] for i in [0...length] by 1).join ''\n*/\nexport const randomString = (length = 32, chars = base62Characters, randomNumbers?: Uint8Array | number[]): string => {\n const charsLength = chars.length\n let result = ''\n if (randomNumbers) {\n for (let i = 0; i < length; i++) result += chars[randomNumbers[i] % charsLength]\n } else {\n for (let i = 0; i < length; i++) result += chars[intRand(charsLength)]\n }\n return result\n}\n\nexport const cryptoRandomString = (length = 32, chars = base62Characters): string =>\n randomString(length, chars, generateRandomBytes(length).map(b => b % chars.length))"],"x_google_ignoreList":[1],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAa,YAAY,MAAuB,EAAE,UAAU,CAAC,QAAQ,yBAAyB,IAAI;;;;ACHlG,EAAC,SAAU,MAAM,WAAW;;AAE1B,MAAI,OAAO,YAAY,cAAc,OAAO,YAAY,YAAY,OAAO,WAAW,SAEpF,QAAO,UAAU,WAAW;WACnB,OAAO,WAAW,cAAc,OAAO,IAEhD,QAAO,WAAY;AACjB,UAAO,WAAW;IAClB;MAGF,MAAK,YAAY,WAAW;aAEvB,WAAY;EAGnB,IAAI,cAAc,EAAE;EACpB,IAAI,gBAAgB,EAAE;EACtB,IAAI,eAAe,EAAE;EACrB,IAAI,mBAAmB,EAAE;EACzB,IAAI,mBAAmB,EAAE;;;;;;;EAQzB,SAAS,aAAc,MAAM;AAC3B,OAAI,OAAO,SAAS,SAClB,QAAO,IAAI,OAAO,MAAM,OAAO,KAAK,IAAI;AAG1C,UAAO;;;;;;;;;;EAWT,SAAS,YAAa,MAAM,OAAO;AAEjC,OAAI,SAAS,MAAO,QAAO;AAG3B,OAAI,SAAS,KAAK,aAAa,CAAE,QAAO,MAAM,aAAa;AAG3D,OAAI,SAAS,KAAK,aAAa,CAAE,QAAO,MA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GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GAEA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,QAAQ,UAAU,mBAAmB;AAEvC,SAAO;GACP;;ACnfF,MAAM,uBAAuB,MAAc,OAA4B,cAAoC;CACzG,MAAM,QAAQ,kBAAkB,KAAK,KAAK;AAC1C,KAAI,OAAO;EACT,MAAM,CAAC,IAAI,UAAU,UAAU;AAE/B,UAAA,GAAA,iBAAA,SADyB,UAAU,OAAO,UAAU,GACvC;;AAEf,SAAA,GAAA,iBAAA,SAAoB,MAAM,OAAO,UAAU;;AAG7C,MAAa,EACX,QACA,UACA,YACA,UACA,eACA,iBACA,kBACA,uBACEA,iBAAAA;;;;;;;;;;;;;;;;;;;;AAqBJ,MAAa,aAAa,GAAoB,GAAqB,eAAwB;CACzF,IAAI;CACJ,IAAI,SAAwB;AAC5B,MAAA,GAAA,6BAAA,UAAa,EAAE,EAAE;AACf,MAAI,EAAA,GAAA,6BAAA,UAAU,EAAE,CACd,OAAM,IAAI,MAAM,4EAA4E,KAAK,UAAU;GAAE;GAAG;GAAG;GAAY,CAAC,GAAG;AAErI,eAAa;AACb,WAAS;uDACS,EAAE,EAAE;AACtB,MAAI,EAAA,GAAA,6BAAA,UAAU,EAAE,CACd,OAAM,IAAI,MAAM,4EAA4E,KAAK,UAAU;GAAE;GAAG;GAAG;GAAY,CAAC,GAAG;AAErI,eAAa;AACb,WAAS;QACJ;AACL,MAAI,EAAA,GAAA,6BAAA,UAAU,EAAE,CAAE,OAAM,IAAI,MAAM,4EAA4E,KAAK,UAAU;GAAE;GAAG;GAAG;GAAY,CAAC,GAAG;AACrJ,eAAa;AACb,WAAS;;AAEX,KAAI,WAAY,QAAO,GAAG,OAAO,GAAG,UAAU,IAAI,aAAa;AAC/D,KAAI,UAAU,KAAM,QAAO,oBAAoB,YAAY,QAAQ,KAAK;AACxE,QAAO,oBAAoB,WAAW;;;;ACjExC,MAAa,mBAAmB;AAEhC,MAAM,WAAW,QAAwB;AACvC,QAAO,KAAK,MAAM,KAAK,QAAQ,GAAG,IAAI;;;;;;;AAOxC,MAAM,uBAAuB,SAC3B,OAAO,QAAQ,oBAAoB,aAC/B,OAAO,gBAAgB,IAAI,WAAW,KAAK,CAAC,GAC5C,QAAQ,SAAS,CAAC,eAAe,IAAI,WAAW,KAAK,CAAC;AAW5D,MAAa,gBAAgB,SAAS,IAAI,QAAQ,kBAAkB,kBAAkD;CACpH,MAAM,cAAc,MAAM;CAC1B,IAAI,SAAS;AACb,KAAI,cACF,MAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,IAAK,WAAU,MAAM,cAAc,KAAK;KAEpE,MAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,IAAK,WAAU,MAAM,QAAQ,YAAY;AAEvE,QAAO;;AAGT,MAAa,sBAAsB,SAAS,IAAI,QAAQ,qBACtD,aAAa,QAAQ,OAAO,oBAAoB,OAAO,CAAC,KAAI,MAAK,IAAI,MAAM,OAAO,CAAA"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import npmPluralize from
|
|
1
|
+
import npmPluralize from "pluralize";
|
|
2
2
|
|
|
3
|
+
//#region src/commaize.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* Adds commas to a number or string
|
|
5
6
|
* @param x - The number or string to commaize
|
|
6
7
|
* @returns The commaized number or string
|
|
7
8
|
*/
|
|
8
9
|
declare const commaize: (x: number | string) => string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare const singular: typeof npmPluralize.singular;
|
|
12
|
-
declare const isSingular: typeof npmPluralize.isSingular;
|
|
13
|
-
declare const isPlural: typeof npmPluralize.isPlural;
|
|
14
|
-
declare const addPluralRule: typeof npmPluralize.addPluralRule;
|
|
15
|
-
declare const addSingularRule: typeof npmPluralize.addSingularRule;
|
|
16
|
-
declare const addIrregularRule: typeof npmPluralize.addIrregularRule;
|
|
17
|
-
declare const addUncountableRule: typeof npmPluralize.addUncountableRule;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/pluralize.d.ts
|
|
12
|
+
declare const plural: typeof npmPluralize.plural, singular: typeof npmPluralize.singular, isSingular: typeof npmPluralize.isSingular, isPlural: typeof npmPluralize.isPlural, addPluralRule: typeof npmPluralize.addPluralRule, addSingularRule: typeof npmPluralize.addSingularRule, addIrregularRule: typeof npmPluralize.addIrregularRule, addUncountableRule: typeof npmPluralize.addUncountableRule;
|
|
18
13
|
/**
|
|
19
14
|
* Pluralize a word based on the passed in count. Call signatures:
|
|
20
15
|
*
|
|
@@ -35,9 +30,11 @@ declare const addUncountableRule: typeof npmPluralize.addUncountableRule;
|
|
|
35
30
|
* @returns The pluralized word
|
|
36
31
|
*/
|
|
37
32
|
declare const pluralize: (a: number | string, b?: number | string, pluralForm?: string) => string;
|
|
38
|
-
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/randomString.d.ts
|
|
39
35
|
declare const base62Characters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
40
36
|
declare const randomString: (length?: number, chars?: string, randomNumbers?: Uint8Array | number[]) => string;
|
|
41
37
|
declare const cryptoRandomString: (length?: number, chars?: string) => string;
|
|
42
|
-
|
|
38
|
+
//#endregion
|
|
43
39
|
export { addIrregularRule, addPluralRule, addSingularRule, addUncountableRule, base62Characters, commaize, cryptoRandomString, isPlural, isSingular, plural, pluralize, randomString, singular };
|
|
40
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import npmPluralize from
|
|
1
|
+
import npmPluralize from "pluralize";
|
|
2
2
|
|
|
3
|
+
//#region src/commaize.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* Adds commas to a number or string
|
|
5
6
|
* @param x - The number or string to commaize
|
|
6
7
|
* @returns The commaized number or string
|
|
7
8
|
*/
|
|
8
9
|
declare const commaize: (x: number | string) => string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare const singular: typeof npmPluralize.singular;
|
|
12
|
-
declare const isSingular: typeof npmPluralize.isSingular;
|
|
13
|
-
declare const isPlural: typeof npmPluralize.isPlural;
|
|
14
|
-
declare const addPluralRule: typeof npmPluralize.addPluralRule;
|
|
15
|
-
declare const addSingularRule: typeof npmPluralize.addSingularRule;
|
|
16
|
-
declare const addIrregularRule: typeof npmPluralize.addIrregularRule;
|
|
17
|
-
declare const addUncountableRule: typeof npmPluralize.addUncountableRule;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/pluralize.d.ts
|
|
12
|
+
declare const plural: typeof npmPluralize.plural, singular: typeof npmPluralize.singular, isSingular: typeof npmPluralize.isSingular, isPlural: typeof npmPluralize.isPlural, addPluralRule: typeof npmPluralize.addPluralRule, addSingularRule: typeof npmPluralize.addSingularRule, addIrregularRule: typeof npmPluralize.addIrregularRule, addUncountableRule: typeof npmPluralize.addUncountableRule;
|
|
18
13
|
/**
|
|
19
14
|
* Pluralize a word based on the passed in count. Call signatures:
|
|
20
15
|
*
|
|
@@ -35,9 +30,11 @@ declare const addUncountableRule: typeof npmPluralize.addUncountableRule;
|
|
|
35
30
|
* @returns The pluralized word
|
|
36
31
|
*/
|
|
37
32
|
declare const pluralize: (a: number | string, b?: number | string, pluralForm?: string) => string;
|
|
38
|
-
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/randomString.d.ts
|
|
39
35
|
declare const base62Characters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
40
36
|
declare const randomString: (length?: number, chars?: string, randomNumbers?: Uint8Array | number[]) => string;
|
|
41
37
|
declare const cryptoRandomString: (length?: number, chars?: string) => string;
|
|
42
|
-
|
|
38
|
+
//#endregion
|
|
43
39
|
export { addIrregularRule, addPluralRule, addSingularRule, addUncountableRule, base62Characters, commaize, cryptoRandomString, isPlural, isSingular, plural, pluralize, randomString, singular };
|
|
40
|
+
//# sourceMappingURL=index.d.mts.map
|