@stryke/env 0.20.80 → 0.20.82

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/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  # Changelog for Stryke - Env
4
4
 
5
+ ## [0.20.82](https://github.com/storm-software/stryke/releases/tag/env%400.20.82) (04/06/2026)
6
+
7
+ ### Updated Dependencies
8
+
9
+ - Updated **string-format** to **v0.17.8**
10
+ - Updated **convert** to **v0.6.58**
11
+ - Updated **path** to **v0.27.4**
12
+ - Updated **fs** to **v0.33.65**
13
+
14
+ ## [0.20.81](https://github.com/storm-software/stryke/releases/tag/env%400.20.81) (03/23/2026)
15
+
16
+ ### Bug Fixes
17
+
18
+ - **monorepo:** Update all repository projects to resolve linting failures ([e9fb597b](https://github.com/storm-software/stryke/commit/e9fb597b))
19
+
20
+ ### Updated Dependencies
21
+
22
+ - Updated **string-format** to **v0.17.7**
23
+ - Updated **convert** to **v0.6.57**
24
+ - Updated **path** to **v0.27.3**
25
+ - Updated **fs** to **v0.33.64**
26
+
5
27
  ## [0.20.80](https://github.com/storm-software/stryke/releases/tag/env%400.20.80) (03/16/2026)
6
28
 
7
29
  ### Miscellaneous
@@ -1 +1 @@
1
- {"version":3,"file":"environment-checks.mjs","names":["mode"],"sources":["../src/environment-checks.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isCI } from \"./ci-checks\";\n\n/** Value of process.platform */\nexport const platform = process?.platform || \"\";\n\n/** Detect if stdout.TTY is available */\nexport const hasTTY = Boolean(process?.stdout && process?.stdout.isTTY);\n\n/** Detect if `DEBUG` environment variable is set */\nexport const isDebug = Boolean(process.env.DEBUG);\n\n/** Detect the `NODE_ENV` environment variable */\nconst mode =\n process.env.STORM_MODE ||\n process.env.NEXT_PUBLIC_VERCEL_ENV ||\n process.env.NODE_ENV ||\n \"production\";\n\n/** Detect if the application is running in a staging environment */\nexport const isStaging = [\"stg\", \"stage\", \"staging\"].includes(\n mode?.toLowerCase()\n);\n\n/**\n * Check if the current environment is production.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is production\n */\nexport function isProductionMode(mode: string) {\n return [\n \"prd\",\n \"prod\",\n \"production\",\n // eslint-disable-next-line @cspell/spellchecker\n \"preprod\",\n // eslint-disable-next-line @cspell/spellchecker\n \"preproduction\",\n \"uat\"\n ].includes(mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\"));\n}\n\n/** Detect if `NODE_ENV` environment variable is `production` */\nexport const isProduction = isProductionMode(mode);\n\n/**\n * Check if the current environment is test.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is test\n */\nexport function isTestMode(mode: string) {\n return [\n \"tst\",\n \"test\",\n \"testing\",\n \"stg\",\n \"stage\",\n \"staging\",\n \"qa\",\n // eslint-disable-next-line @cspell/spellchecker\n \"qualityassurance\"\n ].includes(mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\"));\n}\n\n/** Detect if `NODE_ENV` environment variable is `test` */\nexport const isTest =\n isTestMode(mode) || isStaging || Boolean(process.env.TEST);\n\n/**\n * Check if the current environment is development.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is development\n */\nexport function isDevelopmentMode(mode: string) {\n return [\"dev\", \"development\", \"int\", \"integration\"].includes(\n mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\")\n );\n}\n\n/** Detect if `NODE_ENV` environment variable is `dev` or `development` */\nexport const isDevelopment = isDevelopmentMode(mode) || isDebug;\n\n/** Detect if MINIMAL environment variable is set, running in CI or test or TTY is unavailable */\nexport const isMinimal =\n Boolean(process.env.MINIMAL) || isCI() || isTest || !hasTTY;\n\n/** Detect if process.platform is Windows */\nexport const isWindows = /^win/i.test(platform);\n\n/** Detect if process.platform is Linux */\nexport const isLinux = /^linux/i.test(platform);\n\n/** Detect if process.platform is macOS (darwin kernel) */\nexport const isMacOS = /^darwin/i.test(platform);\n\n/** Color Support */\nexport const isColorSupported =\n !process.env.NO_COLOR &&\n (Boolean(process.env.FORCE_COLOR) ||\n ((hasTTY || isWindows) && process.env.TERM !== \"dumb\") ||\n isCI());\n\nfunction parseVersion(versionString = \"\") {\n if (/^\\d{3,4}$/.test(versionString)) {\n const match = /(\\d{1,2})(\\d{2})/.exec(versionString) ?? [];\n\n return {\n major: 0,\n minor: Number.parseInt(match[1]!, 10),\n patch: Number.parseInt(match[2]!, 10)\n };\n }\n\n const versions = (versionString ?? \"\")\n .split(\".\")\n .map(n => Number.parseInt(n, 10));\n\n return {\n major: versions[0],\n minor: versions[1],\n patch: versions[2]\n };\n}\n\n/**\n * Check if the current environment supports hyperlinks in the terminal.\n *\n * @param stream - The stream to check for TTY support (default: process.stdout)\n * @returns Whether hyperlinks are supported\n */\nexport function isHyperlinkSupported(\n stream: NodeJS.WriteStream = process.stdout\n): boolean {\n if (process.env.FORCE_HYPERLINK) {\n return !(\n process.env.FORCE_HYPERLINK.length > 0 &&\n Number.parseInt(process.env.FORCE_HYPERLINK, 10) === 0\n );\n }\n\n // Netlify does not run a TTY, it does not need `supportsColor` check\n if (process.env.NETLIFY) {\n return true;\n } else if (!isColorSupported) {\n return false;\n } else if (stream && !stream.isTTY) {\n return false;\n } else if (\"WT_SESSION\" in process.env) {\n return true;\n } else if (process.platform === \"win32\") {\n return false;\n } else if (isCI()) {\n return false;\n } else if (process.env.TEAMCITY_VERSION) {\n return false;\n } else if (process.env.TERM_PROGRAM) {\n const version = parseVersion(process.env.TERM_PROGRAM_VERSION);\n\n switch (process.env.TERM_PROGRAM) {\n case \"iTerm.app\": {\n if (version.major === 3) {\n return version.minor !== undefined && version.minor >= 1;\n }\n\n return version.major !== undefined && version.major > 3;\n }\n case \"WezTerm\": {\n return version.major !== undefined && version.major >= 20_200_620;\n }\n case \"vscode\": {\n // Cursor forked VS Code and supports hyperlinks in 0.x.x\n if (process.env.CURSOR_TRACE_ID) {\n return true;\n }\n\n return (\n version.minor !== undefined &&\n version.major !== undefined &&\n (version.major > 1 || (version.major === 1 && version.minor >= 72))\n );\n }\n case \"ghostty\": {\n return true;\n }\n }\n }\n\n if (process.env.VTE_VERSION) {\n // 0.50.0 was supposed to support hyperlinks, but throws a segfault\n if (process.env.VTE_VERSION === \"0.50.0\") {\n return false;\n }\n\n const version = parseVersion(process.env.VTE_VERSION);\n\n return (\n (version.major !== undefined && version.major > 0) ||\n (version.minor !== undefined && version.minor >= 50)\n );\n }\n\n if (process.env.TERM === \"alacritty\") {\n return true;\n }\n\n return false;\n}\n\n/** Node.js versions */\nexport const nodeVersion =\n (process?.versions?.node || \"\").replace(/^v/, \"\") || null;\n\nexport const nodeMajorVersion = Number(nodeVersion?.split(\".\")[0]) || null;\n"],"mappings":";;;;AAqBA,MAAa,WAAW,SAAS,YAAY;;AAG7C,MAAa,SAAS,QAAQ,SAAS,UAAU,SAAS,OAAO,MAAM;;AAGvE,MAAa,UAAU,QAAQ,QAAQ,IAAI,MAAM;;AAGjD,MAAM,OACJ,QAAQ,IAAI,cACZ,QAAQ,IAAI,0BACZ,QAAQ,IAAI,YACZ;;AAGF,MAAa,YAAY;CAAC;CAAO;CAAS;CAAU,CAAC,SACnD,MAAM,aAAa,CACpB;;;;;;;AAQD,SAAgB,iBAAiB,QAAc;AAC7C,QAAO;EACL;EACA;EACA;EAEA;EAEA;EACA;EACD,CAAC,SAASA,QAAM,aAAa,EAAE,QAAQ,YAAY,GAAG,CAAC;;;AAI1D,MAAa,eAAe,iBAAiB,KAAK;;;;;;;AAQlD,SAAgB,WAAW,QAAc;AACvC,QA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G,KAAK;AAKzD,KAAI,QAAQ,IAAI,QACd,QAAO;UACE,CAAC,iBACV,QAAO;UACE,UAAU,CAAC,OAAO,MAC3B,QAAO;UACE,gBAAgB,QAAQ,IACjC,QAAO;UACE,QAAQ,aAAa,QAC9B,QAAO;UACE,MAAM,CACf,QAAO;UACE,QAAQ,IAAI,iBACrB,QAAO;UACE,QAAQ,IAAI,cAAc;EACnC,MAAM,UAAU,aAAa,QAAQ,IAAI,qBAAqB;AAE9D,UAAQ,QAAQ,IAAI,cAApB;GACE,KAAK;AACH,QAAI,QAAQ,UAAU,EACpB,QAAO,QAAQ,UAAU,UAAa,QAAQ,SAAS;AAGzD,WAAO,QAAQ,UAAU,UAAa,QAAQ,QAAQ;GAExD,KAAK,UACH,QAAO,QAAQ,UAAU,UAAa,QAAQ,SAAS;GAEzD,KAAK;AAEH,QAAI,QAAQ,IAAI,gBACd,QAAO;AAGT,WACE,QAAQ,UAAU,UAClB,QAAQ,UAAU,WACjB,QAAQ,QAAQ,KAAM,QAAQ,UAAU,KAAK,QAAQ,SAAS;GAGnE,KAAK,UACH,QAAO;;;AAKb,KAAI,QAAQ,IAAI,aAAa;AAE3B,MAAI,QAAQ,IAAI,gBAAgB,SAC9B,QAAO;EAGT,MAAM,UAAU,aAAa,QAAQ,IAAI,YAAY;AAErD,SACG,QAAQ,UAAU,UAAa,QAAQ,QAAQ,KAC/C,QAAQ,UAAU,UAAa,QAAQ,SAAS;;AAIrD,KAAI,QAAQ,IAAI,SAAS,YACvB,QAAO;AAGT,QAAO;;;AAIT,MAAa,eACV,SAAS,UAAU,QAAQ,IAAI,QAAQ,MAAM,GAAG,IAAI;AAEvD,MAAa,mBAAmB,OAAO,aAAa,MAAM,IAAI,CAAC,GAAG,IAAI"}
1
+ {"version":3,"file":"environment-checks.mjs","names":["mode"],"sources":["../src/environment-checks.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isCI } from \"./ci-checks\";\n\n/** Value of process.platform */\nexport const platform = process?.platform || \"\";\n\n/** Detect if stdout.TTY is available */\nexport const hasTTY = Boolean(process?.stdout && process?.stdout.isTTY);\n\n/** Detect if `DEBUG` environment variable is set */\nexport const isDebug = Boolean(process.env.DEBUG);\n\n/** Detect the `NODE_ENV` environment variable */\nconst mode =\n process.env.STORM_MODE ||\n process.env.NEXT_PUBLIC_VERCEL_ENV ||\n process.env.NODE_ENV ||\n \"production\";\n\n/** Detect if the application is running in a staging environment */\nexport const isStaging = [\"stg\", \"stage\", \"staging\"].includes(\n mode?.toLowerCase()\n);\n\n/**\n * Check if the current environment is production.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is production\n */\nexport function isProductionMode(mode: string) {\n return [\n \"prd\",\n \"prod\",\n \"production\",\n\n \"preprod\",\n\n \"preproduction\",\n \"uat\"\n ].includes(mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\"));\n}\n\n/** Detect if `NODE_ENV` environment variable is `production` */\nexport const isProduction = isProductionMode(mode);\n\n/**\n * Check if the current environment is test.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is test\n */\nexport function isTestMode(mode: string) {\n return [\n \"tst\",\n \"test\",\n \"testing\",\n \"stg\",\n \"stage\",\n \"staging\",\n \"qa\",\n\n \"qualityassurance\"\n ].includes(mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\"));\n}\n\n/** Detect if `NODE_ENV` environment variable is `test` */\nexport const isTest =\n isTestMode(mode) || isStaging || Boolean(process.env.TEST);\n\n/**\n * Check if the current environment is development.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is development\n */\nexport function isDevelopmentMode(mode: string) {\n return [\"dev\", \"development\", \"int\", \"integration\"].includes(\n mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\")\n );\n}\n\n/** Detect if `NODE_ENV` environment variable is `dev` or `development` */\nexport const isDevelopment = isDevelopmentMode(mode) || isDebug;\n\n/** Detect if MINIMAL environment variable is set, running in CI or test or TTY is unavailable */\nexport const isMinimal =\n Boolean(process.env.MINIMAL) || isCI() || isTest || !hasTTY;\n\n/** Detect if process.platform is Windows */\nexport const isWindows = /^win/i.test(platform);\n\n/** Detect if process.platform is Linux */\nexport const isLinux = /^linux/i.test(platform);\n\n/** Detect if process.platform is macOS (darwin kernel) */\nexport const isMacOS = /^darwin/i.test(platform);\n\n/** Color Support */\nexport const isColorSupported =\n !process.env.NO_COLOR &&\n (Boolean(process.env.FORCE_COLOR) ||\n ((hasTTY || isWindows) && process.env.TERM !== \"dumb\") ||\n isCI());\n\nfunction parseVersion(versionString = \"\") {\n if (/^\\d{3,4}$/.test(versionString)) {\n const match = /(\\d{1,2})(\\d{2})/.exec(versionString) ?? [];\n\n return {\n major: 0,\n minor: Number.parseInt(match[1]!, 10),\n patch: Number.parseInt(match[2]!, 10)\n };\n }\n\n const versions = (versionString ?? \"\")\n .split(\".\")\n .map(n => Number.parseInt(n, 10));\n\n return {\n major: versions[0],\n minor: versions[1],\n patch: versions[2]\n };\n}\n\n/**\n * Check if the current environment supports hyperlinks in the terminal.\n *\n * @param stream - The stream to check for TTY support (default: process.stdout)\n * @returns Whether hyperlinks are supported\n */\nexport function isHyperlinkSupported(\n stream: NodeJS.WriteStream = process.stdout\n): boolean {\n if (process.env.FORCE_HYPERLINK) {\n return !(\n process.env.FORCE_HYPERLINK.length > 0 &&\n Number.parseInt(process.env.FORCE_HYPERLINK, 10) === 0\n );\n }\n\n // Netlify does not run a TTY, it does not need `supportsColor` check\n if (process.env.NETLIFY) {\n return true;\n } else if (!isColorSupported) {\n return false;\n } else if (stream && !stream.isTTY) {\n return false;\n } else if (\"WT_SESSION\" in process.env) {\n return true;\n } else if (process.platform === \"win32\") {\n return false;\n } else if (isCI()) {\n return false;\n } else if (process.env.TEAMCITY_VERSION) {\n return false;\n } else if (process.env.TERM_PROGRAM) {\n const version = parseVersion(process.env.TERM_PROGRAM_VERSION);\n\n switch (process.env.TERM_PROGRAM) {\n case \"iTerm.app\": {\n if (version.major === 3) {\n return version.minor !== undefined && version.minor >= 1;\n }\n\n return version.major !== undefined && version.major > 3;\n }\n case \"WezTerm\": {\n return version.major !== undefined && version.major >= 20_200_620;\n }\n case \"vscode\": {\n // Cursor forked VS Code and supports hyperlinks in 0.x.x\n if (process.env.CURSOR_TRACE_ID) {\n return true;\n }\n\n return (\n version.minor !== undefined &&\n version.major !== undefined &&\n (version.major > 1 || (version.major === 1 && version.minor >= 72))\n );\n }\n case \"ghostty\": {\n return true;\n }\n }\n }\n\n if (process.env.VTE_VERSION) {\n // 0.50.0 was supposed to support hyperlinks, but throws a segfault\n if (process.env.VTE_VERSION === \"0.50.0\") {\n return false;\n }\n\n const version = parseVersion(process.env.VTE_VERSION);\n\n return (\n (version.major !== undefined && version.major > 0) ||\n (version.minor !== undefined && version.minor >= 50)\n );\n }\n\n if (process.env.TERM === \"alacritty\") {\n return true;\n }\n\n return false;\n}\n\n/** Node.js versions */\nexport const nodeVersion =\n (process?.versions?.node || \"\").replace(/^v/, \"\") || null;\n\nexport const nodeMajorVersion = Number(nodeVersion?.split(\".\")[0]) || null;\n"],"mappings":";;;;AAqBA,MAAa,WAAW,SAAS,YAAY;;AAG7C,MAAa,SAAS,QAAQ,SAAS,UAAU,SAAS,OAAO,MAAM;;AAGvE,MAAa,UAAU,QAAQ,QAAQ,IAAI,MAAM;;AAGjD,MAAM,OACJ,QAAQ,IAAI,cACZ,QAAQ,IAAI,0BACZ,QAAQ,IAAI,YACZ;;AAGF,MAAa,YAAY;CAAC;CAAO;CAAS;CAAU,CAAC,SACnD,MAAM,aAAa,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GAAG,IAAI;AAEvD,MAAa,mBAAmB,OAAO,aAAa,MAAM,IAAI,CAAC,GAAG,IAAI"}
@@ -13,7 +13,7 @@ const require_upper_case_first = require('./upper-case-first.cjs');
13
13
  * @returns The title cased string.
14
14
  */
15
15
  function titleCase(input, options) {
16
- return input?.split(/\s+-\s+/).map((segment) => require_decamelize.decamelize(segment).split(/[\s\-_]/).map(require_upper_case_first.upperCaseFirst).map((value) => options?.expandAcronyms ? require_acronyms.ACRONYMS[value]?.description || value : value).map((value, index, array) => require_format_special_cases.formatSpecialCases(value, index, array, options)).reduce(require_combine.combine)).join(" - ");
16
+ return input?.split(/(\s+-\s+|\s*:\s*)/).map((segment) => require_decamelize.decamelize(segment).split(/[\s\-_]/).map(require_upper_case_first.upperCaseFirst).map((value) => options?.expandAcronyms ? require_acronyms.ACRONYMS[value]?.description || value : value).map((value, index, array) => require_format_special_cases.formatSpecialCases(value, index, array, options)).reduce(require_combine.combine)).join(" - ");
17
17
  }
18
18
 
19
19
  //#endregion
@@ -13,7 +13,7 @@ import { upperCaseFirst } from "./upper-case-first.mjs";
13
13
  * @returns The title cased string.
14
14
  */
15
15
  function titleCase(input, options) {
16
- return input?.split(/\s+-\s+/).map((segment) => decamelize(segment).split(/[\s\-_]/).map(upperCaseFirst).map((value) => options?.expandAcronyms ? ACRONYMS[value]?.description || value : value).map((value, index, array) => formatSpecialCases(value, index, array, options)).reduce(combine)).join(" - ");
16
+ return input?.split(/(\s+-\s+|\s*:\s*)/).map((segment) => decamelize(segment).split(/[\s\-_]/).map(upperCaseFirst).map((value) => options?.expandAcronyms ? ACRONYMS[value]?.description || value : value).map((value, index, array) => formatSpecialCases(value, index, array, options)).reduce(combine)).join(" - ");
17
17
  }
18
18
 
19
19
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"title-case.mjs","names":[],"sources":["../../../../string-format/src/title-case.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ACRONYMS } from \"./acronyms\";\nimport { combine } from \"./combine\";\nimport { decamelize } from \"./decamelize\";\nimport type { FormatSpecialCasesOptions } from \"./format-special-cases\";\nimport { formatSpecialCases } from \"./format-special-cases\";\nimport { upperCaseFirst } from \"./upper-case-first\";\n\nexport interface TitleCaseOptions extends FormatSpecialCasesOptions {\n /**\n * Whether to expand acronyms in the input string.\n *\n * @remarks\n * If true, acronyms will be expanded to their full form before being converted to title case. For example, \"NASA\" would be expanded to \"National Aeronautics and Space Administration\".\n *\n * @defaultValue false\n */\n expandAcronyms?: boolean;\n}\n\n/**\n * Convert a string to title case.\n *\n * @param input - The input string to convert.\n * @param options - Options for formatting special cases.\n * @returns The title cased string.\n */\nexport function titleCase<T extends string | undefined>(\n input: T,\n options?: TitleCaseOptions\n): T {\n return input\n ?.split(/\\s+-\\s+/)\n .map(segment =>\n decamelize(segment)\n .split(/[\\s\\-_]/)\n .map(upperCaseFirst)\n .map(value =>\n options?.expandAcronyms\n ? ACRONYMS[value]?.description || value\n : value\n )\n .map((value: string, index: number, array: string[]) =>\n formatSpecialCases(value, index, array, options)\n )\n .reduce(combine)\n )\n .join(\" - \") as T;\n}\n"],"mappings":";;;;;;;;;;;;;;AA4CA,SAAgB,UACd,OACA,SACG;AACH,QAAO,OACH,MAAM,UAAU,CACjB,KAAI,YACH,WAAW,QAAQ,CAChB,MAAM,UAAU,CAChB,IAAI,eAAe,CACnB,KAAI,UACH,SAAS,iBACL,SAAS,QAAQ,eAAe,QAChC,MACL,CACA,KAAK,OAAe,OAAe,UAClC,mBAAmB,OAAO,OAAO,OAAO,QAAQ,CACjD,CACA,OAAO,QAAQ,CACnB,CACA,KAAK,MAAM"}
1
+ {"version":3,"file":"title-case.mjs","names":[],"sources":["../../../../string-format/src/title-case.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ACRONYMS } from \"./acronyms\";\nimport { combine } from \"./combine\";\nimport { decamelize } from \"./decamelize\";\nimport type { FormatSpecialCasesOptions } from \"./format-special-cases\";\nimport { formatSpecialCases } from \"./format-special-cases\";\nimport { upperCaseFirst } from \"./upper-case-first\";\n\nexport interface TitleCaseOptions extends FormatSpecialCasesOptions {\n /**\n * Whether to expand acronyms in the input string.\n *\n * @remarks\n * If true, acronyms will be expanded to their full form before being converted to title case. For example, \"NASA\" would be expanded to \"National Aeronautics and Space Administration\".\n *\n * @defaultValue false\n */\n expandAcronyms?: boolean;\n}\n\n/**\n * Convert a string to title case.\n *\n * @param input - The input string to convert.\n * @param options - Options for formatting special cases.\n * @returns The title cased string.\n */\nexport function titleCase<T extends string | undefined>(\n input: T,\n options?: TitleCaseOptions\n): T {\n return input\n ?.split(/(\\s+-\\s+|\\s*:\\s*)/)\n .map(segment =>\n decamelize(segment)\n .split(/[\\s\\-_]/)\n .map(upperCaseFirst)\n .map(value =>\n options?.expandAcronyms\n ? ACRONYMS[value]?.description || value\n : value\n )\n .map((value: string, index: number, array: string[]) =>\n formatSpecialCases(value, index, array, options)\n )\n .reduce(combine)\n )\n .join(\" - \") as T;\n}\n"],"mappings":";;;;;;;;;;;;;;AA4CA,SAAgB,UACd,OACA,SACG;AACH,QAAO,OACH,MAAM,oBAAoB,CAC3B,KAAI,YACH,WAAW,QAAQ,CAChB,MAAM,UAAU,CAChB,IAAI,eAAe,CACnB,KAAI,UACH,SAAS,iBACL,SAAS,QAAQ,eAAe,QAChC,MACL,CACA,KAAK,OAAe,OAAe,UAClC,mBAAmB,OAAO,OAAO,OAAO,QAAQ,CACjD,CACA,OAAO,QAAQ,CACnB,CACA,KAAK,MAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/env",
3
- "version": "0.20.80",
3
+ "version": "0.20.82",
4
4
  "private": false,
5
5
  "description": "A package containing utility functions to handle environment specific processes",
6
6
  "repository": {
@@ -43,13 +43,13 @@
43
43
  "types": "./dist/index.d.cts",
44
44
  "dependencies": {
45
45
  "@dotenvx/dotenvx": "1.35.0",
46
- "@stryke/convert": "^0.6.56",
47
- "@stryke/fs": "^0.33.63",
48
- "@stryke/path": "^0.27.2",
49
- "@stryke/string-format": "^0.17.6",
50
- "defu": "^6.1.4"
46
+ "@stryke/convert": "^0.6.58",
47
+ "@stryke/fs": "^0.33.65",
48
+ "@stryke/path": "^0.27.4",
49
+ "@stryke/string-format": "^0.17.8",
50
+ "defu": "^6.1.6"
51
51
  },
52
- "devDependencies": { "@types/node": "^24.12.0", "tsdown": "^0.17.2" },
52
+ "devDependencies": { "@types/node": "^24.12.2", "tsdown": "^0.17.2" },
53
53
  "publishConfig": { "access": "public" },
54
- "gitHead": "cbabce3e772514cdc47c10a3b8bae3cc0ad16191"
54
+ "gitHead": "f0f6e2fadb52ddf2679e7b98b5f79f94c9d56090"
55
55
  }