@stryke/env 0.20.48 → 0.20.50

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 (77) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/_virtual/rolldown_runtime.cjs +29 -1
  3. package/dist/ci-checks.cjs +23 -1
  4. package/dist/ci-checks.mjs +21 -1
  5. package/dist/ci-checks.mjs.map +1 -1
  6. package/dist/convert/src/to-array.cjs +15 -1
  7. package/dist/convert/src/to-array.mjs +14 -1
  8. package/dist/convert/src/to-array.mjs.map +1 -1
  9. package/dist/environment-checks.cjs +156 -1
  10. package/dist/environment-checks.mjs +139 -1
  11. package/dist/environment-checks.mjs.map +1 -1
  12. package/dist/fs/src/exists.cjs +17 -1
  13. package/dist/fs/src/exists.mjs +15 -1
  14. package/dist/fs/src/exists.mjs.map +1 -1
  15. package/dist/fs/src/read-file.cjs +17 -1
  16. package/dist/fs/src/read-file.mjs +16 -1
  17. package/dist/fs/src/read-file.mjs.map +1 -1
  18. package/dist/get-env-paths.cjs +87 -1
  19. package/dist/get-env-paths.mjs +84 -1
  20. package/dist/get-env-paths.mjs.map +1 -1
  21. package/dist/index.cjs +48 -1
  22. package/dist/index.mjs +9 -1
  23. package/dist/load-env.cjs +124 -1
  24. package/dist/load-env.mjs +118 -1
  25. package/dist/load-env.mjs.map +1 -1
  26. package/dist/path/src/is-type.cjs +28 -1
  27. package/dist/path/src/is-type.mjs +28 -1
  28. package/dist/path/src/is-type.mjs.map +1 -1
  29. package/dist/path/src/join-paths.cjs +106 -1
  30. package/dist/path/src/join-paths.mjs +106 -1
  31. package/dist/path/src/join-paths.mjs.map +1 -1
  32. package/dist/path/src/regex.cjs +12 -1
  33. package/dist/path/src/regex.mjs +8 -1
  34. package/dist/path/src/regex.mjs.map +1 -1
  35. package/dist/path/src/slash.cjs +15 -1
  36. package/dist/path/src/slash.mjs +14 -1
  37. package/dist/path/src/slash.mjs.map +1 -1
  38. package/dist/providers.cjs +112 -1
  39. package/dist/providers.mjs +110 -1
  40. package/dist/providers.mjs.map +1 -1
  41. package/dist/runtime-checks.cjs +71 -1
  42. package/dist/runtime-checks.mjs +60 -1
  43. package/dist/runtime-checks.mjs.map +1 -1
  44. package/dist/string-format/src/acronyms.cjs +408 -1
  45. package/dist/string-format/src/acronyms.mjs +407 -1
  46. package/dist/string-format/src/acronyms.mjs.map +1 -1
  47. package/dist/string-format/src/articles.cjs +10 -1
  48. package/dist/string-format/src/articles.mjs +9 -1
  49. package/dist/string-format/src/articles.mjs.map +1 -1
  50. package/dist/string-format/src/combine.cjs +15 -1
  51. package/dist/string-format/src/combine.mjs +14 -1
  52. package/dist/string-format/src/combine.mjs.map +1 -1
  53. package/dist/string-format/src/conjunctions.cjs +32 -1
  54. package/dist/string-format/src/conjunctions.mjs +31 -1
  55. package/dist/string-format/src/conjunctions.mjs.map +1 -1
  56. package/dist/string-format/src/decamelize.cjs +14 -1
  57. package/dist/string-format/src/decamelize.mjs +13 -1
  58. package/dist/string-format/src/decamelize.mjs.map +1 -1
  59. package/dist/string-format/src/format-special-cases.cjs +33 -1
  60. package/dist/string-format/src/format-special-cases.mjs +33 -1
  61. package/dist/string-format/src/format-special-cases.mjs.map +1 -1
  62. package/dist/string-format/src/prepositions.cjs +68 -1
  63. package/dist/string-format/src/prepositions.mjs +67 -1
  64. package/dist/string-format/src/prepositions.mjs.map +1 -1
  65. package/dist/string-format/src/special-cases.cjs +53 -1
  66. package/dist/string-format/src/special-cases.mjs +52 -1
  67. package/dist/string-format/src/special-cases.mjs.map +1 -1
  68. package/dist/string-format/src/title-case.cjs +19 -1
  69. package/dist/string-format/src/title-case.mjs +19 -1
  70. package/dist/string-format/src/title-case.mjs.map +1 -1
  71. package/dist/string-format/src/upper-case-first.cjs +17 -1
  72. package/dist/string-format/src/upper-case-first.mjs +16 -1
  73. package/dist/string-format/src/upper-case-first.mjs.map +1 -1
  74. package/dist/types.cjs +13 -1
  75. package/dist/types.mjs +12 -1
  76. package/dist/types.mjs.map +1 -1
  77. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  # Changelog for Stryke - Env
4
4
 
5
+ ## [0.20.49](https://github.com/storm-software/stryke/releases/tag/env%400.20.49) (01/16/2026)
6
+
7
+ ### Updated Dependencies
8
+
9
+ - Updated **path** to **v0.25.0**
10
+ - Updated **fs** to **v0.33.32**
11
+
12
+ ## [0.20.48](https://github.com/storm-software/stryke/releases/tag/env%400.20.48) (01/16/2026)
13
+
14
+ ### Updated Dependencies
15
+
16
+ - Updated **string-format** to **v0.13.2**
17
+ - Updated **convert** to **v0.6.33**
18
+ - Updated **path** to **v0.24.4**
19
+ - Updated **fs** to **v0.33.31**
20
+
5
21
  ## [0.20.47](https://github.com/storm-software/stryke/releases/tag/env%400.20.47) (01/15/2026)
6
22
 
7
23
  ### Updated Dependencies
@@ -1 +1,29 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
@@ -1 +1,23 @@
1
- const e=(e=process.env)=>!!(e.STORM_CI||e.CI||e.CONTINUOUS_INTEGRATION||e.BUILD_NUMBER||e.RUN_ID||e.AGOLA_GIT_REF||e.AC_APPCIRCLE||e.APPVEYOR||e.CODEBUILD||e.TF_BUILD||e.bamboo_planKey||e.BITBUCKET_COMMIT||e.BITRISE_IO||e.BUDDY_WORKSPACE_ID||e.BUILDKITE||e.CIRCLECI||e.CIRRUS_CI||e.CF_BUILD_ID||e.CM_BUILD_ID||e.CI_NAME||e.DRONE||e.DSARI||e.EARTHLY_CI||e.EAS_BUILD||e.GERRIT_PROJECT||e.GITEA_ACTIONS||e.GITHUB_ACTIONS||e.GITLAB_CI||e.GOCD||e.BUILDER_OUTPUT||e.HARNESS_BUILD_ID||e.JENKINS_URL||e.BUILD_ID||e.LAYERCI||e.MAGNUM||e.NETLIFY||e.NEVERCODE||e.PROW_JOB_ID||e.RELEASE_BUILD_ID||e.RENDER||e.SAILCI||e.HUDSON||e.JENKINS_URL||e.BUILD_ID||e.SCREWDRIVER||e.SEMAPHORE||e.SOURCEHUT||e.STRIDER||e.TASK_ID||e.RUN_ID||e.TEAMCITY_VERSION||e.TRAVIS||e.VELA||e.NOW_BUILDER||e.APPCENTER_BUILD_ID||e.CI_XCODE_PROJECT||e.XCS),t=(e=process.stdin)=>!!(e?.isTTY&&process.env.TERM!==`dumb`);exports.isCI=e,exports.isInteractive=t;
1
+
2
+ //#region src/ci-checks.ts
3
+ /**
4
+ * Returns true if the current environment is a CI environment.
5
+ *
6
+ * @returns True if the current environment is a CI environment.
7
+ */
8
+ const isCI = (env = process.env) => {
9
+ return Boolean(env.STORM_CI || env.CI || env.CONTINUOUS_INTEGRATION || env.BUILD_NUMBER || env.RUN_ID || env.AGOLA_GIT_REF || env.AC_APPCIRCLE || env.APPVEYOR || env.CODEBUILD || env.TF_BUILD || env.bamboo_planKey || env.BITBUCKET_COMMIT || env.BITRISE_IO || env.BUDDY_WORKSPACE_ID || env.BUILDKITE || env.CIRCLECI || env.CIRRUS_CI || env.CF_BUILD_ID || env.CM_BUILD_ID || env.CI_NAME || env.DRONE || env.DSARI || env.EARTHLY_CI || env.EAS_BUILD || env.GERRIT_PROJECT || env.GITEA_ACTIONS || env.GITHUB_ACTIONS || env.GITLAB_CI || env.GOCD || env.BUILDER_OUTPUT || env.HARNESS_BUILD_ID || env.JENKINS_URL || env.BUILD_ID || env.LAYERCI || env.MAGNUM || env.NETLIFY || env.NEVERCODE || env.PROW_JOB_ID || env.RELEASE_BUILD_ID || env.RENDER || env.SAILCI || env.HUDSON || env.JENKINS_URL || env.BUILD_ID || env.SCREWDRIVER || env.SEMAPHORE || env.SOURCEHUT || env.STRIDER || env.TASK_ID || env.RUN_ID || env.TEAMCITY_VERSION || env.TRAVIS || env.VELA || env.NOW_BUILDER || env.APPCENTER_BUILD_ID || env.CI_XCODE_PROJECT || env.XCS || false);
10
+ };
11
+ /**
12
+ * Check if the current process is interactive
13
+ *
14
+ * @param stream - The stream to check
15
+ * @returns True if the current process is interactive
16
+ */
17
+ const isInteractive = (stream = process.stdin) => {
18
+ return Boolean(stream?.isTTY && process.env.TERM !== "dumb");
19
+ };
20
+
21
+ //#endregion
22
+ exports.isCI = isCI;
23
+ exports.isInteractive = isInteractive;
@@ -1,2 +1,22 @@
1
- const e=(e=process.env)=>!!(e.STORM_CI||e.CI||e.CONTINUOUS_INTEGRATION||e.BUILD_NUMBER||e.RUN_ID||e.AGOLA_GIT_REF||e.AC_APPCIRCLE||e.APPVEYOR||e.CODEBUILD||e.TF_BUILD||e.bamboo_planKey||e.BITBUCKET_COMMIT||e.BITRISE_IO||e.BUDDY_WORKSPACE_ID||e.BUILDKITE||e.CIRCLECI||e.CIRRUS_CI||e.CF_BUILD_ID||e.CM_BUILD_ID||e.CI_NAME||e.DRONE||e.DSARI||e.EARTHLY_CI||e.EAS_BUILD||e.GERRIT_PROJECT||e.GITEA_ACTIONS||e.GITHUB_ACTIONS||e.GITLAB_CI||e.GOCD||e.BUILDER_OUTPUT||e.HARNESS_BUILD_ID||e.JENKINS_URL||e.BUILD_ID||e.LAYERCI||e.MAGNUM||e.NETLIFY||e.NEVERCODE||e.PROW_JOB_ID||e.RELEASE_BUILD_ID||e.RENDER||e.SAILCI||e.HUDSON||e.JENKINS_URL||e.BUILD_ID||e.SCREWDRIVER||e.SEMAPHORE||e.SOURCEHUT||e.STRIDER||e.TASK_ID||e.RUN_ID||e.TEAMCITY_VERSION||e.TRAVIS||e.VELA||e.NOW_BUILDER||e.APPCENTER_BUILD_ID||e.CI_XCODE_PROJECT||e.XCS),t=(e=process.stdin)=>!!(e?.isTTY&&process.env.TERM!==`dumb`);export{e as isCI,t as isInteractive};
1
+ //#region src/ci-checks.ts
2
+ /**
3
+ * Returns true if the current environment is a CI environment.
4
+ *
5
+ * @returns True if the current environment is a CI environment.
6
+ */
7
+ const isCI = (env = process.env) => {
8
+ return Boolean(env.STORM_CI || env.CI || env.CONTINUOUS_INTEGRATION || env.BUILD_NUMBER || env.RUN_ID || env.AGOLA_GIT_REF || env.AC_APPCIRCLE || env.APPVEYOR || env.CODEBUILD || env.TF_BUILD || env.bamboo_planKey || env.BITBUCKET_COMMIT || env.BITRISE_IO || env.BUDDY_WORKSPACE_ID || env.BUILDKITE || env.CIRCLECI || env.CIRRUS_CI || env.CF_BUILD_ID || env.CM_BUILD_ID || env.CI_NAME || env.DRONE || env.DSARI || env.EARTHLY_CI || env.EAS_BUILD || env.GERRIT_PROJECT || env.GITEA_ACTIONS || env.GITHUB_ACTIONS || env.GITLAB_CI || env.GOCD || env.BUILDER_OUTPUT || env.HARNESS_BUILD_ID || env.JENKINS_URL || env.BUILD_ID || env.LAYERCI || env.MAGNUM || env.NETLIFY || env.NEVERCODE || env.PROW_JOB_ID || env.RELEASE_BUILD_ID || env.RENDER || env.SAILCI || env.HUDSON || env.JENKINS_URL || env.BUILD_ID || env.SCREWDRIVER || env.SEMAPHORE || env.SOURCEHUT || env.STRIDER || env.TASK_ID || env.RUN_ID || env.TEAMCITY_VERSION || env.TRAVIS || env.VELA || env.NOW_BUILDER || env.APPCENTER_BUILD_ID || env.CI_XCODE_PROJECT || env.XCS || false);
9
+ };
10
+ /**
11
+ * Check if the current process is interactive
12
+ *
13
+ * @param stream - The stream to check
14
+ * @returns True if the current process is interactive
15
+ */
16
+ const isInteractive = (stream = process.stdin) => {
17
+ return Boolean(stream?.isTTY && process.env.TERM !== "dumb");
18
+ };
19
+
20
+ //#endregion
21
+ export { isCI, isInteractive };
2
22
  //# sourceMappingURL=ci-checks.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ci-checks.mjs","names":[],"sources":["../src/ci-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\n/**\n * Returns true if the current environment is a CI environment.\n *\n * @returns True if the current environment is a CI environment.\n */\nexport const isCI = (\n env: Record<string, string | undefined> = process.env\n): boolean => {\n // From https://github.com/watson/ci-info/blob/44e98cebcdf4403f162195fbcf90b1f69fc6e047/index.js#L54-L61\n // Evaluating at runtime makes it possible to change the values in our tests\n // This list is probably not exhaustive though `process.env.CI` should be enough\n // but since we were using this utility in the past, we want to keep the same behavior\n return Boolean(\n env.STORM_CI || // Custom CI\n env.CI || // Travis CI, CircleCI, Cirrus CI, GitLab CI, Appveyor, CodeShip, dsari\n env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI\n env.BUILD_NUMBER || // Jenkins, TeamCity\n env.RUN_ID || // TaskCluster, dsari\n // From `env` from v4.0.0 https://github.com/watson/ci-info/blob/3e1488e98680f1f776785fe8708a157b7f00e568/vendors.json\n env.AGOLA_GIT_REF ||\n env.AC_APPCIRCLE ||\n env.APPVEYOR ||\n env.CODEBUILD ||\n env.TF_BUILD ||\n env.bamboo_planKey ||\n env.BITBUCKET_COMMIT ||\n env.BITRISE_IO ||\n env.BUDDY_WORKSPACE_ID ||\n env.BUILDKITE ||\n env.CIRCLECI ||\n env.CIRRUS_CI ||\n env.CF_BUILD_ID ||\n env.CM_BUILD_ID ||\n env.CI_NAME ||\n env.DRONE ||\n env.DSARI ||\n env.EARTHLY_CI ||\n env.EAS_BUILD ||\n env.GERRIT_PROJECT ||\n env.GITEA_ACTIONS ||\n env.GITHUB_ACTIONS ||\n env.GITLAB_CI ||\n env.GOCD ||\n env.BUILDER_OUTPUT ||\n env.HARNESS_BUILD_ID ||\n env.JENKINS_URL ||\n env.BUILD_ID ||\n env.LAYERCI ||\n env.MAGNUM ||\n env.NETLIFY ||\n env.NEVERCODE ||\n env.PROW_JOB_ID ||\n env.RELEASE_BUILD_ID ||\n env.RENDER ||\n env.SAILCI ||\n env.HUDSON ||\n env.JENKINS_URL ||\n env.BUILD_ID ||\n env.SCREWDRIVER ||\n env.SEMAPHORE ||\n env.SOURCEHUT ||\n env.STRIDER ||\n env.TASK_ID ||\n env.RUN_ID ||\n env.TEAMCITY_VERSION ||\n env.TRAVIS ||\n env.VELA ||\n env.NOW_BUILDER ||\n // See https://github.com/prisma/prisma/issues/22380 for why we commented it out\n // Users deploying on Vercel might have this env var set in the local dev env\n // env.VERCEL ||\n env.APPCENTER_BUILD_ID ||\n env.CI_XCODE_PROJECT ||\n env.XCS ||\n false\n );\n};\n\n// Same logic as https://github.com/sindresorhus/is-interactive/blob/dc8037ae1a61d828cfb42761c345404055b1e036/index.js\n// But defaults to check `stdin` for our prompts\n// It checks that the stream is TTY, not a dumb terminal\n\n/**\n * Check if the current process is interactive\n *\n * @param stream - The stream to check\n * @returns True if the current process is interactive\n */\nexport const isInteractive = (stream = process.stdin): boolean => {\n return Boolean(stream?.isTTY && process.env.TERM !== \"dumb\");\n};\n"],"mappings":"AAuBA,MAAa,GACX,EAA0C,QAAQ,MAM3C,GACL,EAAI,UACJ,EAAI,IACJ,EAAI,wBACJ,EAAI,cACJ,EAAI,QAEJ,EAAI,eACJ,EAAI,cACJ,EAAI,UACJ,EAAI,WACJ,EAAI,UACJ,EAAI,gBACJ,EAAI,kBACJ,EAAI,YACJ,EAAI,oBACJ,EAAI,WACJ,EAAI,UACJ,EAAI,WACJ,EAAI,aACJ,EAAI,aACJ,EAAI,SACJ,EAAI,OACJ,EAAI,OACJ,EAAI,YACJ,EAAI,WACJ,EAAI,gBACJ,EAAI,eACJ,EAAI,gBACJ,EAAI,WACJ,EAAI,MACJ,EAAI,gBACJ,EAAI,kBACJ,EAAI,aACJ,EAAI,UACJ,EAAI,SACJ,EAAI,QACJ,EAAI,SACJ,EAAI,WACJ,EAAI,aACJ,EAAI,kBACJ,EAAI,QACJ,EAAI,QACJ,EAAI,QACJ,EAAI,aACJ,EAAI,UACJ,EAAI,aACJ,EAAI,WACJ,EAAI,WACJ,EAAI,SACJ,EAAI,SACJ,EAAI,QACJ,EAAI,kBACJ,EAAI,QACJ,EAAI,MACJ,EAAI,aAIJ,EAAI,oBACJ,EAAI,kBACJ,EAAI,KAeK,GAAiB,EAAS,QAAQ,QACtC,GAAQ,GAAQ,OAAS,QAAQ,IAAI,OAAS"}
1
+ {"version":3,"file":"ci-checks.mjs","names":[],"sources":["../src/ci-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\n/**\n * Returns true if the current environment is a CI environment.\n *\n * @returns True if the current environment is a CI environment.\n */\nexport const isCI = (\n env: Record<string, string | undefined> = process.env\n): boolean => {\n // From https://github.com/watson/ci-info/blob/44e98cebcdf4403f162195fbcf90b1f69fc6e047/index.js#L54-L61\n // Evaluating at runtime makes it possible to change the values in our tests\n // This list is probably not exhaustive though `process.env.CI` should be enough\n // but since we were using this utility in the past, we want to keep the same behavior\n return Boolean(\n env.STORM_CI || // Custom CI\n env.CI || // Travis CI, CircleCI, Cirrus CI, GitLab CI, Appveyor, CodeShip, dsari\n env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI\n env.BUILD_NUMBER || // Jenkins, TeamCity\n env.RUN_ID || // TaskCluster, dsari\n // From `env` from v4.0.0 https://github.com/watson/ci-info/blob/3e1488e98680f1f776785fe8708a157b7f00e568/vendors.json\n env.AGOLA_GIT_REF ||\n env.AC_APPCIRCLE ||\n env.APPVEYOR ||\n env.CODEBUILD ||\n env.TF_BUILD ||\n env.bamboo_planKey ||\n env.BITBUCKET_COMMIT ||\n env.BITRISE_IO ||\n env.BUDDY_WORKSPACE_ID ||\n env.BUILDKITE ||\n env.CIRCLECI ||\n env.CIRRUS_CI ||\n env.CF_BUILD_ID ||\n env.CM_BUILD_ID ||\n env.CI_NAME ||\n env.DRONE ||\n env.DSARI ||\n env.EARTHLY_CI ||\n env.EAS_BUILD ||\n env.GERRIT_PROJECT ||\n env.GITEA_ACTIONS ||\n env.GITHUB_ACTIONS ||\n env.GITLAB_CI ||\n env.GOCD ||\n env.BUILDER_OUTPUT ||\n env.HARNESS_BUILD_ID ||\n env.JENKINS_URL ||\n env.BUILD_ID ||\n env.LAYERCI ||\n env.MAGNUM ||\n env.NETLIFY ||\n env.NEVERCODE ||\n env.PROW_JOB_ID ||\n env.RELEASE_BUILD_ID ||\n env.RENDER ||\n env.SAILCI ||\n env.HUDSON ||\n env.JENKINS_URL ||\n env.BUILD_ID ||\n env.SCREWDRIVER ||\n env.SEMAPHORE ||\n env.SOURCEHUT ||\n env.STRIDER ||\n env.TASK_ID ||\n env.RUN_ID ||\n env.TEAMCITY_VERSION ||\n env.TRAVIS ||\n env.VELA ||\n env.NOW_BUILDER ||\n // See https://github.com/prisma/prisma/issues/22380 for why we commented it out\n // Users deploying on Vercel might have this env var set in the local dev env\n // env.VERCEL ||\n env.APPCENTER_BUILD_ID ||\n env.CI_XCODE_PROJECT ||\n env.XCS ||\n false\n );\n};\n\n// Same logic as https://github.com/sindresorhus/is-interactive/blob/dc8037ae1a61d828cfb42761c345404055b1e036/index.js\n// But defaults to check `stdin` for our prompts\n// It checks that the stream is TTY, not a dumb terminal\n\n/**\n * Check if the current process is interactive\n *\n * @param stream - The stream to check\n * @returns True if the current process is interactive\n */\nexport const isInteractive = (stream = process.stdin): boolean => {\n return Boolean(stream?.isTTY && process.env.TERM !== \"dumb\");\n};\n"],"mappings":";;;;;;AAuBA,MAAa,QACX,MAA0C,QAAQ,QACtC;AAKZ,QAAO,QACL,IAAI,YACJ,IAAI,MACJ,IAAI,0BACJ,IAAI,gBACJ,IAAI,UAEJ,IAAI,iBACJ,IAAI,gBACJ,IAAI,YACJ,IAAI,aACJ,IAAI,YACJ,IAAI,kBACJ,IAAI,oBACJ,IAAI,cACJ,IAAI,sBACJ,IAAI,aACJ,IAAI,YACJ,IAAI,aACJ,IAAI,eACJ,IAAI,eACJ,IAAI,WACJ,IAAI,SACJ,IAAI,SACJ,IAAI,cACJ,IAAI,aACJ,IAAI,kBACJ,IAAI,iBACJ,IAAI,kBACJ,IAAI,aACJ,IAAI,QACJ,IAAI,kBACJ,IAAI,oBACJ,IAAI,eACJ,IAAI,YACJ,IAAI,WACJ,IAAI,UACJ,IAAI,WACJ,IAAI,aACJ,IAAI,eACJ,IAAI,oBACJ,IAAI,UACJ,IAAI,UACJ,IAAI,UACJ,IAAI,eACJ,IAAI,YACJ,IAAI,eACJ,IAAI,aACJ,IAAI,aACJ,IAAI,WACJ,IAAI,WACJ,IAAI,UACJ,IAAI,oBACJ,IAAI,UACJ,IAAI,QACJ,IAAI,eAIJ,IAAI,sBACJ,IAAI,oBACJ,IAAI,OACJ,MACD;;;;;;;;AAaH,MAAa,iBAAiB,SAAS,QAAQ,UAAmB;AAChE,QAAO,QAAQ,QAAQ,SAAS,QAAQ,IAAI,SAAS,OAAO"}
@@ -1 +1,15 @@
1
- function e(e){return e??=[],Array.isArray(e)?e:[e]}exports.toArray=e;
1
+
2
+ //#region ../convert/src/to-array.ts
3
+ /**
4
+ * Convert `Arrayable<T>` to `Array<T>`
5
+ *
6
+ * @param array - The `Arrayable<T>` to convert
7
+ * @returns An `Array<T>` containing the elements of the input
8
+ */
9
+ function toArray(array) {
10
+ array = array ?? [];
11
+ return Array.isArray(array) ? array : [array];
12
+ }
13
+
14
+ //#endregion
15
+ exports.toArray = toArray;
@@ -1,2 +1,15 @@
1
- function e(e){return e??=[],Array.isArray(e)?e:[e]}export{e as toArray};
1
+ //#region ../convert/src/to-array.ts
2
+ /**
3
+ * Convert `Arrayable<T>` to `Array<T>`
4
+ *
5
+ * @param array - The `Arrayable<T>` to convert
6
+ * @returns An `Array<T>` containing the elements of the input
7
+ */
8
+ function toArray(array) {
9
+ array = array ?? [];
10
+ return Array.isArray(array) ? array : [array];
11
+ }
12
+
13
+ //#endregion
14
+ export { toArray };
2
15
  //# sourceMappingURL=to-array.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"to-array.mjs","names":[],"sources":["../../../../convert/src/to-array.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 type { Arrayable } from \"@stryke/types/array\";\nimport type { Nullable } from \"@stryke/types/utilities\";\n\n/**\n * Convert `Arrayable<T>` to `Array<T>`\n *\n * @param array - The `Arrayable<T>` to convert\n * @returns An `Array<T>` containing the elements of the input\n */\nexport function toArray<T>(array?: Nullable<Arrayable<T>>): Array<T> {\n array = array ?? [];\n return Array.isArray(array) ? array : [array];\n}\n"],"mappings":"AA2BA,SAAgB,EAAW,EAA0C,CAEnE,MADA,KAAiB,EAAE,CACZ,MAAM,QAAQ,EAAM,CAAG,EAAQ,CAAC,EAAM"}
1
+ {"version":3,"file":"to-array.mjs","names":[],"sources":["../../../../convert/src/to-array.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 type { Arrayable } from \"@stryke/types/array\";\nimport type { Nullable } from \"@stryke/types/utilities\";\n\n/**\n * Convert `Arrayable<T>` to `Array<T>`\n *\n * @param array - The `Arrayable<T>` to convert\n * @returns An `Array<T>` containing the elements of the input\n */\nexport function toArray<T>(array?: Nullable<Arrayable<T>>): Array<T> {\n array = array ?? [];\n return Array.isArray(array) ? array : [array];\n}\n"],"mappings":";;;;;;;AA2BA,SAAgB,QAAW,OAA0C;AACnE,SAAQ,SAAS,EAAE;AACnB,QAAO,MAAM,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM"}
@@ -1 +1,156 @@
1
- const e=require(`./ci-checks.cjs`),t=process?.platform||``,n=!!(process?.stdout&&process?.stdout.isTTY),r=!!process.env.DEBUG,i=process.env.STORM_MODE||process.env.NEXT_PUBLIC_VERCEL_ENV||process.env.NODE_ENV||`production`,a=[`stg`,`stage`,`staging`].includes(i?.toLowerCase());function o(e){return[`prd`,`prod`,`production`,`preprod`,`preproduction`,`uat`].includes(e?.toLowerCase()?.replace(/[\s\-_]/g,``))}const s=o(i);function c(e){return[`tst`,`test`,`testing`,`stg`,`stage`,`staging`,`qa`,`qualityassurance`].includes(e?.toLowerCase()?.replace(/[\s\-_]/g,``))}const l=c(i)||a||!!process.env.TEST;function u(e){return[`dev`,`development`,`int`,`integration`].includes(e?.toLowerCase()?.replace(/[\s\-_]/g,``))}const d=u(i)||r,f=!!process.env.MINIMAL||e.isCI()||l||!n,p=/^win/i.test(t),m=/^linux/i.test(t),h=/^darwin/i.test(t),g=!process.env.NO_COLOR&&(!!process.env.FORCE_COLOR||(n||p)&&process.env.TERM!==`dumb`||e.isCI());function _(e=``){if(/^\d{3,4}$/.test(e)){let t=/(\d{1,2})(\d{2})/.exec(e)??[];return{major:0,minor:Number.parseInt(t[1],10),patch:Number.parseInt(t[2],10)}}let t=(e??``).split(`.`).map(e=>Number.parseInt(e,10));return{major:t[0],minor:t[1],patch:t[2]}}function v(t=process.stdout){if(process.env.FORCE_HYPERLINK)return!(process.env.FORCE_HYPERLINK.length>0&&Number.parseInt(process.env.FORCE_HYPERLINK,10)===0);if(process.env.NETLIFY)return!0;if(g){if(t&&!t.isTTY)return!1;if(`WT_SESSION`in process.env)return!0;if(process.platform===`win32`||e.isCI()||process.env.TEAMCITY_VERSION)return!1;if(process.env.TERM_PROGRAM){let e=_(process.env.TERM_PROGRAM_VERSION);switch(process.env.TERM_PROGRAM){case`iTerm.app`:return e.major===3?e.minor!==void 0&&e.minor>=1:e.major!==void 0&&e.major>3;case`WezTerm`:return e.major!==void 0&&e.major>=20200620;case`vscode`:return process.env.CURSOR_TRACE_ID?!0:e.minor!==void 0&&e.major!==void 0&&(e.major>1||e.major===1&&e.minor>=72);case`ghostty`:return!0}}}else return!1;if(process.env.VTE_VERSION){if(process.env.VTE_VERSION===`0.50.0`)return!1;let e=_(process.env.VTE_VERSION);return e.major!==void 0&&e.major>0||e.minor!==void 0&&e.minor>=50}return process.env.TERM===`alacritty`}const y=(process?.versions?.node||``).replace(/^v/,``)||null,b=Number(y?.split(`.`)[0])||null;exports.hasTTY=n,exports.isColorSupported=g,exports.isDebug=r,exports.isDevelopment=d,exports.isDevelopmentMode=u,exports.isHyperlinkSupported=v,exports.isLinux=m,exports.isMacOS=h,exports.isMinimal=f,exports.isProduction=s,exports.isProductionMode=o,exports.isStaging=a,exports.isTest=l,exports.isTestMode=c,exports.isWindows=p,exports.nodeMajorVersion=b,exports.nodeVersion=y,exports.platform=t;
1
+ const require_ci_checks = require('./ci-checks.cjs');
2
+
3
+ //#region src/environment-checks.ts
4
+ /** Value of process.platform */
5
+ const platform = process?.platform || "";
6
+ /** Detect if stdout.TTY is available */
7
+ const hasTTY = Boolean(process?.stdout && process?.stdout.isTTY);
8
+ /** Detect if `DEBUG` environment variable is set */
9
+ const isDebug = Boolean(process.env.DEBUG);
10
+ /** Detect the `NODE_ENV` environment variable */
11
+ const mode = process.env.STORM_MODE || process.env.NEXT_PUBLIC_VERCEL_ENV || process.env.NODE_ENV || "production";
12
+ /** Detect if the application is running in a staging environment */
13
+ const isStaging = [
14
+ "stg",
15
+ "stage",
16
+ "staging"
17
+ ].includes(mode?.toLowerCase());
18
+ /**
19
+ * Check if the current environment is production.
20
+ *
21
+ * @param mode - The mode string to check.
22
+ * @returns Whether the environment is production
23
+ */
24
+ function isProductionMode(mode$1) {
25
+ return [
26
+ "prd",
27
+ "prod",
28
+ "production",
29
+ "preprod",
30
+ "preproduction",
31
+ "uat"
32
+ ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
33
+ }
34
+ /** Detect if `NODE_ENV` environment variable is `production` */
35
+ const isProduction = isProductionMode(mode);
36
+ /**
37
+ * Check if the current environment is test.
38
+ *
39
+ * @param mode - The mode string to check.
40
+ * @returns Whether the environment is test
41
+ */
42
+ function isTestMode(mode$1) {
43
+ return [
44
+ "tst",
45
+ "test",
46
+ "testing",
47
+ "stg",
48
+ "stage",
49
+ "staging",
50
+ "qa",
51
+ "qualityassurance"
52
+ ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
53
+ }
54
+ /** Detect if `NODE_ENV` environment variable is `test` */
55
+ const isTest = isTestMode(mode) || isStaging || Boolean(process.env.TEST);
56
+ /**
57
+ * Check if the current environment is development.
58
+ *
59
+ * @param mode - The mode string to check.
60
+ * @returns Whether the environment is development
61
+ */
62
+ function isDevelopmentMode(mode$1) {
63
+ return [
64
+ "dev",
65
+ "development",
66
+ "int",
67
+ "integration"
68
+ ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
69
+ }
70
+ /** Detect if `NODE_ENV` environment variable is `dev` or `development` */
71
+ const isDevelopment = isDevelopmentMode(mode) || isDebug;
72
+ /** Detect if MINIMAL environment variable is set, running in CI or test or TTY is unavailable */
73
+ const isMinimal = Boolean(process.env.MINIMAL) || require_ci_checks.isCI() || isTest || !hasTTY;
74
+ /** Detect if process.platform is Windows */
75
+ const isWindows = /^win/i.test(platform);
76
+ /** Detect if process.platform is Linux */
77
+ const isLinux = /^linux/i.test(platform);
78
+ /** Detect if process.platform is macOS (darwin kernel) */
79
+ const isMacOS = /^darwin/i.test(platform);
80
+ /** Color Support */
81
+ const isColorSupported = !process.env.NO_COLOR && (Boolean(process.env.FORCE_COLOR) || (hasTTY || isWindows) && process.env.TERM !== "dumb" || require_ci_checks.isCI());
82
+ function parseVersion(versionString = "") {
83
+ if (/^\d{3,4}$/.test(versionString)) {
84
+ const match = /(\d{1,2})(\d{2})/.exec(versionString) ?? [];
85
+ return {
86
+ major: 0,
87
+ minor: Number.parseInt(match[1], 10),
88
+ patch: Number.parseInt(match[2], 10)
89
+ };
90
+ }
91
+ const versions = (versionString ?? "").split(".").map((n) => Number.parseInt(n, 10));
92
+ return {
93
+ major: versions[0],
94
+ minor: versions[1],
95
+ patch: versions[2]
96
+ };
97
+ }
98
+ /**
99
+ * Check if the current environment supports hyperlinks in the terminal.
100
+ *
101
+ * @param stream - The stream to check for TTY support (default: process.stdout)
102
+ * @returns Whether hyperlinks are supported
103
+ */
104
+ function isHyperlinkSupported(stream = process.stdout) {
105
+ if (process.env.FORCE_HYPERLINK) return !(process.env.FORCE_HYPERLINK.length > 0 && Number.parseInt(process.env.FORCE_HYPERLINK, 10) === 0);
106
+ if (process.env.NETLIFY) return true;
107
+ else if (!isColorSupported) return false;
108
+ else if (stream && !stream.isTTY) return false;
109
+ else if ("WT_SESSION" in process.env) return true;
110
+ else if (process.platform === "win32") return false;
111
+ else if (require_ci_checks.isCI()) return false;
112
+ else if (process.env.TEAMCITY_VERSION) return false;
113
+ else if (process.env.TERM_PROGRAM) {
114
+ const version = parseVersion(process.env.TERM_PROGRAM_VERSION);
115
+ switch (process.env.TERM_PROGRAM) {
116
+ case "iTerm.app":
117
+ if (version.major === 3) return version.minor !== void 0 && version.minor >= 1;
118
+ return version.major !== void 0 && version.major > 3;
119
+ case "WezTerm": return version.major !== void 0 && version.major >= 20200620;
120
+ case "vscode":
121
+ if (process.env.CURSOR_TRACE_ID) return true;
122
+ return version.minor !== void 0 && version.major !== void 0 && (version.major > 1 || version.major === 1 && version.minor >= 72);
123
+ case "ghostty": return true;
124
+ }
125
+ }
126
+ if (process.env.VTE_VERSION) {
127
+ if (process.env.VTE_VERSION === "0.50.0") return false;
128
+ const version = parseVersion(process.env.VTE_VERSION);
129
+ return version.major !== void 0 && version.major > 0 || version.minor !== void 0 && version.minor >= 50;
130
+ }
131
+ if (process.env.TERM === "alacritty") return true;
132
+ return false;
133
+ }
134
+ /** Node.js versions */
135
+ const nodeVersion = (process?.versions?.node || "").replace(/^v/, "") || null;
136
+ const nodeMajorVersion = Number(nodeVersion?.split(".")[0]) || null;
137
+
138
+ //#endregion
139
+ exports.hasTTY = hasTTY;
140
+ exports.isColorSupported = isColorSupported;
141
+ exports.isDebug = isDebug;
142
+ exports.isDevelopment = isDevelopment;
143
+ exports.isDevelopmentMode = isDevelopmentMode;
144
+ exports.isHyperlinkSupported = isHyperlinkSupported;
145
+ exports.isLinux = isLinux;
146
+ exports.isMacOS = isMacOS;
147
+ exports.isMinimal = isMinimal;
148
+ exports.isProduction = isProduction;
149
+ exports.isProductionMode = isProductionMode;
150
+ exports.isStaging = isStaging;
151
+ exports.isTest = isTest;
152
+ exports.isTestMode = isTestMode;
153
+ exports.isWindows = isWindows;
154
+ exports.nodeMajorVersion = nodeMajorVersion;
155
+ exports.nodeVersion = nodeVersion;
156
+ exports.platform = platform;
@@ -1,2 +1,140 @@
1
- import{isCI as e}from"./ci-checks.mjs";const t=process?.platform||``,n=!!(process?.stdout&&process?.stdout.isTTY),r=!!process.env.DEBUG,i=process.env.STORM_MODE||process.env.NEXT_PUBLIC_VERCEL_ENV||process.env.NODE_ENV||`production`,a=[`stg`,`stage`,`staging`].includes(i?.toLowerCase());function o(e){return[`prd`,`prod`,`production`,`preprod`,`preproduction`,`uat`].includes(e?.toLowerCase()?.replace(/[\s\-_]/g,``))}const s=o(i);function c(e){return[`tst`,`test`,`testing`,`stg`,`stage`,`staging`,`qa`,`qualityassurance`].includes(e?.toLowerCase()?.replace(/[\s\-_]/g,``))}const l=c(i)||a||!!process.env.TEST;function u(e){return[`dev`,`development`,`int`,`integration`].includes(e?.toLowerCase()?.replace(/[\s\-_]/g,``))}const d=u(i)||r,f=!!process.env.MINIMAL||e()||l||!n,p=/^win/i.test(t),m=/^linux/i.test(t),h=/^darwin/i.test(t),g=!process.env.NO_COLOR&&(!!process.env.FORCE_COLOR||(n||p)&&process.env.TERM!==`dumb`||e());function _(e=``){if(/^\d{3,4}$/.test(e)){let t=/(\d{1,2})(\d{2})/.exec(e)??[];return{major:0,minor:Number.parseInt(t[1],10),patch:Number.parseInt(t[2],10)}}let t=(e??``).split(`.`).map(e=>Number.parseInt(e,10));return{major:t[0],minor:t[1],patch:t[2]}}function v(t=process.stdout){if(process.env.FORCE_HYPERLINK)return!(process.env.FORCE_HYPERLINK.length>0&&Number.parseInt(process.env.FORCE_HYPERLINK,10)===0);if(process.env.NETLIFY)return!0;if(g){if(t&&!t.isTTY)return!1;if(`WT_SESSION`in process.env)return!0;if(process.platform===`win32`||e()||process.env.TEAMCITY_VERSION)return!1;if(process.env.TERM_PROGRAM){let e=_(process.env.TERM_PROGRAM_VERSION);switch(process.env.TERM_PROGRAM){case`iTerm.app`:return e.major===3?e.minor!==void 0&&e.minor>=1:e.major!==void 0&&e.major>3;case`WezTerm`:return e.major!==void 0&&e.major>=20200620;case`vscode`:return process.env.CURSOR_TRACE_ID?!0:e.minor!==void 0&&e.major!==void 0&&(e.major>1||e.major===1&&e.minor>=72);case`ghostty`:return!0}}}else return!1;if(process.env.VTE_VERSION){if(process.env.VTE_VERSION===`0.50.0`)return!1;let e=_(process.env.VTE_VERSION);return e.major!==void 0&&e.major>0||e.minor!==void 0&&e.minor>=50}return process.env.TERM===`alacritty`}const y=(process?.versions?.node||``).replace(/^v/,``)||null,b=Number(y?.split(`.`)[0])||null;export{n as hasTTY,g as isColorSupported,r as isDebug,d as isDevelopment,u as isDevelopmentMode,v as isHyperlinkSupported,m as isLinux,h as isMacOS,f as isMinimal,s as isProduction,o as isProductionMode,a as isStaging,l as isTest,c as isTestMode,p as isWindows,b as nodeMajorVersion,y as nodeVersion,t as platform};
1
+ import { isCI } from "./ci-checks.mjs";
2
+
3
+ //#region src/environment-checks.ts
4
+ /** Value of process.platform */
5
+ const platform = process?.platform || "";
6
+ /** Detect if stdout.TTY is available */
7
+ const hasTTY = Boolean(process?.stdout && process?.stdout.isTTY);
8
+ /** Detect if `DEBUG` environment variable is set */
9
+ const isDebug = Boolean(process.env.DEBUG);
10
+ /** Detect the `NODE_ENV` environment variable */
11
+ const mode = process.env.STORM_MODE || process.env.NEXT_PUBLIC_VERCEL_ENV || process.env.NODE_ENV || "production";
12
+ /** Detect if the application is running in a staging environment */
13
+ const isStaging = [
14
+ "stg",
15
+ "stage",
16
+ "staging"
17
+ ].includes(mode?.toLowerCase());
18
+ /**
19
+ * Check if the current environment is production.
20
+ *
21
+ * @param mode - The mode string to check.
22
+ * @returns Whether the environment is production
23
+ */
24
+ function isProductionMode(mode$1) {
25
+ return [
26
+ "prd",
27
+ "prod",
28
+ "production",
29
+ "preprod",
30
+ "preproduction",
31
+ "uat"
32
+ ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
33
+ }
34
+ /** Detect if `NODE_ENV` environment variable is `production` */
35
+ const isProduction = isProductionMode(mode);
36
+ /**
37
+ * Check if the current environment is test.
38
+ *
39
+ * @param mode - The mode string to check.
40
+ * @returns Whether the environment is test
41
+ */
42
+ function isTestMode(mode$1) {
43
+ return [
44
+ "tst",
45
+ "test",
46
+ "testing",
47
+ "stg",
48
+ "stage",
49
+ "staging",
50
+ "qa",
51
+ "qualityassurance"
52
+ ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
53
+ }
54
+ /** Detect if `NODE_ENV` environment variable is `test` */
55
+ const isTest = isTestMode(mode) || isStaging || Boolean(process.env.TEST);
56
+ /**
57
+ * Check if the current environment is development.
58
+ *
59
+ * @param mode - The mode string to check.
60
+ * @returns Whether the environment is development
61
+ */
62
+ function isDevelopmentMode(mode$1) {
63
+ return [
64
+ "dev",
65
+ "development",
66
+ "int",
67
+ "integration"
68
+ ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
69
+ }
70
+ /** Detect if `NODE_ENV` environment variable is `dev` or `development` */
71
+ const isDevelopment = isDevelopmentMode(mode) || isDebug;
72
+ /** Detect if MINIMAL environment variable is set, running in CI or test or TTY is unavailable */
73
+ const isMinimal = Boolean(process.env.MINIMAL) || isCI() || isTest || !hasTTY;
74
+ /** Detect if process.platform is Windows */
75
+ const isWindows = /^win/i.test(platform);
76
+ /** Detect if process.platform is Linux */
77
+ const isLinux = /^linux/i.test(platform);
78
+ /** Detect if process.platform is macOS (darwin kernel) */
79
+ const isMacOS = /^darwin/i.test(platform);
80
+ /** Color Support */
81
+ const isColorSupported = !process.env.NO_COLOR && (Boolean(process.env.FORCE_COLOR) || (hasTTY || isWindows) && process.env.TERM !== "dumb" || isCI());
82
+ function parseVersion(versionString = "") {
83
+ if (/^\d{3,4}$/.test(versionString)) {
84
+ const match = /(\d{1,2})(\d{2})/.exec(versionString) ?? [];
85
+ return {
86
+ major: 0,
87
+ minor: Number.parseInt(match[1], 10),
88
+ patch: Number.parseInt(match[2], 10)
89
+ };
90
+ }
91
+ const versions = (versionString ?? "").split(".").map((n) => Number.parseInt(n, 10));
92
+ return {
93
+ major: versions[0],
94
+ minor: versions[1],
95
+ patch: versions[2]
96
+ };
97
+ }
98
+ /**
99
+ * Check if the current environment supports hyperlinks in the terminal.
100
+ *
101
+ * @param stream - The stream to check for TTY support (default: process.stdout)
102
+ * @returns Whether hyperlinks are supported
103
+ */
104
+ function isHyperlinkSupported(stream = process.stdout) {
105
+ if (process.env.FORCE_HYPERLINK) return !(process.env.FORCE_HYPERLINK.length > 0 && Number.parseInt(process.env.FORCE_HYPERLINK, 10) === 0);
106
+ if (process.env.NETLIFY) return true;
107
+ else if (!isColorSupported) return false;
108
+ else if (stream && !stream.isTTY) return false;
109
+ else if ("WT_SESSION" in process.env) return true;
110
+ else if (process.platform === "win32") return false;
111
+ else if (isCI()) return false;
112
+ else if (process.env.TEAMCITY_VERSION) return false;
113
+ else if (process.env.TERM_PROGRAM) {
114
+ const version = parseVersion(process.env.TERM_PROGRAM_VERSION);
115
+ switch (process.env.TERM_PROGRAM) {
116
+ case "iTerm.app":
117
+ if (version.major === 3) return version.minor !== void 0 && version.minor >= 1;
118
+ return version.major !== void 0 && version.major > 3;
119
+ case "WezTerm": return version.major !== void 0 && version.major >= 20200620;
120
+ case "vscode":
121
+ if (process.env.CURSOR_TRACE_ID) return true;
122
+ return version.minor !== void 0 && version.major !== void 0 && (version.major > 1 || version.major === 1 && version.minor >= 72);
123
+ case "ghostty": return true;
124
+ }
125
+ }
126
+ if (process.env.VTE_VERSION) {
127
+ if (process.env.VTE_VERSION === "0.50.0") return false;
128
+ const version = parseVersion(process.env.VTE_VERSION);
129
+ return version.major !== void 0 && version.major > 0 || version.minor !== void 0 && version.minor >= 50;
130
+ }
131
+ if (process.env.TERM === "alacritty") return true;
132
+ return false;
133
+ }
134
+ /** Node.js versions */
135
+ const nodeVersion = (process?.versions?.node || "").replace(/^v/, "") || null;
136
+ const nodeMajorVersion = Number(nodeVersion?.split(".")[0]) || null;
137
+
138
+ //#endregion
139
+ export { hasTTY, isColorSupported, isDebug, isDevelopment, isDevelopmentMode, isHyperlinkSupported, isLinux, isMacOS, isMinimal, isProduction, isProductionMode, isStaging, isTest, isTestMode, isWindows, nodeMajorVersion, nodeVersion, platform };
2
140
  //# sourceMappingURL=environment-checks.mjs.map
@@ -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":"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"}
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,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACD,CAAC,SAASA,QAAM,aAAa,EAAE,QAAQ,YAAY,GAAG,CAAC;;;AAI1D,MAAa,SACX,WAAW,KAAK,IAAI,aAAa,QAAQ,QAAQ,IAAI,KAAK;;;;;;;AAQ5D,SAAgB,kBAAkB,QAAc;AAC9C,QAAO;EAAC;EAAO;EAAe;EAAO;EAAc,CAAC,SAClDA,QAAM,aAAa,EAAE,QAAQ,YAAY,GAAG,CAC7C;;;AAIH,MAAa,gBAAgB,kBAAkB,KAAK,IAAI;;AAGxD,MAAa,YACX,QAAQ,QAAQ,IAAI,QAAQ,IAAI,MAAM,IAAI,UAAU,CAAC;;AAGvD,MAAa,YAAY,QAAQ,KAAK,SAAS;;AAG/C,MAAa,UAAU,UAAU,KAAK,SAAS;;AAG/C,MAAa,UAAU,WAAW,KAAK,SAAS;;AAGhD,MAAa,mBACX,CAAC,QAAQ,IAAI,aACZ,QAAQ,QAAQ,IAAI,YAAY,KAC7B,UAAU,cAAc,QAAQ,IAAI,SAAS,UAC/C,MAAM;AAEV,SAAS,aAAa,gBAAgB,IAAI;AACxC,KAAI,YAAY,KAAK,cAAc,EAAE;EACnC,MAAM,QAAQ,mBAAmB,KAAK,cAAc,IAAI,EAAE;AAE1D,SAAO;GACL,OAAO;GACP,OAAO,OAAO,SAAS,MAAM,IAAK,GAAG;GACrC,OAAO,OAAO,SAAS,MAAM,IAAK,GAAG;GACtC;;CAGH,MAAM,YAAY,iBAAiB,IAChC,MAAM,IAAI,CACV,KAAI,MAAK,OAAO,SAAS,GAAG,GAAG,CAAC;AAEnC,QAAO;EACL,OAAO,SAAS;EAChB,OAAO,SAAS;EAChB,OAAO,SAAS;EACjB;;;;;;;;AASH,SAAgB,qBACd,SAA6B,QAAQ,QAC5B;AACT,KAAI,QAAQ,IAAI,gBACd,QAAO,EACL,QAAQ,IAAI,gBAAgB,SAAS,KACrC,OAAO,SAAS,QAAQ,IAAI,iBAAiB,GAAG,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 +1,17 @@
1
- const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`node:fs`),n=require(`node:fs/promises`);function r(e){return(0,t.existsSync)(e)}exports.existsSync=r;
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ let node_fs = require("node:fs");
3
+ let node_fs_promises = require("node:fs/promises");
4
+
5
+ //#region ../fs/src/exists.ts
6
+ /**
7
+ * Check if a file exists
8
+ *
9
+ * @param filePath - The file path to check
10
+ * @returns An indicator specifying if the file exists
11
+ */
12
+ function existsSync(filePath) {
13
+ return (0, node_fs.existsSync)(filePath);
14
+ }
15
+
16
+ //#endregion
17
+ exports.existsSync = existsSync;
@@ -1,2 +1,16 @@
1
- import{existsSync as e}from"node:fs";function t(t){return e(t)}export{t as existsSync};
1
+ import { existsSync } from "node:fs";
2
+
3
+ //#region ../fs/src/exists.ts
4
+ /**
5
+ * Check if a file exists
6
+ *
7
+ * @param filePath - The file path to check
8
+ * @returns An indicator specifying if the file exists
9
+ */
10
+ function existsSync$1(filePath) {
11
+ return existsSync(filePath);
12
+ }
13
+
14
+ //#endregion
15
+ export { existsSync$1 as existsSync };
2
16
  //# sourceMappingURL=exists.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"exists.mjs","names":["existsSync","existsSyncFs"],"sources":["../../../../fs/src/exists.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 { existsSync as existsSyncFs } from \"node:fs\";\nimport { access, constants } from \"node:fs/promises\";\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport function existsSync(filePath: string): boolean {\n return existsSyncFs(filePath);\n}\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport async function exists(filePath: string): Promise<boolean> {\n return access(filePath, constants.F_OK)\n .then(() => true)\n .catch(() => false);\n}\n"],"mappings":"qCA2BA,SAAgBA,EAAW,EAA2B,CACpD,OAAOC,EAAa,EAAS"}
1
+ {"version":3,"file":"exists.mjs","names":["existsSync","existsSyncFs"],"sources":["../../../../fs/src/exists.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 { existsSync as existsSyncFs } from \"node:fs\";\nimport { access, constants } from \"node:fs/promises\";\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport function existsSync(filePath: string): boolean {\n return existsSyncFs(filePath);\n}\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport async function exists(filePath: string): Promise<boolean> {\n return access(filePath, constants.F_OK)\n .then(() => true)\n .catch(() => false);\n}\n"],"mappings":";;;;;;;;;AA2BA,SAAgBA,aAAW,UAA2B;AACpD,QAAOC,WAAa,SAAS"}
@@ -1 +1,17 @@
1
- const e=require(`../../_virtual/rolldown_runtime.cjs`);let t=require(`node:fs`),n=require(`node:fs/promises`);const r=async e=>{if(!e)throw Error(`No file path provided to read data`);return(0,n.readFile)(e,{encoding:`utf8`})};exports.readFile=r;
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ let node_fs = require("node:fs");
3
+ let node_fs_promises = require("node:fs/promises");
4
+
5
+ //#region ../fs/src/read-file.ts
6
+ /**
7
+ * Read the given content to the given file path
8
+ *
9
+ * @param filePath - The file path to read to
10
+ */
11
+ const readFile = async (filePath) => {
12
+ if (!filePath) throw new Error("No file path provided to read data");
13
+ return (0, node_fs_promises.readFile)(filePath, { encoding: "utf8" });
14
+ };
15
+
16
+ //#endregion
17
+ exports.readFile = readFile;