utilitify-core 1.0.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.
Files changed (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +338 -0
  3. package/dist/async.cjs +25 -0
  4. package/dist/async.cjs.map +1 -0
  5. package/dist/async.d.cts +104 -0
  6. package/dist/async.d.ts +104 -0
  7. package/dist/async.js +4 -0
  8. package/dist/async.js.map +1 -0
  9. package/dist/chunk-2ICNRTSN.cjs +346 -0
  10. package/dist/chunk-2ICNRTSN.cjs.map +1 -0
  11. package/dist/chunk-3DPF72DY.js +170 -0
  12. package/dist/chunk-3DPF72DY.js.map +1 -0
  13. package/dist/chunk-4CV4JOE5.js +24 -0
  14. package/dist/chunk-4CV4JOE5.js.map +1 -0
  15. package/dist/chunk-4SLYNSLH.cjs +783 -0
  16. package/dist/chunk-4SLYNSLH.cjs.map +1 -0
  17. package/dist/chunk-5WP7DWCG.js +1285 -0
  18. package/dist/chunk-5WP7DWCG.js.map +1 -0
  19. package/dist/chunk-BMQ6YPKV.js +876 -0
  20. package/dist/chunk-BMQ6YPKV.js.map +1 -0
  21. package/dist/chunk-BZCMWUKS.cjs +479 -0
  22. package/dist/chunk-BZCMWUKS.cjs.map +1 -0
  23. package/dist/chunk-C5R744DY.cjs +173 -0
  24. package/dist/chunk-C5R744DY.cjs.map +1 -0
  25. package/dist/chunk-C75J62CV.cjs +913 -0
  26. package/dist/chunk-C75J62CV.cjs.map +1 -0
  27. package/dist/chunk-CZLDE2OZ.cjs +28 -0
  28. package/dist/chunk-CZLDE2OZ.cjs.map +1 -0
  29. package/dist/chunk-DSMB6AF6.cjs +193 -0
  30. package/dist/chunk-DSMB6AF6.cjs.map +1 -0
  31. package/dist/chunk-ETWGPOPY.js +426 -0
  32. package/dist/chunk-ETWGPOPY.js.map +1 -0
  33. package/dist/chunk-FQBPVN63.cjs +403 -0
  34. package/dist/chunk-FQBPVN63.cjs.map +1 -0
  35. package/dist/chunk-G4GYQGTW.cjs +178 -0
  36. package/dist/chunk-G4GYQGTW.cjs.map +1 -0
  37. package/dist/chunk-GFDMZDMI.js +486 -0
  38. package/dist/chunk-GFDMZDMI.js.map +1 -0
  39. package/dist/chunk-HOTOYIPB.js +171 -0
  40. package/dist/chunk-HOTOYIPB.js.map +1 -0
  41. package/dist/chunk-HYADH4ZX.js +176 -0
  42. package/dist/chunk-HYADH4ZX.js.map +1 -0
  43. package/dist/chunk-JBN7C5WE.js +255 -0
  44. package/dist/chunk-JBN7C5WE.js.map +1 -0
  45. package/dist/chunk-JNCTPFTD.cjs +25 -0
  46. package/dist/chunk-JNCTPFTD.cjs.map +1 -0
  47. package/dist/chunk-N3BH3BV7.js +21 -0
  48. package/dist/chunk-N3BH3BV7.js.map +1 -0
  49. package/dist/chunk-NFPGAVRQ.js +749 -0
  50. package/dist/chunk-NFPGAVRQ.js.map +1 -0
  51. package/dist/chunk-OFFRGRBN.cjs +1332 -0
  52. package/dist/chunk-OFFRGRBN.cjs.map +1 -0
  53. package/dist/chunk-OZLKYIZL.cjs +490 -0
  54. package/dist/chunk-OZLKYIZL.cjs.map +1 -0
  55. package/dist/chunk-P3NUK46X.js +145 -0
  56. package/dist/chunk-P3NUK46X.js.map +1 -0
  57. package/dist/chunk-P7P2B7ZI.cjs +429 -0
  58. package/dist/chunk-P7P2B7ZI.cjs.map +1 -0
  59. package/dist/chunk-PB6SKSJN.cjs +150 -0
  60. package/dist/chunk-PB6SKSJN.cjs.map +1 -0
  61. package/dist/chunk-R3IXCJR7.js +378 -0
  62. package/dist/chunk-R3IXCJR7.js.map +1 -0
  63. package/dist/chunk-SD6P3WEJ.js +324 -0
  64. package/dist/chunk-SD6P3WEJ.js.map +1 -0
  65. package/dist/chunk-YSCHP26P.js +451 -0
  66. package/dist/chunk-YSCHP26P.js.map +1 -0
  67. package/dist/chunk-ZLMPRPCY.cjs +274 -0
  68. package/dist/chunk-ZLMPRPCY.cjs.map +1 -0
  69. package/dist/common-CBDYNJeh.d.cts +48 -0
  70. package/dist/common-CBDYNJeh.d.ts +48 -0
  71. package/dist/constants.cjs +42 -0
  72. package/dist/constants.cjs.map +1 -0
  73. package/dist/constants.d.cts +60 -0
  74. package/dist/constants.d.ts +60 -0
  75. package/dist/constants.js +5 -0
  76. package/dist/constants.js.map +1 -0
  77. package/dist/country/index.cjs +154 -0
  78. package/dist/country/index.cjs.map +1 -0
  79. package/dist/country/index.d.cts +1 -0
  80. package/dist/country/index.d.ts +1 -0
  81. package/dist/country/index.js +5 -0
  82. package/dist/country/index.js.map +1 -0
  83. package/dist/date/index.cjs +117 -0
  84. package/dist/date/index.cjs.map +1 -0
  85. package/dist/date/index.d.cts +283 -0
  86. package/dist/date/index.d.ts +283 -0
  87. package/dist/date/index.js +4 -0
  88. package/dist/date/index.js.map +1 -0
  89. package/dist/environment/index.cjs +73 -0
  90. package/dist/environment/index.cjs.map +1 -0
  91. package/dist/environment/index.d.cts +127 -0
  92. package/dist/environment/index.d.ts +127 -0
  93. package/dist/environment/index.js +4 -0
  94. package/dist/environment/index.js.map +1 -0
  95. package/dist/form/index.cjs +81 -0
  96. package/dist/form/index.cjs.map +1 -0
  97. package/dist/form/index.d.cts +227 -0
  98. package/dist/form/index.d.ts +227 -0
  99. package/dist/form/index.js +4 -0
  100. package/dist/form/index.js.map +1 -0
  101. package/dist/i18n.cjs +37 -0
  102. package/dist/i18n.cjs.map +1 -0
  103. package/dist/i18n.d.cts +102 -0
  104. package/dist/i18n.d.ts +102 -0
  105. package/dist/i18n.js +4 -0
  106. package/dist/i18n.js.map +1 -0
  107. package/dist/index-BXBmBHyL.d.ts +718 -0
  108. package/dist/index-BYsUCP3u.d.cts +718 -0
  109. package/dist/index-Cl26FrAZ.d.cts +362 -0
  110. package/dist/index-Cl26FrAZ.d.ts +362 -0
  111. package/dist/index.cjs +1265 -0
  112. package/dist/index.cjs.map +1 -0
  113. package/dist/index.d.cts +205 -0
  114. package/dist/index.d.ts +205 -0
  115. package/dist/index.js +277 -0
  116. package/dist/index.js.map +1 -0
  117. package/dist/schema.cjs +13 -0
  118. package/dist/schema.cjs.map +1 -0
  119. package/dist/schema.d.cts +84 -0
  120. package/dist/schema.d.ts +84 -0
  121. package/dist/schema.js +4 -0
  122. package/dist/schema.js.map +1 -0
  123. package/dist/security/index.cjs +94 -0
  124. package/dist/security/index.cjs.map +1 -0
  125. package/dist/security/index.d.cts +216 -0
  126. package/dist/security/index.d.ts +216 -0
  127. package/dist/security/index.js +5 -0
  128. package/dist/security/index.js.map +1 -0
  129. package/dist/string/index.cjs +153 -0
  130. package/dist/string/index.cjs.map +1 -0
  131. package/dist/string/index.d.cts +471 -0
  132. package/dist/string/index.d.ts +471 -0
  133. package/dist/string/index.js +4 -0
  134. package/dist/string/index.js.map +1 -0
  135. package/dist/transform/index.cjs +105 -0
  136. package/dist/transform/index.cjs.map +1 -0
  137. package/dist/transform/index.d.cts +271 -0
  138. package/dist/transform/index.d.ts +271 -0
  139. package/dist/transform/index.js +4 -0
  140. package/dist/transform/index.js.map +1 -0
  141. package/dist/validators/index.cjs +195 -0
  142. package/dist/validators/index.cjs.map +1 -0
  143. package/dist/validators/index.d.cts +2 -0
  144. package/dist/validators/index.d.ts +2 -0
  145. package/dist/validators/index.js +6 -0
  146. package/dist/validators/index.js.map +1 -0
  147. package/package.json +229 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/string/case.ts","../src/string/slug.ts","../src/string/mask.ts","../src/string/random.ts","../src/string/truncate.ts"],"names":["DEFAULT_OPTIONS"],"mappings":";AAaO,SAAS,YAAY,GAAA,EAAqB;AAC7C,EAAA,IAAI,CAAC,GAAA,IAAO,OAAO,GAAA,KAAQ,UAAU,OAAO,EAAA;AAG5C,EAAA,MAAM,UAAA,GAAa,eAAe,IAAA,CAAK,GAAA,CAAI,MAAM,CAAA,GAAI,GAAA,CAAI,WAAA,EAAY,GAAI,GAAA;AAEzE,EAAA,OAAO,WACF,IAAA,EAAK,CACL,QAAQ,cAAA,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EAAK,cAAA,GAAiB,gBAAgB,CAAA;AACzE;AAKA,SAAS,sBAAA,CAAuB,GAAA,EAAa,WAAA,EAAqB,MAAA,EAAwB;AACtF,EAAA,MAAM,cAAA,GAAiB,kBAAkB,GAAG,CAAA;AAC5C,EAAA,IAAI,cAAA,IAAkB,aAAa,OAAO,GAAA;AAE1C,EAAA,MAAM,YAAA,GAAe,kBAAkB,MAAM,CAAA;AAC7C,EAAA,MAAM,gBAAgB,WAAA,GAAc,YAAA;AACpC,EAAA,IAAI,iBAAiB,CAAA,EAAG,OAAO,cAAA,CAAe,MAAA,EAAQ,GAAG,WAAW,CAAA;AAEpE,EAAA,MAAM,WAAA,GAAc,IAAA,CAAK,IAAA,CAAK,aAAA,GAAgB,CAAC,CAAA;AAC/C,EAAA,MAAM,SAAA,GAAY,IAAA,CAAK,KAAA,CAAM,aAAA,GAAgB,CAAC,CAAA;AAE9C,EAAA,OAAO,cAAA,CAAe,KAAK,CAAA,EAAG,WAAW,IAAI,MAAA,GAAS,cAAA,CAAe,GAAA,EAAK,cAAA,GAAiB,SAAS,CAAA;AACxG","file":"chunk-BMQ6YPKV.js","sourcesContent":["/**\r\n * Convert string to camelCase\r\n *\r\n * @param str - String to convert\r\n * @returns camelCase string\r\n *\r\n * @example\r\n * ```typescript\r\n * toCamelCase('hello world'); // 'helloWorld'\r\n * toCamelCase('hello-world'); // 'helloWorld'\r\n * toCamelCase('HelloWorld'); // 'helloWorld'\r\n * ```\r\n */\r\nexport function toCamelCase(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n // First, convert the string to lowercase if it's all uppercase\r\n const normalized = /^[A-Z_\\s-]+$/.test(str.trim()) ? str.toLowerCase() : str;\r\n\r\n return normalized\r\n .trim()\r\n .replace(/[-_\\s]+(.)?/g, (_, char) => (char ? char.toUpperCase() : ''))\r\n .replace(/^[A-Z]/, char => char.toLowerCase());\r\n}\r\n\r\n/**\r\n * Convert string to PascalCase\r\n *\r\n * @param str - String to convert\r\n * @returns PascalCase string\r\n *\r\n * @example\r\n * ```typescript\r\n * toPascalCase('hello world'); // 'HelloWorld'\r\n * toPascalCase('hello-world'); // 'HelloWorld'\r\n * ```\r\n */\r\nexport function toPascalCase(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n const camel = toCamelCase(str);\r\n return camel.charAt(0).toUpperCase() + camel.slice(1);\r\n}\r\n\r\n/**\r\n * Convert string to snake_case\r\n *\r\n * @param str - String to convert\r\n * @returns snake_case string\r\n *\r\n * @example\r\n * ```typescript\r\n * toSnakeCase('helloWorld'); // 'hello_world'\r\n * toSnakeCase('Hello World'); // 'hello_world'\r\n * ```\r\n */\r\nexport function toSnakeCase(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n return str\r\n .trim()\r\n .replace(/([a-z])([A-Z])/g, '$1_$2')\r\n .replace(/[-\\s]+/g, '_')\r\n .toLowerCase();\r\n}\r\n\r\n/**\r\n * Convert string to kebab-case\r\n *\r\n * @param str - String to convert\r\n * @returns kebab-case string\r\n *\r\n * @example\r\n * ```typescript\r\n * toKebabCase('helloWorld'); // 'hello-world'\r\n * toKebabCase('Hello World'); // 'hello-world'\r\n * ```\r\n */\r\nexport function toKebabCase(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n return str\r\n .trim()\r\n .replace(/([a-z])([A-Z])/g, '$1-$2')\r\n .replace(/[_\\s]+/g, '-')\r\n .toLowerCase();\r\n}\r\n\r\n/**\r\n * Convert string to Title Case\r\n *\r\n * @param str - String to convert\r\n * @returns Title Case string\r\n *\r\n * @example\r\n * ```typescript\r\n * toTitleCase('hello world'); // 'Hello World'\r\n * toTitleCase('the quick brown'); // 'The Quick Brown'\r\n * ```\r\n */\r\nexport function toTitleCase(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n // Words to keep lowercase (unless first word)\r\n const smallWords = new Set([\r\n 'a', 'an', 'and', 'as', 'at', 'but', 'by', 'for', 'in',\r\n 'nor', 'of', 'on', 'or', 'so', 'the', 'to', 'up', 'yet'\r\n ]);\r\n\r\n return str\r\n .toLowerCase()\r\n .split(/\\s+/)\r\n .map((word, index) => {\r\n // Always capitalize first word\r\n if (index === 0) {\r\n return word.charAt(0).toUpperCase() + word.slice(1);\r\n }\r\n // Keep small words lowercase\r\n if (smallWords.has(word)) {\r\n return word;\r\n }\r\n return word.charAt(0).toUpperCase() + word.slice(1);\r\n })\r\n .join(' ');\r\n}\r\n\r\n/**\r\n * Convert string to CONSTANT_CASE\r\n *\r\n * @param str - String to convert\r\n * @returns CONSTANT_CASE string\r\n *\r\n * @example\r\n * ```typescript\r\n * toConstantCase('helloWorld'); // 'HELLO_WORLD'\r\n * toConstantCase('Hello World'); // 'HELLO_WORLD'\r\n * ```\r\n */\r\nexport function toConstantCase(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n return toSnakeCase(str).toUpperCase();\r\n}\r\n\r\n/**\r\n * Convert string to Sentence case\r\n *\r\n * @param str - String to convert\r\n * @returns Sentence case string\r\n *\r\n * @example\r\n * ```typescript\r\n * toSentenceCase('hello World'); // 'Hello world'\r\n * toSentenceCase('HELLO WORLD'); // 'Hello world'\r\n * ```\r\n */\r\nexport function toSentenceCase(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n const lower = str.toLowerCase().trim();\r\n return lower.charAt(0).toUpperCase() + lower.slice(1);\r\n}\r\n\r\n/**\r\n * Convert string to dot.case\r\n *\r\n * @param str - String to convert\r\n * @returns dot.case string\r\n */\r\nexport function toDotCase(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n return str\r\n .trim()\r\n .replace(/([a-z])([A-Z])/g, '$1.$2')\r\n .replace(/[-_\\s]+/g, '.')\r\n .toLowerCase();\r\n}\r\n\r\n/**\r\n * Capitalize first letter\r\n *\r\n * @param str - String to capitalize\r\n * @returns Capitalized string\r\n */\r\nexport function capitalize(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n return str.charAt(0).toUpperCase() + str.slice(1);\r\n}\r\n\r\n/**\r\n * Uncapitalize first letter\r\n *\r\n * @param str - String to uncapitalize\r\n * @returns Uncapitalized string\r\n */\r\nexport function uncapitalize(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n return str.charAt(0).toLowerCase() + str.slice(1);\r\n}\r\n\r\n/**\r\n * Swap case of each character\r\n *\r\n * @param str - String to swap\r\n * @returns Swapped case string\r\n */\r\nexport function swapCase(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n return [...str]\r\n .map(char => {\r\n if (char === char.toUpperCase()) {\r\n return char.toLowerCase();\r\n }\r\n return char.toUpperCase();\r\n })\r\n .join('');\r\n}\r\n","/**\r\n * Slug generation options\r\n */\r\nexport interface SlugOptions {\r\n /** Convert to lowercase (default: true) */\r\n lowercase?: boolean;\r\n /** Separator character (default: '-') */\r\n separator?: string;\r\n /** Maximum length (default: unlimited) */\r\n maxLength?: number;\r\n /** Transliterate non-ASCII characters (default: true) */\r\n transliterate?: boolean;\r\n /** Remove stop words (default: false) */\r\n removeStopWords?: boolean;\r\n}\r\n\r\n/**\r\n * Character transliteration map\r\n */\r\nconst TRANSLITERATION_MAP: Record<string, string> = {\r\n // Latin Extended\r\n 'à': 'a', 'á': 'a', 'â': 'a', 'ã': 'a', 'ä': 'a', 'å': 'a', 'æ': 'ae',\r\n 'ç': 'c', 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e',\r\n 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i',\r\n 'ð': 'd', 'ñ': 'n',\r\n 'ò': 'o', 'ó': 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o', 'ø': 'o',\r\n 'ù': 'u', 'ú': 'u', 'û': 'u', 'ü': 'u',\r\n 'ý': 'y', 'ÿ': 'y', 'þ': 'th',\r\n 'ß': 'ss',\r\n // Polish\r\n 'ą': 'a', 'ć': 'c', 'ę': 'e', 'ł': 'l', 'ń': 'n', 'ś': 's', 'ź': 'z', 'ż': 'z',\r\n // Czech/Slovak\r\n 'č': 'c', 'ď': 'd', 'ě': 'e', 'ň': 'n', 'ř': 'r', 'š': 's', 'ť': 't', 'ů': 'u', 'ž': 'z',\r\n // German\r\n 'Ä': 'Ae', 'Ö': 'Oe', 'Ü': 'Ue',\r\n // Turkish\r\n 'ğ': 'g', 'ı': 'i', 'ş': 's',\r\n // Romanian\r\n 'ă': 'a', 'ș': 's', 'ț': 't',\r\n // Symbols\r\n '©': 'c', '®': 'r', '™': 'tm', '&': 'and', '@': 'at',\r\n};\r\n\r\n/**\r\n * Stop words for SEO slugs\r\n */\r\nconst STOP_WORDS = new Set([\r\n 'a', 'an', 'and', 'are', 'as', 'at', 'be', 'by', 'for',\r\n 'from', 'has', 'he', 'in', 'is', 'it', 'its', 'of', 'on',\r\n 'that', 'the', 'to', 'was', 'were', 'will', 'with'\r\n]);\r\n\r\n/**\r\n * Default slug options\r\n */\r\nconst DEFAULT_OPTIONS: SlugOptions = {\r\n lowercase: true,\r\n separator: '-',\r\n transliterate: true,\r\n removeStopWords: false,\r\n};\r\n\r\n/**\r\n * Convert string to SEO-friendly slug\r\n *\r\n * @param str - String to convert\r\n * @param options - Slug options\r\n * @returns SEO-friendly slug\r\n *\r\n * @example\r\n * ```typescript\r\n * toSlug('Hello World!'); // 'hello-world'\r\n * toSlug('Café & Restaurant'); // 'cafe-and-restaurant'\r\n * toSlug('Hello World', { separator: '_' }); // 'hello_world'\r\n * ```\r\n */\r\nexport function toSlug(str: string, options: SlugOptions = {}): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n const opts = { ...DEFAULT_OPTIONS, ...options };\r\n let result = str.trim();\r\n\r\n // Transliterate\r\n if (opts.transliterate) {\r\n result = transliterate(result);\r\n }\r\n\r\n // Convert to lowercase if needed\r\n if (opts.lowercase) {\r\n result = result.toLowerCase();\r\n }\r\n\r\n // Remove stop words if needed\r\n if (opts.removeStopWords) {\r\n result = result\r\n .split(/\\s+/)\r\n .filter(word => !STOP_WORDS.has(word.toLowerCase()))\r\n .join(' ');\r\n }\r\n\r\n // Replace spaces and special characters with separator\r\n result = result\r\n .replace(/[^\\w\\s-]/g, '') // Remove special characters\r\n .replace(/[\\s_]+/g, opts.separator || '-') // Replace spaces/underscores with separator\r\n .replace(new RegExp(`${opts.separator}+`, 'g'), opts.separator || '-') // Remove consecutive separators\r\n .replace(new RegExp(`^${opts.separator}|${opts.separator}$`, 'g'), ''); // Trim separators\r\n\r\n // Apply max length\r\n if (opts.maxLength && result.length > opts.maxLength) {\r\n // Cut at word boundary if possible\r\n result = result.slice(0, opts.maxLength);\r\n const lastSep = result.lastIndexOf(opts.separator || '-');\r\n if (lastSep > opts.maxLength * 0.5) {\r\n result = result.slice(0, lastSep);\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Transliterate non-ASCII characters to ASCII\r\n *\r\n * @param str - String to transliterate\r\n * @returns Transliterated string\r\n */\r\nexport function transliterate(str: string): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n return [...str]\r\n .map(char => {\r\n const lower = char.toLowerCase();\r\n if (TRANSLITERATION_MAP[lower]) {\r\n // Preserve case\r\n const replacement = TRANSLITERATION_MAP[lower];\r\n if (char === char.toUpperCase()) {\r\n return replacement.charAt(0).toUpperCase() + replacement.slice(1);\r\n }\r\n return replacement;\r\n }\r\n return char;\r\n })\r\n .join('');\r\n}\r\n\r\n/**\r\n * Generate URL-safe slug from string\r\n *\r\n * @param str - String to slugify\r\n * @returns URL-safe slug\r\n */\r\nexport function slugify(str: string): string {\r\n return toSlug(str);\r\n}\r\n\r\n/**\r\n * Generate unique slug by appending number if needed\r\n *\r\n * @param str - Base string\r\n * @param existingSlugs - Set of existing slugs\r\n * @param options - Slug options\r\n * @returns Unique slug\r\n */\r\nexport function uniqueSlug(\r\n str: string,\r\n existingSlugs: Set<string> | string[],\r\n options: SlugOptions = {}\r\n): string {\r\n const existing = existingSlugs instanceof Set ? existingSlugs : new Set(existingSlugs);\r\n const baseSlug = toSlug(str, options);\r\n\r\n if (!existing.has(baseSlug)) {\r\n return baseSlug;\r\n }\r\n\r\n let counter = 1;\r\n let uniqueSlugStr = `${baseSlug}${options.separator || '-'}${counter}`;\r\n\r\n while (existing.has(uniqueSlugStr)) {\r\n counter++;\r\n uniqueSlugStr = `${baseSlug}${options.separator || '-'}${counter}`;\r\n }\r\n\r\n return uniqueSlugStr;\r\n}\r\n\r\n/**\r\n * Check if string is a valid slug\r\n *\r\n * @param str - String to check\r\n * @returns true if valid slug\r\n */\r\nexport function isValidSlug(str: string): boolean {\r\n if (!str || typeof str !== 'string') return false;\r\n return /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(str);\r\n}\r\n","/**\r\n * Mask options\r\n */\r\nexport interface MaskOptions {\r\n /** Mask character (default: '*') */\r\n maskChar?: string;\r\n /** Number of visible chars at start (default: varies by type) */\r\n visibleStart?: number;\r\n /** Number of visible chars at end (default: varies by type) */\r\n visibleEnd?: number;\r\n /** Minimum string length to mask (default: 4) */\r\n minLength?: number;\r\n}\r\n\r\n/**\r\n * Default mask options\r\n */\r\nconst DEFAULT_OPTIONS: MaskOptions = {\r\n maskChar: '*',\r\n minLength: 4,\r\n};\r\n\r\n/**\r\n * Mask an email address\r\n *\r\n * @param email - Email to mask\r\n * @param options - Mask options\r\n * @returns Masked email\r\n *\r\n * @example\r\n * ```typescript\r\n * maskEmail('john.doe@gmail.com'); // 'j***@gmail.com'\r\n * maskEmail('test@example.com'); // 't***@example.com'\r\n * ```\r\n */\r\nexport function maskEmail(email: string, options: MaskOptions = {}): string {\r\n if (!email || typeof email !== 'string') return '';\r\n\r\n const [localPart, domain] = email.split('@');\r\n if (!localPart || !domain) return email;\r\n\r\n const maskChar = options.maskChar || '*';\r\n const visibleStart = options.visibleStart ?? 1;\r\n\r\n // Keep first character(s) and mask the rest\r\n if (localPart.length <= visibleStart) {\r\n return `${maskChar.repeat(3)}@${domain}`;\r\n }\r\n\r\n const visible = localPart.slice(0, visibleStart);\r\n const masked = maskChar.repeat(Math.min(localPart.length - visibleStart, 5));\r\n\r\n return `${visible}${masked}@${domain}`;\r\n}\r\n\r\n/**\r\n * Mask a phone number\r\n *\r\n * @param phone - Phone to mask\r\n * @param options - Mask options\r\n * @returns Masked phone\r\n *\r\n * @example\r\n * ```typescript\r\n * maskPhone('+1 555-123-4567'); // '+1 *** *** 4567'\r\n * maskPhone('03001234567'); // '030*****67'\r\n * ```\r\n */\r\nexport function maskPhone(phone: string, options: MaskOptions = {}): string {\r\n if (!phone || typeof phone !== 'string') return '';\r\n\r\n const maskChar = options.maskChar || '*';\r\n const visibleStart = options.visibleStart ?? 3;\r\n const visibleEnd = options.visibleEnd ?? 4;\r\n\r\n // Extract digits only\r\n const digits = phone.replace(/\\D/g, '');\r\n\r\n if (digits.length < visibleStart + visibleEnd) {\r\n return phone;\r\n }\r\n\r\n // Preserve phone structure\r\n let result = '';\r\n let digitIndex = 0;\r\n\r\n for (const char of phone) {\r\n if (/\\d/.test(char)) {\r\n if (digitIndex < visibleStart || digitIndex >= digits.length - visibleEnd) {\r\n result += char;\r\n } else {\r\n result += maskChar;\r\n }\r\n digitIndex++;\r\n } else {\r\n result += char;\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Mask a credit card number\r\n *\r\n * @param card - Card number to mask\r\n * @param options - Mask options\r\n * @returns Masked card number\r\n *\r\n * @example\r\n * ```typescript\r\n * maskCreditCard('4111 1111 1111 1111'); // '**** **** **** 1111'\r\n * maskCreditCard('4111111111111111'); // '************1111'\r\n * ```\r\n */\r\nexport function maskCreditCard(card: string, options: MaskOptions = {}): string {\r\n if (!card || typeof card !== 'string') return '';\r\n\r\n const maskChar = options.maskChar || '*';\r\n const visibleEnd = options.visibleEnd ?? 4;\r\n\r\n // Extract digits only\r\n const digits = card.replace(/\\D/g, '');\r\n\r\n if (digits.length < visibleEnd + 1) {\r\n return card;\r\n }\r\n\r\n // Preserve card structure\r\n let result = '';\r\n let digitIndex = 0;\r\n\r\n for (const char of card) {\r\n if (/\\d/.test(char)) {\r\n if (digitIndex >= digits.length - visibleEnd) {\r\n result += char;\r\n } else {\r\n result += maskChar;\r\n }\r\n digitIndex++;\r\n } else {\r\n result += char;\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Mask a generic string\r\n *\r\n * @param str - String to mask\r\n * @param options - Mask options\r\n * @returns Masked string\r\n *\r\n * @example\r\n * ```typescript\r\n * maskString('password123', { visibleStart: 2, visibleEnd: 2 }); // 'pa*******23'\r\n * maskString('secret', { visibleEnd: 3 }); // '***ret'\r\n * ```\r\n */\r\nexport function maskString(str: string, options: MaskOptions = {}): string {\r\n if (!str || typeof str !== 'string') return '';\r\n\r\n const opts = { ...DEFAULT_OPTIONS, ...options };\r\n\r\n if (str.length < (opts.minLength || 4)) {\r\n return str;\r\n }\r\n\r\n const visibleStart = opts.visibleStart ?? 0;\r\n const visibleEnd = opts.visibleEnd ?? 0;\r\n\r\n if (str.length <= visibleStart + visibleEnd) {\r\n return str;\r\n }\r\n\r\n const start = str.slice(0, visibleStart);\r\n const end = str.slice(-visibleEnd || str.length);\r\n const maskLength = str.length - visibleStart - visibleEnd;\r\n\r\n return `${start}${(opts.maskChar || '*').repeat(maskLength)}${visibleEnd > 0 ? end : ''}`;\r\n}\r\n\r\n/**\r\n * Mask IP address\r\n *\r\n * @param ip - IP address to mask\r\n * @returns Masked IP\r\n *\r\n * @example\r\n * ```typescript\r\n * maskIP('192.168.1.100'); // '192.168.***.***'\r\n * ```\r\n */\r\nexport function maskIP(ip: string): string {\r\n if (!ip || typeof ip !== 'string') return '';\r\n\r\n const parts = ip.split('.');\r\n if (parts.length !== 4) return ip;\r\n\r\n return `${parts[0]}.${parts[1]}.***.***`;\r\n}\r\n\r\n/**\r\n * Mask name (for privacy)\r\n *\r\n * @param name - Name to mask\r\n * @returns Masked name\r\n *\r\n * @example\r\n * ```typescript\r\n * maskName('John Doe'); // 'J*** D**'\r\n * ```\r\n */\r\nexport function maskName(name: string): string {\r\n if (!name || typeof name !== 'string') return '';\r\n\r\n return name\r\n .split(' ')\r\n .map(part => {\r\n if (part.length <= 1) return part;\r\n return part[0] + '*'.repeat(Math.min(part.length - 1, 3));\r\n })\r\n .join(' ');\r\n}\r\n\r\n/**\r\n * Unmask is not possible - this is a one-way operation\r\n * This function is a placeholder for documentation\r\n */\r\nexport function unmask(): never {\r\n throw new Error('Masking is a one-way operation and cannot be reversed');\r\n}\r\n","/**\r\n * Password generation options\r\n */\r\nexport interface PasswordOptions {\r\n /** Password length (default: 16) */\r\n length?: number;\r\n /** Include uppercase letters (default: true) */\r\n uppercase?: boolean;\r\n /** Include lowercase letters (default: true) */\r\n lowercase?: boolean;\r\n /** Include numbers (default: true) */\r\n numbers?: boolean;\r\n /** Include symbols (default: true) */\r\n symbols?: boolean;\r\n /** Exclude ambiguous characters like 0, O, l, 1 (default: false) */\r\n excludeAmbiguous?: boolean;\r\n /** Custom characters to include */\r\n customChars?: string;\r\n /** Minimum number of each character type */\r\n minOfEachType?: number;\r\n}\r\n\r\n/**\r\n * Character sets\r\n */\r\nconst CHAR_SETS = {\r\n uppercase: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\r\n uppercaseUnambiguous: 'ABCDEFGHJKLMNPQRSTUVWXYZ',\r\n lowercase: 'abcdefghijklmnopqrstuvwxyz',\r\n lowercaseUnambiguous: 'abcdefghjkmnpqrstuvwxyz',\r\n numbers: '0123456789',\r\n numbersUnambiguous: '23456789',\r\n symbols: '!@#$%^&*()_+-=[]{}|;:,.<>?',\r\n};\r\n\r\n/**\r\n * Default password options\r\n */\r\nconst DEFAULT_PASSWORD_OPTIONS: PasswordOptions = {\r\n length: 16,\r\n uppercase: true,\r\n lowercase: true,\r\n numbers: true,\r\n symbols: true,\r\n excludeAmbiguous: false,\r\n minOfEachType: 1,\r\n};\r\n\r\n/**\r\n * Generate a random password\r\n *\r\n * @param options - Password options\r\n * @returns Generated password\r\n *\r\n * @example\r\n * ```typescript\r\n * generatePassword(); // 'Xy7@mK9#pL2$nR4!'\r\n * generatePassword({ length: 8, symbols: false }); // 'xY7mK9pL'\r\n * ```\r\n */\r\nexport function generatePassword(options: PasswordOptions = {}): string {\r\n const opts = { ...DEFAULT_PASSWORD_OPTIONS, ...options };\r\n const length = Math.max(4, opts.length || 16);\r\n\r\n // Build character set\r\n let charset = '';\r\n const requiredChars: string[] = [];\r\n\r\n if (opts.uppercase) {\r\n const chars = opts.excludeAmbiguous\r\n ? CHAR_SETS.uppercaseUnambiguous\r\n : CHAR_SETS.uppercase;\r\n charset += chars;\r\n for (let i = 0; i < (opts.minOfEachType || 1); i++) {\r\n requiredChars.push(getRandomChar(chars));\r\n }\r\n }\r\n\r\n if (opts.lowercase) {\r\n const chars = opts.excludeAmbiguous\r\n ? CHAR_SETS.lowercaseUnambiguous\r\n : CHAR_SETS.lowercase;\r\n charset += chars;\r\n for (let i = 0; i < (opts.minOfEachType || 1); i++) {\r\n requiredChars.push(getRandomChar(chars));\r\n }\r\n }\r\n\r\n if (opts.numbers) {\r\n const chars = opts.excludeAmbiguous\r\n ? CHAR_SETS.numbersUnambiguous\r\n : CHAR_SETS.numbers;\r\n charset += chars;\r\n for (let i = 0; i < (opts.minOfEachType || 1); i++) {\r\n requiredChars.push(getRandomChar(chars));\r\n }\r\n }\r\n\r\n if (opts.symbols) {\r\n charset += CHAR_SETS.symbols;\r\n for (let i = 0; i < (opts.minOfEachType || 1); i++) {\r\n requiredChars.push(getRandomChar(CHAR_SETS.symbols));\r\n }\r\n }\r\n\r\n if (opts.customChars) {\r\n charset += opts.customChars;\r\n }\r\n\r\n if (!charset) {\r\n charset = CHAR_SETS.lowercase + CHAR_SETS.numbers;\r\n }\r\n\r\n // Generate password\r\n const passwordChars: string[] = [...requiredChars];\r\n\r\n // Fill remaining length with random characters\r\n while (passwordChars.length < length) {\r\n passwordChars.push(getRandomChar(charset));\r\n }\r\n\r\n // Truncate if we have too many required chars\r\n if (passwordChars.length > length) {\r\n passwordChars.length = length;\r\n }\r\n\r\n // Shuffle the password\r\n return shuffleArray(passwordChars).join('');\r\n}\r\n\r\n/**\r\n * Generate a random string\r\n *\r\n * @param length - Length of string\r\n * @param charset - Character set to use\r\n * @returns Random string\r\n *\r\n * @example\r\n * ```typescript\r\n * generateRandomString(10); // 'xK7mP9nL2s'\r\n * generateRandomString(6, 'abc123'); // 'a1b2c3'\r\n * ```\r\n */\r\nexport function generateRandomString(\r\n length: number = 16,\r\n charset: string = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\r\n): string {\r\n if (length <= 0) return '';\r\n if (!charset) charset = 'abcdefghijklmnopqrstuvwxyz0123456789';\r\n\r\n let result = '';\r\n for (let i = 0; i < length; i++) {\r\n result += getRandomChar(charset);\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * Generate a numeric OTP (One-Time Password)\r\n *\r\n * @param length - Length of OTP (default: 6)\r\n * @returns OTP string\r\n *\r\n * @example\r\n * ```typescript\r\n * generateOTP(); // '482957'\r\n * generateOTP(4); // '7382'\r\n * ```\r\n */\r\nexport function generateOTP(length: number = 6): string {\r\n return generateRandomString(length, '0123456789');\r\n}\r\n\r\n/**\r\n * Generate a memorable passphrase\r\n *\r\n * @param wordCount - Number of words\r\n * @param separator - Word separator\r\n * @returns Passphrase\r\n *\r\n * @example\r\n * ```typescript\r\n * generatePassphrase(4); // 'correct-horse-battery-staple'\r\n * ```\r\n */\r\nexport function generatePassphrase(wordCount: number = 4, separator: string = '-'): string {\r\n // Comprehensive word list for passphrases (256 words = 8 bits entropy per word)\r\n // Words chosen to be: common, easy to spell, easy to type, memorable\r\n const words = [\r\n // Nature & Weather (32)\r\n 'apple', 'banana', 'cherry', 'dragon', 'eagle', 'forest', 'garden', 'harbor',\r\n 'island', 'jungle', 'kitten', 'lemon', 'mountain', 'nature', 'ocean', 'planet',\r\n 'river', 'sunset', 'thunder', 'umbrella', 'violet', 'window', 'yellow', 'zebra',\r\n 'anchor', 'bridge', 'castle', 'dolphin', 'ember', 'falcon', 'glacier', 'horizon',\r\n // Objects & Places (32)\r\n 'ivory', 'jasmine', 'kingdom', 'lantern', 'meadow', 'nebula', 'orchid', 'phoenix',\r\n 'quartz', 'rainbow', 'shadow', 'tornado', 'unicorn', 'volcano', 'whisper', 'crystal',\r\n 'diamond', 'eclipse', 'feather', 'granite', 'helmet', 'jigsaw', 'kayak', 'ladder',\r\n 'magnet', 'needle', 'orange', 'panther', 'puzzle', 'rabbit', 'saddle', 'tablet',\r\n // Actions & Concepts (32)\r\n 'beacon', 'candle', 'dancer', 'flight', 'golden', 'hunter', 'insect', 'jacket',\r\n 'keeper', 'leader', 'master', 'native', 'offset', 'parade', 'radius', 'sailor',\r\n 'target', 'uplift', 'vector', 'walker', 'zenith', 'arctic', 'basket', 'camera',\r\n 'dinner', 'escape', 'finger', 'guitar', 'hammer', 'ignite', 'jacket', 'kernel',\r\n // Animals (32)\r\n 'lizard', 'monkey', 'narwhal', 'oyster', 'parrot', 'quiver', 'racoon', 'salmon',\r\n 'turtle', 'urchin', 'viking', 'walrus', 'jaguar', 'badger', 'condor', 'donkey',\r\n 'ferret', 'gopher', 'hornet', 'iguana', 'jackal', 'kitten', 'llama', 'marmot',\r\n 'newt', 'osprey', 'panda', 'quail', 'raven', 'spider', 'toucan', 'vampire',\r\n // Food & Drinks (32)\r\n 'waffle', 'yogurt', 'almond', 'butter', 'celery', 'donut', 'endive', 'fennel',\r\n 'ginger', 'hazel', 'icecap', 'jelly', 'kimchi', 'lentil', 'mango', 'noodle',\r\n 'olive', 'papaya', 'quinoa', 'radish', 'sesame', 'tomato', 'umami', 'vanilla',\r\n 'wasabi', 'xylose', 'yeast', 'zephyr', 'acorn', 'breeze', 'clover', 'dahlia',\r\n // Colors & Materials (32)\r\n 'silver', 'bronze', 'copper', 'purple', 'maroon', 'indigo', 'scarlet', 'crimson',\r\n 'velvet', 'cotton', 'denim', 'linen', 'marble', 'bamboo', 'cedar', 'maple',\r\n 'willow', 'birch', 'coral', 'pearl', 'amber', 'topaz', 'garnet', 'onyx',\r\n 'jasper', 'opal', 'ruby', 'sapphire', 'cobalt', 'chrome', 'steel', 'brass',\r\n // Technology & Science (32)\r\n 'binary', 'cipher', 'domain', 'engine', 'filter', 'gadget', 'hybrid', 'index',\r\n 'joystick', 'kernel', 'lambda', 'module', 'neural', 'output', 'pixel', 'quantum',\r\n 'router', 'sensor', 'toggle', 'upload', 'vertex', 'widget', 'system', 'crypto',\r\n 'buffer', 'cache', 'delta', 'epoch', 'format', 'global', 'header', 'input',\r\n // Misc & Abstract (32)\r\n 'action', 'balance', 'center', 'design', 'energy', 'focus', 'growth', 'health',\r\n 'impact', 'justice', 'knight', 'legacy', 'motion', 'nexus', 'origin', 'prime',\r\n 'quest', 'reward', 'spirit', 'talent', 'unity', 'vision', 'wisdom', 'expert',\r\n 'factor', 'giant', 'humble', 'jovial', 'kinetic', 'lunar', 'metric', 'novel',\r\n ];\r\n\r\n const result: string[] = [];\r\n for (let i = 0; i < wordCount; i++) {\r\n result.push(words[getSecureRandomIndex(words.length)]);\r\n }\r\n\r\n return result.join(separator);\r\n}\r\n\r\n/**\r\n * Generate a hex string\r\n *\r\n * @param length - Length in bytes (output will be 2x this)\r\n * @returns Hex string\r\n */\r\nexport function generateHexString(length: number = 16): string {\r\n return generateRandomString(length * 2, '0123456789abcdef');\r\n}\r\n\r\n/**\r\n * Generate a base64 string\r\n *\r\n * @param length - Approximate length\r\n * @returns Base64 string\r\n */\r\nexport function generateBase64String(length: number = 16): string {\r\n const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\r\n return generateRandomString(length, charset);\r\n}\r\n\r\n/**\r\n * Generate URL-safe random string\r\n *\r\n * @param length - Length of string\r\n * @returns URL-safe random string\r\n */\r\nexport function generateUrlSafeString(length: number = 16): string {\r\n const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';\r\n return generateRandomString(length, charset);\r\n}\r\n\r\n/**\r\n * Get a cryptographically secure random index\r\n * @param max - Maximum value (exclusive)\r\n * @returns Random index between 0 and max-1\r\n */\r\nfunction getSecureRandomIndex(max: number): number {\r\n if (typeof globalThis.crypto?.getRandomValues === 'function') {\r\n const array = new Uint32Array(1);\r\n globalThis.crypto.getRandomValues(array);\r\n return array[0] % max;\r\n }\r\n\r\n // In production, throw error instead of using insecure fallback\r\n const isProduction = typeof process !== 'undefined' && process.env?.NODE_ENV === 'production';\r\n if (isProduction) {\r\n throw new Error(\r\n '[utilitify] Web Crypto API not available. Cannot generate secure random values in production. ' +\r\n 'Ensure you are running in an environment with crypto support (Node.js 15+, modern browsers).'\r\n );\r\n }\r\n\r\n // Fallback for development/testing only - always warn\r\n console.warn(\r\n '[utilitify] Using Math.random() fallback - NOT CRYPTOGRAPHICALLY SECURE. ' +\r\n 'This is only acceptable for development/testing. Install with crypto support for production.'\r\n );\r\n return Math.floor(Math.random() * max);\r\n}\r\n\r\n/**\r\n * Get random character from string using cryptographically secure random\r\n */\r\nfunction getRandomChar(charset: string): string {\r\n return charset[getSecureRandomIndex(charset.length)];\r\n}\r\n\r\n/**\r\n * Shuffle array using Fisher-Yates algorithm with cryptographically secure random\r\n */\r\nfunction shuffleArray<T>(array: T[]): T[] {\r\n const result = [...array];\r\n for (let i = result.length - 1; i > 0; i--) {\r\n const j = getSecureRandomIndex(i + 1);\r\n [result[i], result[j]] = [result[j], result[i]];\r\n }\r\n return result;\r\n}\r\n","/**\r\n * Truncation options\r\n */\r\nexport interface TruncateOptions {\r\n /** Suffix to append (default: '...') */\r\n suffix?: string;\r\n /** Preserve word boundaries (default: true) */\r\n preserveWords?: boolean;\r\n /** Where to truncate: 'end', 'middle', 'start' (default: 'end') */\r\n position?: 'end' | 'middle' | 'start';\r\n /** Use grapheme-aware truncation for proper emoji handling (default: false) */\r\n graphemeAware?: boolean;\r\n}\r\n\r\n/**\r\n * Default truncation options\r\n */\r\nconst DEFAULT_OPTIONS: TruncateOptions = {\r\n suffix: '...',\r\n preserveWords: true,\r\n position: 'end',\r\n graphemeAware: false,\r\n};\r\n\r\n/**\r\n * Truncate a string to specified length\r\n *\r\n * @param str - String to truncate\r\n * @param length - Maximum length (including suffix)\r\n * @param options - Truncation options\r\n * @returns Truncated string\r\n *\r\n * @example\r\n * ```typescript\r\n * truncate('Hello World', 8); // 'Hello...'\r\n * truncate('Hello World', 8, { preserveWords: false }); // 'Hello...'\r\n * truncate('Hello World', 8, { suffix: '…' }); // 'Hello W…'\r\n * ```\r\n */\r\nexport function truncate(\r\n str: string,\r\n length: number,\r\n options: TruncateOptions = {}\r\n): string {\r\n if (!str || typeof str !== 'string') return '';\r\n if (length < 0) {\r\n throw new RangeError('maxLength must be a non-negative number');\r\n }\r\n if (length === 0) return '';\r\n\r\n const opts = { ...DEFAULT_OPTIONS, ...options };\r\n const suffix = opts.suffix ?? '...';\r\n\r\n // Use grapheme-aware length calculation if enabled and Intl.Segmenter is available\r\n const strLength = opts.graphemeAware ? getGraphemeLength(str) : str.length;\r\n\r\n if (strLength <= length) return str;\r\n\r\n const maxContentLength = length - (opts.graphemeAware ? getGraphemeLength(suffix) : suffix.length);\r\n\r\n if (maxContentLength <= 0) {\r\n return opts.graphemeAware ? sliceGraphemes(suffix, 0, length) : suffix.slice(0, length);\r\n }\r\n\r\n switch (opts.position) {\r\n case 'start':\r\n return opts.graphemeAware\r\n ? truncateStartGrapheme(str, maxContentLength, suffix)\r\n : truncateStart(str, maxContentLength, suffix);\r\n case 'middle':\r\n return opts.graphemeAware\r\n ? truncateMiddleGrapheme(str, length, suffix)\r\n : truncateMiddle(str, length, suffix);\r\n default:\r\n return opts.graphemeAware\r\n ? truncateEndGrapheme(str, maxContentLength, suffix, opts.preserveWords ?? true)\r\n : truncateEnd(str, maxContentLength, suffix, opts.preserveWords ?? true);\r\n }\r\n}\r\n\r\n/**\r\n * Truncate at end (default)\r\n */\r\nfunction truncateEnd(\r\n str: string,\r\n maxContentLength: number,\r\n suffix: string,\r\n preserveWords: boolean\r\n): string {\r\n let truncated = str.slice(0, maxContentLength);\r\n\r\n if (preserveWords) {\r\n // Find last space\r\n const lastSpace = truncated.lastIndexOf(' ');\r\n if (lastSpace > maxContentLength * 0.3) {\r\n truncated = truncated.slice(0, lastSpace);\r\n }\r\n }\r\n\r\n // Remove trailing punctuation and spaces\r\n truncated = truncated.replace(/[\\s.,!?;:]+$/, '');\r\n\r\n return truncated + suffix;\r\n}\r\n\r\n/**\r\n * Truncate at start\r\n */\r\nfunction truncateStart(str: string, maxContentLength: number, suffix: string): string {\r\n return suffix + str.slice(-maxContentLength);\r\n}\r\n\r\n/**\r\n * Truncate in middle\r\n */\r\nfunction truncateMiddle(str: string, totalLength: number, suffix: string): string {\r\n if (str.length <= totalLength) return str;\r\n\r\n const contentLength = totalLength - suffix.length;\r\n if (contentLength <= 0) return suffix.slice(0, totalLength);\r\n\r\n const startLength = Math.ceil(contentLength / 2);\r\n const endLength = Math.floor(contentLength / 2);\r\n\r\n return str.slice(0, startLength) + suffix + str.slice(-endLength);\r\n}\r\n\r\n/**\r\n * Truncate by word count\r\n *\r\n * @param str - String to truncate\r\n * @param wordCount - Maximum number of words\r\n * @param suffix - Suffix to append (default: '...')\r\n * @returns Truncated string\r\n *\r\n * @example\r\n * ```typescript\r\n * truncateWords('The quick brown fox jumps', 3); // 'The quick brown...'\r\n * ```\r\n */\r\nexport function truncateWords(\r\n str: string,\r\n wordCount: number,\r\n suffix: string = '...'\r\n): string {\r\n if (!str || typeof str !== 'string') return '';\r\n if (wordCount <= 0) return '';\r\n\r\n const words = str.trim().split(/\\s+/);\r\n if (words.length <= wordCount) return str;\r\n\r\n return words.slice(0, wordCount).join(' ') + suffix;\r\n}\r\n\r\n/**\r\n * Truncate by sentence count\r\n *\r\n * @param str - String to truncate\r\n * @param sentenceCount - Maximum number of sentences\r\n * @param suffix - Suffix to append (default: '')\r\n * @returns Truncated string\r\n *\r\n * @example\r\n * ```typescript\r\n * truncateSentences('Hello. World. Test.', 2); // 'Hello. World.'\r\n * ```\r\n */\r\nexport function truncateSentences(\r\n str: string,\r\n sentenceCount: number,\r\n suffix: string = ''\r\n): string {\r\n if (!str || typeof str !== 'string') return '';\r\n if (sentenceCount <= 0) return '';\r\n\r\n // Split by sentence-ending punctuation\r\n const sentences = str.match(/[^.!?]+[.!?]+/g) || [];\r\n if (sentences.length <= sentenceCount) return str;\r\n\r\n return sentences.slice(0, sentenceCount).join('').trim() + suffix;\r\n}\r\n\r\n/**\r\n * Truncate from middle, keeping file extension\r\n * Useful for file names\r\n *\r\n * @param filename - Filename to truncate\r\n * @param length - Maximum length\r\n * @param separator - Separator to use (default: '...')\r\n * @returns Truncated filename\r\n *\r\n * @example\r\n * ```typescript\r\n * truncateFilename('very_long_filename.pdf', 15); // 'very_l...me.pdf'\r\n * ```\r\n */\r\nexport function truncateFilename(\r\n filename: string,\r\n length: number,\r\n separator: string = '...'\r\n): string {\r\n if (!filename || typeof filename !== 'string') return '';\r\n if (filename.length <= length) return filename;\r\n\r\n const lastDot = filename.lastIndexOf('.');\r\n if (lastDot === -1 || lastDot === 0) {\r\n return truncateMiddle(filename, length, separator);\r\n }\r\n\r\n const name = filename.slice(0, lastDot);\r\n const ext = filename.slice(lastDot);\r\n\r\n // Reserve space for extension and separator\r\n const availableForName = length - ext.length - separator.length;\r\n if (availableForName <= 0) {\r\n return truncateMiddle(filename, length, separator);\r\n }\r\n\r\n const startLength = Math.ceil(availableForName / 2);\r\n const endLength = Math.floor(availableForName / 2);\r\n\r\n return name.slice(0, startLength) + separator + name.slice(-endLength) + ext;\r\n}\r\n\r\n/**\r\n * Ellipsis a string (alias for truncate with default options)\r\n *\r\n * @param str - String to ellipsis\r\n * @param length - Maximum length\r\n * @returns Ellipsized string\r\n */\r\nexport function ellipsis(str: string, length: number): string {\r\n return truncate(str, length, { suffix: '…', preserveWords: false });\r\n}\r\n\r\n/**\r\n * Smart truncate for HTML content (strips tags first)\r\n *\r\n * @param html - HTML string to truncate\r\n * @param length - Maximum length\r\n * @param suffix - Suffix to append\r\n * @returns Truncated text (no HTML)\r\n */\r\nexport function truncateHtml(\r\n html: string,\r\n length: number,\r\n suffix: string = '...'\r\n): string {\r\n if (!html || typeof html !== 'string') return '';\r\n\r\n // Strip HTML tags\r\n const text = html.replace(/<[^>]*>/g, ' ').replace(/\\s+/g, ' ').trim();\r\n\r\n return truncate(text, length, { suffix, preserveWords: true });\r\n}\r\n\r\n/**\r\n * Check if string needs truncation\r\n *\r\n * @param str - String to check\r\n * @param length - Maximum length\r\n * @returns true if string exceeds length\r\n */\r\nexport function needsTruncation(str: string, length: number): boolean {\r\n if (!str || typeof str !== 'string') return false;\r\n return str.length > length;\r\n}\r\n\r\n// ============== Grapheme-aware helpers ==============\r\n\r\n/**\r\n * Get the length of a string in grapheme clusters\r\n * Uses Intl.Segmenter if available, falls back to string length\r\n */\r\nfunction getGraphemeLength(str: string): number {\r\n if (!str) return 0;\r\n\r\n // Use Intl.Segmenter if available (modern browsers and Node 16+)\r\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\r\n const segmenter = new (Intl as any).Segmenter('en', { granularity: 'grapheme' });\r\n return [...segmenter.segment(str)].length;\r\n }\r\n\r\n // Fallback: count code points (not perfect for all emoji)\r\n return [...str].length;\r\n}\r\n\r\n/**\r\n * Slice a string by grapheme clusters\r\n */\r\nfunction sliceGraphemes(str: string, start: number, end?: number): string {\r\n if (!str) return '';\r\n\r\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\r\n const segmenter = new (Intl as any).Segmenter('en', { granularity: 'grapheme' });\r\n const segments = [...segmenter.segment(str)].map((s: any) => s.segment);\r\n return segments.slice(start, end).join('');\r\n }\r\n\r\n // Fallback: use spread operator for code points\r\n return [...str].slice(start, end).join('');\r\n}\r\n\r\n/**\r\n * Truncate at end with grapheme awareness\r\n */\r\nfunction truncateEndGrapheme(\r\n str: string,\r\n maxContentLength: number,\r\n suffix: string,\r\n preserveWords: boolean\r\n): string {\r\n let truncated = sliceGraphemes(str, 0, maxContentLength);\r\n\r\n if (preserveWords) {\r\n const lastSpace = truncated.lastIndexOf(' ');\r\n if (lastSpace > maxContentLength * 0.3) {\r\n truncated = truncated.slice(0, lastSpace);\r\n }\r\n }\r\n\r\n // Remove trailing punctuation and spaces\r\n truncated = truncated.replace(/[\\s.,!?;:]+$/, '');\r\n\r\n return truncated + suffix;\r\n}\r\n\r\n/**\r\n * Truncate at start with grapheme awareness\r\n */\r\nfunction truncateStartGrapheme(str: string, maxContentLength: number, suffix: string): string {\r\n const graphemeLength = getGraphemeLength(str);\r\n return suffix + sliceGraphemes(str, graphemeLength - maxContentLength);\r\n}\r\n\r\n/**\r\n * Truncate in middle with grapheme awareness\r\n */\r\nfunction truncateMiddleGrapheme(str: string, totalLength: number, suffix: string): string {\r\n const graphemeLength = getGraphemeLength(str);\r\n if (graphemeLength <= totalLength) return str;\r\n\r\n const suffixLength = getGraphemeLength(suffix);\r\n const contentLength = totalLength - suffixLength;\r\n if (contentLength <= 0) return sliceGraphemes(suffix, 0, totalLength);\r\n\r\n const startLength = Math.ceil(contentLength / 2);\r\n const endLength = Math.floor(contentLength / 2);\r\n\r\n return sliceGraphemes(str, 0, startLength) + suffix + sliceGraphemes(str, graphemeLength - endLength);\r\n}\r\n"]}
@@ -0,0 +1,479 @@
1
+ 'use strict';
2
+
3
+ // src/date/age.ts
4
+ function calculateAge(dob, referenceDate) {
5
+ const birthDate = typeof dob === "string" ? new Date(dob) : dob;
6
+ const refDate = referenceDate || /* @__PURE__ */ new Date();
7
+ if (isNaN(birthDate.getTime())) {
8
+ return { years: 0, months: 0, days: 0, totalDays: 0, isAdult: false, isSenior: false };
9
+ }
10
+ let years = refDate.getFullYear() - birthDate.getFullYear();
11
+ let months = refDate.getMonth() - birthDate.getMonth();
12
+ let days = refDate.getDate() - birthDate.getDate();
13
+ if (days < 0) {
14
+ months--;
15
+ const prevMonth = new Date(refDate.getFullYear(), refDate.getMonth(), 0);
16
+ days += prevMonth.getDate();
17
+ }
18
+ if (months < 0) {
19
+ years--;
20
+ months += 12;
21
+ }
22
+ const diffTime = Math.abs(refDate.getTime() - birthDate.getTime());
23
+ const totalDays = Math.floor(diffTime / (1e3 * 60 * 60 * 24));
24
+ return {
25
+ years,
26
+ months,
27
+ days,
28
+ totalDays,
29
+ isAdult: years >= 18,
30
+ isSenior: years >= 65
31
+ };
32
+ }
33
+ function getAgeInYears(dob) {
34
+ return calculateAge(dob).years;
35
+ }
36
+ function isAdult(dob, minAge = 18) {
37
+ return calculateAge(dob).years >= minAge;
38
+ }
39
+ function isMinor(dob, adultAge = 18) {
40
+ return calculateAge(dob).years < adultAge;
41
+ }
42
+ function getAgeBracket(dob) {
43
+ const { years } = calculateAge(dob);
44
+ if (years < 13) return "child";
45
+ if (years < 18) return "teenager";
46
+ if (years < 25) return "young-adult";
47
+ if (years < 40) return "adult";
48
+ if (years < 55) return "middle-aged";
49
+ if (years < 65) return "senior";
50
+ return "elderly";
51
+ }
52
+ function getMinAgeDOB(minAge) {
53
+ const today = /* @__PURE__ */ new Date();
54
+ return new Date(today.getFullYear() - minAge, today.getMonth(), today.getDate());
55
+ }
56
+ function isAgeInRange(dob, minAge, maxAge) {
57
+ const { years } = calculateAge(dob);
58
+ return years >= minAge && years <= maxAge;
59
+ }
60
+
61
+ // src/date/format.ts
62
+ function formatDateByLocale(date, locale = "en-US", options = {}) {
63
+ const d = typeof date === "string" ? new Date(date) : date;
64
+ if (isNaN(d.getTime())) {
65
+ return "";
66
+ }
67
+ const formatOptions = {};
68
+ if (options.dateStyle) {
69
+ formatOptions.dateStyle = options.dateStyle;
70
+ } else {
71
+ formatOptions.year = "numeric";
72
+ formatOptions.month = "long";
73
+ formatOptions.day = "numeric";
74
+ }
75
+ if (options.includeTime || options.timeStyle) {
76
+ if (options.timeStyle) {
77
+ formatOptions.timeStyle = options.timeStyle;
78
+ } else {
79
+ formatOptions.hour = "2-digit";
80
+ formatOptions.minute = "2-digit";
81
+ }
82
+ }
83
+ if (options.timeZone) {
84
+ formatOptions.timeZone = options.timeZone;
85
+ }
86
+ try {
87
+ return new Intl.DateTimeFormat(locale, formatOptions).format(d);
88
+ } catch {
89
+ return d.toLocaleDateString();
90
+ }
91
+ }
92
+ function formatRelativeTime(date, locale = "en-US", referenceDate) {
93
+ const d = typeof date === "string" ? new Date(date) : date;
94
+ const ref = referenceDate || /* @__PURE__ */ new Date();
95
+ if (isNaN(d.getTime())) {
96
+ return "";
97
+ }
98
+ const diffMs = d.getTime() - ref.getTime();
99
+ const diffSeconds = Math.round(diffMs / 1e3);
100
+ const diffMinutes = Math.round(diffSeconds / 60);
101
+ const diffHours = Math.round(diffMinutes / 60);
102
+ const diffDays = Math.round(diffHours / 24);
103
+ const diffWeeks = Math.round(diffDays / 7);
104
+ const diffMonths = Math.round(diffDays / 30);
105
+ const diffYears = Math.round(diffDays / 365);
106
+ try {
107
+ const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
108
+ if (Math.abs(diffSeconds) < 60) {
109
+ return rtf.format(diffSeconds, "second");
110
+ }
111
+ if (Math.abs(diffMinutes) < 60) {
112
+ return rtf.format(diffMinutes, "minute");
113
+ }
114
+ if (Math.abs(diffHours) < 24) {
115
+ return rtf.format(diffHours, "hour");
116
+ }
117
+ if (Math.abs(diffDays) < 7) {
118
+ return rtf.format(diffDays, "day");
119
+ }
120
+ if (Math.abs(diffWeeks) < 4) {
121
+ return rtf.format(diffWeeks, "week");
122
+ }
123
+ if (Math.abs(diffMonths) < 12) {
124
+ return rtf.format(diffMonths, "month");
125
+ }
126
+ return rtf.format(diffYears, "year");
127
+ } catch {
128
+ if (Math.abs(diffMinutes) < 60) {
129
+ return diffMinutes < 0 ? `${Math.abs(diffMinutes)} minutes ago` : `in ${diffMinutes} minutes`;
130
+ }
131
+ if (Math.abs(diffHours) < 24) {
132
+ return diffHours < 0 ? `${Math.abs(diffHours)} hours ago` : `in ${diffHours} hours`;
133
+ }
134
+ return diffDays < 0 ? `${Math.abs(diffDays)} days ago` : `in ${diffDays} days`;
135
+ }
136
+ }
137
+ function toISODate(date) {
138
+ const d = typeof date === "string" ? new Date(date) : date;
139
+ if (isNaN(d.getTime())) return "";
140
+ return d.toISOString().split("T")[0];
141
+ }
142
+ function formatDate(date, pattern) {
143
+ const d = typeof date === "string" ? new Date(date) : date;
144
+ if (isNaN(d.getTime())) return "";
145
+ const pad = (n) => n.toString().padStart(2, "0");
146
+ const tokens = {
147
+ "YYYY": d.getFullYear().toString(),
148
+ "YY": d.getFullYear().toString().slice(-2),
149
+ "MM": pad(d.getMonth() + 1),
150
+ "M": (d.getMonth() + 1).toString(),
151
+ "DD": pad(d.getDate()),
152
+ "D": d.getDate().toString(),
153
+ "HH": pad(d.getHours()),
154
+ "H": d.getHours().toString(),
155
+ "hh": pad(d.getHours() % 12 || 12),
156
+ "h": (d.getHours() % 12 || 12).toString(),
157
+ "mm": pad(d.getMinutes()),
158
+ "m": d.getMinutes().toString(),
159
+ "ss": pad(d.getSeconds()),
160
+ "s": d.getSeconds().toString(),
161
+ "A": d.getHours() >= 12 ? "PM" : "AM",
162
+ "a": d.getHours() >= 12 ? "pm" : "am"
163
+ };
164
+ let result = pattern;
165
+ for (const [token, value] of Object.entries(tokens)) {
166
+ result = result.replace(new RegExp(token, "g"), value);
167
+ }
168
+ return result;
169
+ }
170
+
171
+ // src/date/validate.ts
172
+ function isValidDate(date) {
173
+ if (date === null || date === void 0) return false;
174
+ if (date instanceof Date) {
175
+ return !isNaN(date.getTime());
176
+ }
177
+ if (typeof date === "string") {
178
+ const parsed = new Date(date);
179
+ return !isNaN(parsed.getTime());
180
+ }
181
+ if (typeof date === "number") {
182
+ const parsed = new Date(date);
183
+ return !isNaN(parsed.getTime());
184
+ }
185
+ return false;
186
+ }
187
+ function parseDate(value) {
188
+ if (value === null || value === void 0) return null;
189
+ if (value instanceof Date) {
190
+ return isNaN(value.getTime()) ? null : value;
191
+ }
192
+ if (typeof value === "number") {
193
+ const date = new Date(value);
194
+ return isNaN(date.getTime()) ? null : date;
195
+ }
196
+ if (typeof value === "string") {
197
+ const trimmed = value.trim();
198
+ if (!trimmed) return null;
199
+ let date = new Date(trimmed);
200
+ if (!isNaN(date.getTime())) return date;
201
+ const formats = [
202
+ // DD/MM/YYYY or DD-MM-YYYY or DD.MM.YYYY
203
+ {
204
+ regex: /^(\d{1,2})[\/\-\.](\d{1,2})[\/\-\.](\d{4})$/,
205
+ parser: (m) => new Date(parseInt(m[3]), parseInt(m[2]) - 1, parseInt(m[1]))
206
+ },
207
+ // YYYY/MM/DD or YYYY-MM-DD or YYYY.MM.DD (without time)
208
+ {
209
+ regex: /^(\d{4})[\/\-\.](\d{1,2})[\/\-\.](\d{1,2})$/,
210
+ parser: (m) => new Date(parseInt(m[1]), parseInt(m[2]) - 1, parseInt(m[3]))
211
+ },
212
+ // MM/DD/YYYY (US format)
213
+ {
214
+ regex: /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/,
215
+ parser: (m) => {
216
+ const first = parseInt(m[1]);
217
+ const second = parseInt(m[2]);
218
+ if (first > 12 && second <= 12) {
219
+ return new Date(parseInt(m[3]), second - 1, first);
220
+ }
221
+ return new Date(parseInt(m[3]), first - 1, second);
222
+ }
223
+ },
224
+ // DD MMM YYYY (e.g., 15 Jan 2024)
225
+ {
226
+ regex: /^(\d{1,2})\s+(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*\s+(\d{4})$/i,
227
+ parser: (m) => {
228
+ const months = {
229
+ jan: 0,
230
+ feb: 1,
231
+ mar: 2,
232
+ apr: 3,
233
+ may: 4,
234
+ jun: 5,
235
+ jul: 6,
236
+ aug: 7,
237
+ sep: 8,
238
+ oct: 9,
239
+ nov: 10,
240
+ dec: 11
241
+ };
242
+ return new Date(parseInt(m[3]), months[m[2].toLowerCase()], parseInt(m[1]));
243
+ }
244
+ },
245
+ // MMM DD, YYYY (e.g., Jan 15, 2024)
246
+ {
247
+ regex: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*\s+(\d{1,2}),?\s+(\d{4})$/i,
248
+ parser: (m) => {
249
+ const months = {
250
+ jan: 0,
251
+ feb: 1,
252
+ mar: 2,
253
+ apr: 3,
254
+ may: 4,
255
+ jun: 5,
256
+ jul: 6,
257
+ aug: 7,
258
+ sep: 8,
259
+ oct: 9,
260
+ nov: 10,
261
+ dec: 11
262
+ };
263
+ return new Date(parseInt(m[3]), months[m[1].toLowerCase()], parseInt(m[2]));
264
+ }
265
+ }
266
+ ];
267
+ for (const { regex, parser } of formats) {
268
+ const match = trimmed.match(regex);
269
+ if (match) {
270
+ date = parser(match);
271
+ if (!isNaN(date.getTime())) return date;
272
+ }
273
+ }
274
+ return null;
275
+ }
276
+ return null;
277
+ }
278
+ function isInPast(date) {
279
+ const d = typeof date === "string" ? new Date(date) : date;
280
+ if (isNaN(d.getTime())) return false;
281
+ return d.getTime() < Date.now();
282
+ }
283
+ function isInFuture(date) {
284
+ const d = typeof date === "string" ? new Date(date) : date;
285
+ if (isNaN(d.getTime())) return false;
286
+ return d.getTime() > Date.now();
287
+ }
288
+ function isToday(date) {
289
+ const d = typeof date === "string" ? new Date(date) : date;
290
+ if (isNaN(d.getTime())) return false;
291
+ const today = /* @__PURE__ */ new Date();
292
+ return d.getDate() === today.getDate() && d.getMonth() === today.getMonth() && d.getFullYear() === today.getFullYear();
293
+ }
294
+ function isWeekend(date) {
295
+ const d = typeof date === "string" ? new Date(date) : date;
296
+ if (isNaN(d.getTime())) return false;
297
+ const day = d.getDay();
298
+ return day === 0 || day === 6;
299
+ }
300
+ function isWeekday(date) {
301
+ return !isWeekend(date);
302
+ }
303
+ function isLeapYear(year) {
304
+ return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
305
+ }
306
+ function getDaysInMonth(year, month) {
307
+ return new Date(year, month, 0).getDate();
308
+ }
309
+ function isBetween(date, start, end, inclusive = true) {
310
+ const d = typeof date === "string" ? new Date(date) : date;
311
+ const s = typeof start === "string" ? new Date(start) : start;
312
+ const e = typeof end === "string" ? new Date(end) : end;
313
+ if (isNaN(d.getTime()) || isNaN(s.getTime()) || isNaN(e.getTime())) {
314
+ return false;
315
+ }
316
+ if (inclusive) {
317
+ return d >= s && d <= e;
318
+ }
319
+ return d > s && d < e;
320
+ }
321
+
322
+ // src/date/diff.ts
323
+ function getTimeDiff(date1, date2) {
324
+ const d1 = typeof date1 === "string" ? new Date(date1) : date1;
325
+ const d2 = date2 ? typeof date2 === "string" ? new Date(date2) : date2 : /* @__PURE__ */ new Date();
326
+ const diffMs = d2.getTime() - d1.getTime();
327
+ const isPast = diffMs > 0;
328
+ const absDiff = Math.abs(diffMs);
329
+ const totalSeconds = Math.floor(absDiff / 1e3);
330
+ const totalMinutes = Math.floor(totalSeconds / 60);
331
+ const totalHours = Math.floor(totalMinutes / 60);
332
+ const totalDays = Math.floor(totalHours / 24);
333
+ const seconds = totalSeconds % 60;
334
+ const minutes = totalMinutes % 60;
335
+ const hours = totalHours % 24;
336
+ const days = totalDays % 7;
337
+ const weeks = Math.floor(totalDays / 7) % 4;
338
+ const months = Math.floor(totalDays / 30) % 12;
339
+ const years = Math.floor(totalDays / 365);
340
+ return {
341
+ years,
342
+ months,
343
+ weeks,
344
+ days,
345
+ hours,
346
+ minutes,
347
+ seconds,
348
+ milliseconds: absDiff % 1e3,
349
+ totalDays,
350
+ totalHours,
351
+ totalMinutes,
352
+ totalSeconds,
353
+ totalMilliseconds: absDiff,
354
+ isPast
355
+ };
356
+ }
357
+ function diffIn(date1, date2, unit) {
358
+ const diff = getTimeDiff(date1, date2);
359
+ const sign = diff.isPast ? 1 : -1;
360
+ switch (unit) {
361
+ case "years":
362
+ return sign * diff.years;
363
+ case "months":
364
+ return sign * (diff.years * 12 + diff.months);
365
+ case "weeks":
366
+ return sign * Math.floor(diff.totalDays / 7);
367
+ case "days":
368
+ return sign * diff.totalDays;
369
+ case "hours":
370
+ return sign * diff.totalHours;
371
+ case "minutes":
372
+ return sign * diff.totalMinutes;
373
+ case "seconds":
374
+ return sign * diff.totalSeconds;
375
+ default:
376
+ return 0;
377
+ }
378
+ }
379
+ function addTime(date, amount, unit) {
380
+ const d = typeof date === "string" ? new Date(date) : new Date(date.getTime());
381
+ switch (unit) {
382
+ case "years":
383
+ d.setFullYear(d.getFullYear() + amount);
384
+ break;
385
+ case "months":
386
+ d.setMonth(d.getMonth() + amount);
387
+ break;
388
+ case "weeks":
389
+ d.setDate(d.getDate() + amount * 7);
390
+ break;
391
+ case "days":
392
+ d.setDate(d.getDate() + amount);
393
+ break;
394
+ case "hours":
395
+ d.setHours(d.getHours() + amount);
396
+ break;
397
+ case "minutes":
398
+ d.setMinutes(d.getMinutes() + amount);
399
+ break;
400
+ case "seconds":
401
+ d.setSeconds(d.getSeconds() + amount);
402
+ break;
403
+ }
404
+ return d;
405
+ }
406
+ function subtractTime(date, amount, unit) {
407
+ return addTime(date, -amount, unit);
408
+ }
409
+ function startOf(date, unit) {
410
+ const d = typeof date === "string" ? new Date(date) : new Date(date.getTime());
411
+ switch (unit) {
412
+ case "year":
413
+ return new Date(d.getFullYear(), 0, 1, 0, 0, 0, 0);
414
+ case "month":
415
+ return new Date(d.getFullYear(), d.getMonth(), 1, 0, 0, 0, 0);
416
+ case "week":
417
+ const day = d.getDay();
418
+ const diff = d.getDate() - day + (day === 0 ? -6 : 1);
419
+ return new Date(d.setDate(diff));
420
+ case "day":
421
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate(), 0, 0, 0, 0);
422
+ case "hour":
423
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), 0, 0, 0);
424
+ case "minute":
425
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), 0, 0);
426
+ default:
427
+ return d;
428
+ }
429
+ }
430
+ function endOf(date, unit) {
431
+ const d = typeof date === "string" ? new Date(date) : new Date(date.getTime());
432
+ switch (unit) {
433
+ case "year":
434
+ return new Date(d.getFullYear(), 11, 31, 23, 59, 59, 999);
435
+ case "month":
436
+ return new Date(d.getFullYear(), d.getMonth() + 1, 0, 23, 59, 59, 999);
437
+ case "week":
438
+ const start = startOf(d, "week");
439
+ return new Date(start.getTime() + 7 * 24 * 60 * 60 * 1e3 - 1);
440
+ case "day":
441
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate(), 23, 59, 59, 999);
442
+ case "hour":
443
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), 59, 59, 999);
444
+ case "minute":
445
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), 59, 999);
446
+ default:
447
+ return d;
448
+ }
449
+ }
450
+
451
+ exports.addTime = addTime;
452
+ exports.calculateAge = calculateAge;
453
+ exports.diffIn = diffIn;
454
+ exports.endOf = endOf;
455
+ exports.formatDate = formatDate;
456
+ exports.formatDateByLocale = formatDateByLocale;
457
+ exports.formatRelativeTime = formatRelativeTime;
458
+ exports.getAgeBracket = getAgeBracket;
459
+ exports.getAgeInYears = getAgeInYears;
460
+ exports.getDaysInMonth = getDaysInMonth;
461
+ exports.getMinAgeDOB = getMinAgeDOB;
462
+ exports.getTimeDiff = getTimeDiff;
463
+ exports.isAdult = isAdult;
464
+ exports.isAgeInRange = isAgeInRange;
465
+ exports.isBetween = isBetween;
466
+ exports.isInFuture = isInFuture;
467
+ exports.isInPast = isInPast;
468
+ exports.isLeapYear = isLeapYear;
469
+ exports.isMinor = isMinor;
470
+ exports.isToday = isToday;
471
+ exports.isValidDate = isValidDate;
472
+ exports.isWeekday = isWeekday;
473
+ exports.isWeekend = isWeekend;
474
+ exports.parseDate = parseDate;
475
+ exports.startOf = startOf;
476
+ exports.subtractTime = subtractTime;
477
+ exports.toISODate = toISODate;
478
+ //# sourceMappingURL=chunk-BZCMWUKS.cjs.map
479
+ //# sourceMappingURL=chunk-BZCMWUKS.cjs.map