@storm-software/config-tools 1.163.26 → 1.163.27

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/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-1.163.25-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-1.163.26-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
@@ -40,7 +40,6 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
40
40
 
41
41
  <!-- START doctoc -->
42
42
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
43
-
44
43
  ## Table of Contents
45
44
 
46
45
  - [Storm Configuration Tools](#storm-configuration-tools)
@@ -0,0 +1,38 @@
1
+ import {
2
+ normalizeWindowsPath
3
+ } from "./chunk-FRR2ZRWD.js";
4
+
5
+ // src/utilities/file-path-utils.ts
6
+ var removeExtension = (filePath) => {
7
+ const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
8
+ if (result.startsWith("./")) {
9
+ return result.substring(2);
10
+ }
11
+ if (result.startsWith(".") || result.startsWith("/")) {
12
+ return result.substring(1);
13
+ }
14
+ return result;
15
+ };
16
+ function findFileName(filePath, { requireExtension, withExtension } = {}) {
17
+ const result = normalizeWindowsPath(filePath)?.split(filePath?.includes("\\") ? "\\" : "/")?.pop() ?? "";
18
+ if (requireExtension === true && !result.includes(".")) {
19
+ return "";
20
+ }
21
+ if (withExtension === false && result.includes(".")) {
22
+ return result.split(".").slice(-1).join(".") || "";
23
+ }
24
+ return result;
25
+ }
26
+ function findFilePath(filePath) {
27
+ const normalizedPath = normalizeWindowsPath(filePath);
28
+ return normalizedPath.replace(
29
+ findFileName(normalizedPath, { requireExtension: true }),
30
+ ""
31
+ );
32
+ }
33
+
34
+ export {
35
+ removeExtension,
36
+ findFileName,
37
+ findFilePath
38
+ };
@@ -1,5 +1,8 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/utilities/file-path-utils.ts
2
- var _path = require('path');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+ var _chunk4JREL2GQcjs = require('./chunk-4JREL2GQ.cjs');
4
+
5
+ // src/utilities/file-path-utils.ts
3
6
  var removeExtension = (filePath) => {
4
7
  const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
5
8
  if (result.startsWith("./")) {
@@ -10,13 +13,26 @@ var removeExtension = (filePath) => {
10
13
  }
11
14
  return result;
12
15
  };
13
- function findFileName(filePath) {
14
- return _nullishCoalesce(_optionalChain([filePath, 'optionalAccess', _ => _.split, 'call', _2 => _2(
15
- _optionalChain([filePath, 'optionalAccess', _3 => _3.includes, 'call', _4 => _4(_path.sep)]) ? _path.sep : _optionalChain([filePath, 'optionalAccess', _5 => _5.includes, 'call', _6 => _6("/")]) ? "/" : "\\"
16
- ), 'optionalAccess', _7 => _7.pop, 'call', _8 => _8()]), () => ( ""));
16
+ function findFileName(filePath, { requireExtension, withExtension } = {}) {
17
+ const result = _nullishCoalesce(_optionalChain([_chunk4JREL2GQcjs.normalizeWindowsPath.call(void 0, filePath), 'optionalAccess', _ => _.split, 'call', _2 => _2(_optionalChain([filePath, 'optionalAccess', _3 => _3.includes, 'call', _4 => _4("\\")]) ? "\\" : "/"), 'optionalAccess', _5 => _5.pop, 'call', _6 => _6()]), () => ( ""));
18
+ if (requireExtension === true && !result.includes(".")) {
19
+ return "";
20
+ }
21
+ if (withExtension === false && result.includes(".")) {
22
+ return result.split(".").slice(-1).join(".") || "";
23
+ }
24
+ return result;
25
+ }
26
+ function findFilePath(filePath) {
27
+ const normalizedPath = _chunk4JREL2GQcjs.normalizeWindowsPath.call(void 0, filePath);
28
+ return normalizedPath.replace(
29
+ findFileName(normalizedPath, { requireExtension: true }),
30
+ ""
31
+ );
17
32
  }
18
33
 
19
34
 
20
35
 
21
36
 
22
- exports.removeExtension = removeExtension; exports.findFileName = findFileName;
37
+
38
+ exports.removeExtension = removeExtension; exports.findFileName = findFileName; exports.findFilePath = findFilePath;
@@ -6,7 +6,7 @@ require('../chunk-UNXQ2AR4.cjs');
6
6
  require('../chunk-FCWF3I34.cjs');
7
7
  require('../chunk-ZGLOKOL3.cjs');
8
8
  require('../chunk-AQ2NOVJF.cjs');
9
- require('../chunk-D3TDPGPG.cjs');
9
+ require('../chunk-T4ZMKMEG.cjs');
10
10
  require('../chunk-7SIKKF62.cjs');
11
11
  require('../chunk-GIXUQACB.cjs');
12
12
  require('../chunk-AEZINHEA.cjs');
@@ -6,7 +6,7 @@ import "../chunk-I6MMCLIA.js";
6
6
  import "../chunk-ELNIDXR5.js";
7
7
  import "../chunk-64DXC5WM.js";
8
8
  import "../chunk-IETV2DPL.js";
9
- import "../chunk-4OOVR2GZ.js";
9
+ import "../chunk-42TCRG4H.js";
10
10
  import "../chunk-QJUAU656.js";
11
11
  import "../chunk-JX5NLB4S.js";
12
12
  import "../chunk-VLWSWYG7.js";
@@ -7,7 +7,7 @@ require('../chunk-UNXQ2AR4.cjs');
7
7
  require('../chunk-FCWF3I34.cjs');
8
8
  require('../chunk-ZGLOKOL3.cjs');
9
9
  require('../chunk-AQ2NOVJF.cjs');
10
- require('../chunk-D3TDPGPG.cjs');
10
+ require('../chunk-T4ZMKMEG.cjs');
11
11
  require('../chunk-7SIKKF62.cjs');
12
12
  require('../chunk-GIXUQACB.cjs');
13
13
  require('../chunk-AEZINHEA.cjs');
@@ -7,7 +7,7 @@ import "../chunk-I6MMCLIA.js";
7
7
  import "../chunk-ELNIDXR5.js";
8
8
  import "../chunk-64DXC5WM.js";
9
9
  import "../chunk-IETV2DPL.js";
10
- import "../chunk-4OOVR2GZ.js";
10
+ import "../chunk-42TCRG4H.js";
11
11
  import "../chunk-QJUAU656.js";
12
12
  import "../chunk-JX5NLB4S.js";
13
13
  import "../chunk-VLWSWYG7.js";
@@ -9,7 +9,7 @@ require('./chunk-UNXQ2AR4.cjs');
9
9
  require('./chunk-FCWF3I34.cjs');
10
10
  require('./chunk-ZGLOKOL3.cjs');
11
11
  require('./chunk-AQ2NOVJF.cjs');
12
- require('./chunk-D3TDPGPG.cjs');
12
+ require('./chunk-T4ZMKMEG.cjs');
13
13
  require('./chunk-7SIKKF62.cjs');
14
14
  require('./chunk-GIXUQACB.cjs');
15
15
  require('./chunk-AEZINHEA.cjs');
@@ -9,7 +9,7 @@ import "./chunk-I6MMCLIA.js";
9
9
  import "./chunk-ELNIDXR5.js";
10
10
  import "./chunk-64DXC5WM.js";
11
11
  import "./chunk-IETV2DPL.js";
12
- import "./chunk-4OOVR2GZ.js";
12
+ import "./chunk-42TCRG4H.js";
13
13
  import "./chunk-QJUAU656.js";
14
14
  import "./chunk-JX5NLB4S.js";
15
15
  import "./chunk-VLWSWYG7.js";
@@ -9,7 +9,7 @@ require('./chunk-UNXQ2AR4.cjs');
9
9
  require('./chunk-FCWF3I34.cjs');
10
10
  require('./chunk-ZGLOKOL3.cjs');
11
11
  require('./chunk-AQ2NOVJF.cjs');
12
- require('./chunk-D3TDPGPG.cjs');
12
+ require('./chunk-T4ZMKMEG.cjs');
13
13
  require('./chunk-7SIKKF62.cjs');
14
14
  require('./chunk-GIXUQACB.cjs');
15
15
  require('./chunk-AEZINHEA.cjs');
@@ -9,7 +9,7 @@ import "./chunk-I6MMCLIA.js";
9
9
  import "./chunk-ELNIDXR5.js";
10
10
  import "./chunk-64DXC5WM.js";
11
11
  import "./chunk-IETV2DPL.js";
12
- import "./chunk-4OOVR2GZ.js";
12
+ import "./chunk-42TCRG4H.js";
13
13
  import "./chunk-QJUAU656.js";
14
14
  import "./chunk-JX5NLB4S.js";
15
15
  import "./chunk-VLWSWYG7.js";
package/dist/index.cjs CHANGED
@@ -37,7 +37,8 @@ var _chunkAQ2NOVJFcjs = require('./chunk-AQ2NOVJF.cjs');
37
37
 
38
38
 
39
39
 
40
- var _chunkD3TDPGPGcjs = require('./chunk-D3TDPGPG.cjs');
40
+
41
+ var _chunkT4ZMKMEGcjs = require('./chunk-T4ZMKMEG.cjs');
41
42
 
42
43
 
43
44
 
@@ -170,4 +171,5 @@ var _chunkC5OTFOQBcjs = require('./chunk-C5OTFOQB.cjs');
170
171
 
171
172
 
172
173
 
173
- exports.CONSOLE_ICONS = _chunkPSHJQ2NPcjs.CONSOLE_ICONS; exports.DEFAULT_COLOR_CONFIG = _chunkGIXUQACBcjs.DEFAULT_COLOR_CONFIG; exports.LARGE_BUFFER = _chunkZGLOKOL3cjs.LARGE_BUFFER; exports.LogLevel = _chunkC5OTFOQBcjs.LogLevel; exports.LogLevelLabel = _chunkC5OTFOQBcjs.LogLevelLabel; exports.applyWorkspaceBaseTokens = _chunkAQ2NOVJFcjs.applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = _chunkAQ2NOVJFcjs.applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = _chunkAQ2NOVJFcjs.applyWorkspaceTokens; exports.basename = _chunk4JREL2GQcjs.basename; exports.correctPaths = _chunk4JREL2GQcjs.correctPaths; exports.createConfigExtension = _chunkBJ2W75ZOcjs.createConfigExtension; exports.createLogger = _chunkJ2LCTMCIcjs.createLogger; exports.createStormWorkspaceConfig = _chunkBJ2W75ZOcjs.createStormWorkspaceConfig; exports.dirname = _chunk4JREL2GQcjs.dirname; exports.exitWithError = _chunkFCWF3I34cjs.exitWithError; exports.exitWithSuccess = _chunkFCWF3I34cjs.exitWithSuccess; exports.extname = _chunk4JREL2GQcjs.extname; exports.findFileName = _chunkD3TDPGPGcjs.findFileName; exports.findWorkspaceRoot = _chunkAEZINHEAcjs.findWorkspaceRoot; exports.findWorkspaceRootSafe = _chunkAEZINHEAcjs.findWorkspaceRootSafe; exports.format = _chunk4JREL2GQcjs.format; exports.formatLogMessage = _chunk7SIKKF62cjs.formatLogMessage; exports.formatTimestamp = _chunkQNDF3RQLcjs.formatTimestamp; exports.getChalk = _chunkNS5PJ2RMcjs.getChalk; exports.getConfig = _chunkH2GU4JMJcjs.getConfig; exports.getConfigEnv = _chunk56NGBR4Scjs.getConfigEnv; exports.getConfigFile = _chunk7HCUD67Dcjs.getConfigFile; exports.getConfigFileByName = _chunk7HCUD67Dcjs.getConfigFileByName; exports.getDefaultConfig = _chunkGIXUQACBcjs.getDefaultConfig; exports.getExtensionEnv = _chunk56NGBR4Scjs.getExtensionEnv; exports.getLogFn = _chunk7SIKKF62cjs.getLogFn; exports.getLogLevel = _chunk7BZWQZUVcjs.getLogLevel; exports.getLogLevelLabel = _chunk7BZWQZUVcjs.getLogLevelLabel; exports.getStopwatch = _chunk7SIKKF62cjs.getStopwatch; exports.getWorkspaceConfig = _chunkH2GU4JMJcjs.getWorkspaceConfig; exports.handleProcess = _chunkFCWF3I34cjs.handleProcess; exports.isAbsolute = _chunk4JREL2GQcjs.isAbsolute; exports.isUnicodeSupported = _chunkPLLCZVZOcjs.isUnicodeSupported; exports.isVerbose = _chunk7BZWQZUVcjs.isVerbose; exports.joinPaths = _chunk4JREL2GQcjs.joinPaths; exports.loadStormWorkspaceConfig = _chunkBJ2W75ZOcjs.loadStormWorkspaceConfig; exports.normalizeString = _chunk4JREL2GQcjs.normalizeString; exports.normalizeWindowsPath = _chunk4JREL2GQcjs.normalizeWindowsPath; exports.parse = _chunk4JREL2GQcjs.parse; exports.relative = _chunk4JREL2GQcjs.relative; exports.removeExtension = _chunkD3TDPGPGcjs.removeExtension; exports.resolve = _chunk4JREL2GQcjs.resolve; exports.run = _chunkZGLOKOL3cjs.run; exports.runAsync = _chunkZGLOKOL3cjs.runAsync; exports.sep = _chunk4JREL2GQcjs.sep; exports.setConfigEnv = _chunkH425P7G5cjs.setConfigEnv; exports.setExtensionEnv = _chunkH425P7G5cjs.setExtensionEnv; exports.toNamespacedPath = _chunk4JREL2GQcjs.toNamespacedPath; exports.tryGetWorkspaceConfig = _chunkH2GU4JMJcjs.tryGetWorkspaceConfig; exports.tryLoadStormWorkspaceConfig = _chunkBJ2W75ZOcjs.tryLoadStormWorkspaceConfig; exports.writeDebug = _chunk7SIKKF62cjs.writeDebug; exports.writeError = _chunk7SIKKF62cjs.writeError; exports.writeFatal = _chunk7SIKKF62cjs.writeFatal; exports.writeInfo = _chunk7SIKKF62cjs.writeInfo; exports.writeSuccess = _chunk7SIKKF62cjs.writeSuccess; exports.writeSystem = _chunk7SIKKF62cjs.writeSystem; exports.writeTrace = _chunk7SIKKF62cjs.writeTrace; exports.writeWarning = _chunk7SIKKF62cjs.writeWarning;
174
+
175
+ exports.CONSOLE_ICONS = _chunkPSHJQ2NPcjs.CONSOLE_ICONS; exports.DEFAULT_COLOR_CONFIG = _chunkGIXUQACBcjs.DEFAULT_COLOR_CONFIG; exports.LARGE_BUFFER = _chunkZGLOKOL3cjs.LARGE_BUFFER; exports.LogLevel = _chunkC5OTFOQBcjs.LogLevel; exports.LogLevelLabel = _chunkC5OTFOQBcjs.LogLevelLabel; exports.applyWorkspaceBaseTokens = _chunkAQ2NOVJFcjs.applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = _chunkAQ2NOVJFcjs.applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = _chunkAQ2NOVJFcjs.applyWorkspaceTokens; exports.basename = _chunk4JREL2GQcjs.basename; exports.correctPaths = _chunk4JREL2GQcjs.correctPaths; exports.createConfigExtension = _chunkBJ2W75ZOcjs.createConfigExtension; exports.createLogger = _chunkJ2LCTMCIcjs.createLogger; exports.createStormWorkspaceConfig = _chunkBJ2W75ZOcjs.createStormWorkspaceConfig; exports.dirname = _chunk4JREL2GQcjs.dirname; exports.exitWithError = _chunkFCWF3I34cjs.exitWithError; exports.exitWithSuccess = _chunkFCWF3I34cjs.exitWithSuccess; exports.extname = _chunk4JREL2GQcjs.extname; exports.findFileName = _chunkT4ZMKMEGcjs.findFileName; exports.findFilePath = _chunkT4ZMKMEGcjs.findFilePath; exports.findWorkspaceRoot = _chunkAEZINHEAcjs.findWorkspaceRoot; exports.findWorkspaceRootSafe = _chunkAEZINHEAcjs.findWorkspaceRootSafe; exports.format = _chunk4JREL2GQcjs.format; exports.formatLogMessage = _chunk7SIKKF62cjs.formatLogMessage; exports.formatTimestamp = _chunkQNDF3RQLcjs.formatTimestamp; exports.getChalk = _chunkNS5PJ2RMcjs.getChalk; exports.getConfig = _chunkH2GU4JMJcjs.getConfig; exports.getConfigEnv = _chunk56NGBR4Scjs.getConfigEnv; exports.getConfigFile = _chunk7HCUD67Dcjs.getConfigFile; exports.getConfigFileByName = _chunk7HCUD67Dcjs.getConfigFileByName; exports.getDefaultConfig = _chunkGIXUQACBcjs.getDefaultConfig; exports.getExtensionEnv = _chunk56NGBR4Scjs.getExtensionEnv; exports.getLogFn = _chunk7SIKKF62cjs.getLogFn; exports.getLogLevel = _chunk7BZWQZUVcjs.getLogLevel; exports.getLogLevelLabel = _chunk7BZWQZUVcjs.getLogLevelLabel; exports.getStopwatch = _chunk7SIKKF62cjs.getStopwatch; exports.getWorkspaceConfig = _chunkH2GU4JMJcjs.getWorkspaceConfig; exports.handleProcess = _chunkFCWF3I34cjs.handleProcess; exports.isAbsolute = _chunk4JREL2GQcjs.isAbsolute; exports.isUnicodeSupported = _chunkPLLCZVZOcjs.isUnicodeSupported; exports.isVerbose = _chunk7BZWQZUVcjs.isVerbose; exports.joinPaths = _chunk4JREL2GQcjs.joinPaths; exports.loadStormWorkspaceConfig = _chunkBJ2W75ZOcjs.loadStormWorkspaceConfig; exports.normalizeString = _chunk4JREL2GQcjs.normalizeString; exports.normalizeWindowsPath = _chunk4JREL2GQcjs.normalizeWindowsPath; exports.parse = _chunk4JREL2GQcjs.parse; exports.relative = _chunk4JREL2GQcjs.relative; exports.removeExtension = _chunkT4ZMKMEGcjs.removeExtension; exports.resolve = _chunk4JREL2GQcjs.resolve; exports.run = _chunkZGLOKOL3cjs.run; exports.runAsync = _chunkZGLOKOL3cjs.runAsync; exports.sep = _chunk4JREL2GQcjs.sep; exports.setConfigEnv = _chunkH425P7G5cjs.setConfigEnv; exports.setExtensionEnv = _chunkH425P7G5cjs.setExtensionEnv; exports.toNamespacedPath = _chunk4JREL2GQcjs.toNamespacedPath; exports.tryGetWorkspaceConfig = _chunkH2GU4JMJcjs.tryGetWorkspaceConfig; exports.tryLoadStormWorkspaceConfig = _chunkBJ2W75ZOcjs.tryLoadStormWorkspaceConfig; exports.writeDebug = _chunk7SIKKF62cjs.writeDebug; exports.writeError = _chunk7SIKKF62cjs.writeError; exports.writeFatal = _chunk7SIKKF62cjs.writeFatal; exports.writeInfo = _chunk7SIKKF62cjs.writeInfo; exports.writeSuccess = _chunk7SIKKF62cjs.writeSuccess; exports.writeSystem = _chunk7SIKKF62cjs.writeSystem; exports.writeTrace = _chunk7SIKKF62cjs.writeTrace; exports.writeWarning = _chunk7SIKKF62cjs.writeWarning;
package/dist/index.d.cts CHANGED
@@ -13,7 +13,7 @@ export { isUnicodeSupported } from './logger/is-unicode-supported.cjs';
13
13
  export { BaseTokenizerOptions, DeepPartial, LogLevel, LogLevelLabel, Logger, ProjectTokenizerOptions } from './types.cjs';
14
14
  export { applyWorkspaceBaseTokens, applyWorkspaceProjectTokens, applyWorkspaceTokens } from './utilities/apply-workspace-tokens.cjs';
15
15
  export { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath } from './utilities/correct-paths.cjs';
16
- export { findFileName, removeExtension } from './utilities/file-path-utils.cjs';
16
+ export { FindFileNameOptions, findFileName, findFilePath, removeExtension } from './utilities/file-path-utils.cjs';
17
17
  export { findWorkspaceRoot, findWorkspaceRootSafe } from './utilities/find-workspace-root.cjs';
18
18
  export { DEFAULT_COLOR_CONFIG, getDefaultConfig } from './utilities/get-default-config.cjs';
19
19
  export { exitWithError, exitWithSuccess, handleProcess } from './utilities/process-handler.cjs';
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export { isUnicodeSupported } from './logger/is-unicode-supported.js';
13
13
  export { BaseTokenizerOptions, DeepPartial, LogLevel, LogLevelLabel, Logger, ProjectTokenizerOptions } from './types.js';
14
14
  export { applyWorkspaceBaseTokens, applyWorkspaceProjectTokens, applyWorkspaceTokens } from './utilities/apply-workspace-tokens.js';
15
15
  export { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath } from './utilities/correct-paths.js';
16
- export { findFileName, removeExtension } from './utilities/file-path-utils.js';
16
+ export { FindFileNameOptions, findFileName, findFilePath, removeExtension } from './utilities/file-path-utils.js';
17
17
  export { findWorkspaceRoot, findWorkspaceRootSafe } from './utilities/find-workspace-root.js';
18
18
  export { DEFAULT_COLOR_CONFIG, getDefaultConfig } from './utilities/get-default-config.js';
19
19
  export { exitWithError, exitWithSuccess, handleProcess } from './utilities/process-handler.js';
package/dist/index.js CHANGED
@@ -36,8 +36,9 @@ import {
36
36
  } from "./chunk-IETV2DPL.js";
37
37
  import {
38
38
  findFileName,
39
+ findFilePath,
39
40
  removeExtension
40
- } from "./chunk-4OOVR2GZ.js";
41
+ } from "./chunk-42TCRG4H.js";
41
42
  import {
42
43
  formatLogMessage,
43
44
  getLogFn,
@@ -125,6 +126,7 @@ export {
125
126
  exitWithSuccess,
126
127
  extname,
127
128
  findFileName,
129
+ findFilePath,
128
130
  findWorkspaceRoot,
129
131
  findWorkspaceRootSafe,
130
132
  format,
@@ -1,8 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkD3TDPGPGcjs = require('../chunk-D3TDPGPG.cjs');
5
4
 
5
+ var _chunkT4ZMKMEGcjs = require('../chunk-T4ZMKMEG.cjs');
6
+ require('../chunk-4JREL2GQ.cjs');
6
7
 
7
8
 
8
- exports.findFileName = _chunkD3TDPGPGcjs.findFileName; exports.removeExtension = _chunkD3TDPGPGcjs.removeExtension;
9
+
10
+
11
+ exports.findFileName = _chunkT4ZMKMEGcjs.findFileName; exports.findFilePath = _chunkT4ZMKMEGcjs.findFilePath; exports.removeExtension = _chunkT4ZMKMEGcjs.removeExtension;
@@ -1,4 +1,44 @@
1
1
  declare const removeExtension: (filePath?: string) => string;
2
- declare function findFileName(filePath: string): string;
2
+ interface FindFileNameOptions {
3
+ /**
4
+ * Require the file extension to be present in the file name.
5
+ *
6
+ * @defaultValue false
7
+ */
8
+ requireExtension?: boolean;
9
+ /**
10
+ * Return the file extension as part of the full file name result.
11
+ *
12
+ * @defaultValue true
13
+ */
14
+ withExtension?: boolean;
15
+ }
16
+ /**
17
+ * Find the file name from a file path.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const fileName = findFileName("C:\\Users\\user\\Documents\\file.txt");
22
+ * // fileName = "file.txt"
23
+ * ```
24
+ *
25
+ * @param filePath - The file path to process
26
+ * @param options - The options to use when processing the file name
27
+ * @returns The file name
28
+ */
29
+ declare function findFileName(filePath: string, { requireExtension, withExtension }?: FindFileNameOptions): string;
30
+ /**
31
+ * Find the full file path's directories from a file path.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const folderPath = findFilePath("C:\\Users\\user\\Documents\\file.txt");
36
+ * // folderPath = "C:\\Users\\user\\Documents"
37
+ * ```
38
+ *
39
+ * @param filePath - The file path to process
40
+ * @returns The full file path's directories
41
+ */
42
+ declare function findFilePath(filePath: string): string;
3
43
 
4
- export { findFileName, removeExtension };
44
+ export { type FindFileNameOptions, findFileName, findFilePath, removeExtension };
@@ -1,4 +1,44 @@
1
1
  declare const removeExtension: (filePath?: string) => string;
2
- declare function findFileName(filePath: string): string;
2
+ interface FindFileNameOptions {
3
+ /**
4
+ * Require the file extension to be present in the file name.
5
+ *
6
+ * @defaultValue false
7
+ */
8
+ requireExtension?: boolean;
9
+ /**
10
+ * Return the file extension as part of the full file name result.
11
+ *
12
+ * @defaultValue true
13
+ */
14
+ withExtension?: boolean;
15
+ }
16
+ /**
17
+ * Find the file name from a file path.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const fileName = findFileName("C:\\Users\\user\\Documents\\file.txt");
22
+ * // fileName = "file.txt"
23
+ * ```
24
+ *
25
+ * @param filePath - The file path to process
26
+ * @param options - The options to use when processing the file name
27
+ * @returns The file name
28
+ */
29
+ declare function findFileName(filePath: string, { requireExtension, withExtension }?: FindFileNameOptions): string;
30
+ /**
31
+ * Find the full file path's directories from a file path.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const folderPath = findFilePath("C:\\Users\\user\\Documents\\file.txt");
36
+ * // folderPath = "C:\\Users\\user\\Documents"
37
+ * ```
38
+ *
39
+ * @param filePath - The file path to process
40
+ * @returns The full file path's directories
41
+ */
42
+ declare function findFilePath(filePath: string): string;
3
43
 
4
- export { findFileName, removeExtension };
44
+ export { type FindFileNameOptions, findFileName, findFilePath, removeExtension };
@@ -1,8 +1,11 @@
1
1
  import {
2
2
  findFileName,
3
+ findFilePath,
3
4
  removeExtension
4
- } from "../chunk-4OOVR2GZ.js";
5
+ } from "../chunk-42TCRG4H.js";
6
+ import "../chunk-FRR2ZRWD.js";
5
7
  export {
6
8
  findFileName,
9
+ findFilePath,
7
10
  removeExtension
8
11
  };
@@ -17,7 +17,8 @@ var _chunkAQ2NOVJFcjs = require('../chunk-AQ2NOVJF.cjs');
17
17
 
18
18
 
19
19
 
20
- var _chunkD3TDPGPGcjs = require('../chunk-D3TDPGPG.cjs');
20
+
21
+ var _chunkT4ZMKMEGcjs = require('../chunk-T4ZMKMEG.cjs');
21
22
  require('../chunk-7SIKKF62.cjs');
22
23
 
23
24
 
@@ -80,4 +81,5 @@ require('../chunk-C5OTFOQB.cjs');
80
81
 
81
82
 
82
83
 
83
- exports.DEFAULT_COLOR_CONFIG = _chunkGIXUQACBcjs.DEFAULT_COLOR_CONFIG; exports.LARGE_BUFFER = _chunkZGLOKOL3cjs.LARGE_BUFFER; exports.applyWorkspaceBaseTokens = _chunkAQ2NOVJFcjs.applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = _chunkAQ2NOVJFcjs.applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = _chunkAQ2NOVJFcjs.applyWorkspaceTokens; exports.basename = _chunk4JREL2GQcjs.basename; exports.correctPaths = _chunk4JREL2GQcjs.correctPaths; exports.dirname = _chunk4JREL2GQcjs.dirname; exports.exitWithError = _chunkFCWF3I34cjs.exitWithError; exports.exitWithSuccess = _chunkFCWF3I34cjs.exitWithSuccess; exports.extname = _chunk4JREL2GQcjs.extname; exports.findFileName = _chunkD3TDPGPGcjs.findFileName; exports.findWorkspaceRoot = _chunkAEZINHEAcjs.findWorkspaceRoot; exports.findWorkspaceRootSafe = _chunkAEZINHEAcjs.findWorkspaceRootSafe; exports.format = _chunk4JREL2GQcjs.format; exports.getDefaultConfig = _chunkGIXUQACBcjs.getDefaultConfig; exports.handleProcess = _chunkFCWF3I34cjs.handleProcess; exports.isAbsolute = _chunk4JREL2GQcjs.isAbsolute; exports.joinPaths = _chunk4JREL2GQcjs.joinPaths; exports.normalizeString = _chunk4JREL2GQcjs.normalizeString; exports.normalizeWindowsPath = _chunk4JREL2GQcjs.normalizeWindowsPath; exports.parse = _chunk4JREL2GQcjs.parse; exports.relative = _chunk4JREL2GQcjs.relative; exports.removeExtension = _chunkD3TDPGPGcjs.removeExtension; exports.resolve = _chunk4JREL2GQcjs.resolve; exports.run = _chunkZGLOKOL3cjs.run; exports.runAsync = _chunkZGLOKOL3cjs.runAsync; exports.sep = _chunk4JREL2GQcjs.sep; exports.toNamespacedPath = _chunk4JREL2GQcjs.toNamespacedPath;
84
+
85
+ exports.DEFAULT_COLOR_CONFIG = _chunkGIXUQACBcjs.DEFAULT_COLOR_CONFIG; exports.LARGE_BUFFER = _chunkZGLOKOL3cjs.LARGE_BUFFER; exports.applyWorkspaceBaseTokens = _chunkAQ2NOVJFcjs.applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = _chunkAQ2NOVJFcjs.applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = _chunkAQ2NOVJFcjs.applyWorkspaceTokens; exports.basename = _chunk4JREL2GQcjs.basename; exports.correctPaths = _chunk4JREL2GQcjs.correctPaths; exports.dirname = _chunk4JREL2GQcjs.dirname; exports.exitWithError = _chunkFCWF3I34cjs.exitWithError; exports.exitWithSuccess = _chunkFCWF3I34cjs.exitWithSuccess; exports.extname = _chunk4JREL2GQcjs.extname; exports.findFileName = _chunkT4ZMKMEGcjs.findFileName; exports.findFilePath = _chunkT4ZMKMEGcjs.findFilePath; exports.findWorkspaceRoot = _chunkAEZINHEAcjs.findWorkspaceRoot; exports.findWorkspaceRootSafe = _chunkAEZINHEAcjs.findWorkspaceRootSafe; exports.format = _chunk4JREL2GQcjs.format; exports.getDefaultConfig = _chunkGIXUQACBcjs.getDefaultConfig; exports.handleProcess = _chunkFCWF3I34cjs.handleProcess; exports.isAbsolute = _chunk4JREL2GQcjs.isAbsolute; exports.joinPaths = _chunk4JREL2GQcjs.joinPaths; exports.normalizeString = _chunk4JREL2GQcjs.normalizeString; exports.normalizeWindowsPath = _chunk4JREL2GQcjs.normalizeWindowsPath; exports.parse = _chunk4JREL2GQcjs.parse; exports.relative = _chunk4JREL2GQcjs.relative; exports.removeExtension = _chunkT4ZMKMEGcjs.removeExtension; exports.resolve = _chunk4JREL2GQcjs.resolve; exports.run = _chunkZGLOKOL3cjs.run; exports.runAsync = _chunkZGLOKOL3cjs.runAsync; exports.sep = _chunk4JREL2GQcjs.sep; exports.toNamespacedPath = _chunk4JREL2GQcjs.toNamespacedPath;
@@ -1,6 +1,6 @@
1
1
  export { applyWorkspaceBaseTokens, applyWorkspaceProjectTokens, applyWorkspaceTokens } from './apply-workspace-tokens.cjs';
2
2
  export { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath } from './correct-paths.cjs';
3
- export { findFileName, removeExtension } from './file-path-utils.cjs';
3
+ export { FindFileNameOptions, findFileName, findFilePath, removeExtension } from './file-path-utils.cjs';
4
4
  export { findWorkspaceRoot, findWorkspaceRootSafe } from './find-workspace-root.cjs';
5
5
  export { DEFAULT_COLOR_CONFIG, getDefaultConfig } from './get-default-config.cjs';
6
6
  export { exitWithError, exitWithSuccess, handleProcess } from './process-handler.cjs';
@@ -1,6 +1,6 @@
1
1
  export { applyWorkspaceBaseTokens, applyWorkspaceProjectTokens, applyWorkspaceTokens } from './apply-workspace-tokens.js';
2
2
  export { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath } from './correct-paths.js';
3
- export { findFileName, removeExtension } from './file-path-utils.js';
3
+ export { FindFileNameOptions, findFileName, findFilePath, removeExtension } from './file-path-utils.js';
4
4
  export { findWorkspaceRoot, findWorkspaceRootSafe } from './find-workspace-root.js';
5
5
  export { DEFAULT_COLOR_CONFIG, getDefaultConfig } from './get-default-config.js';
6
6
  export { exitWithError, exitWithSuccess, handleProcess } from './process-handler.js';
@@ -16,8 +16,9 @@ import {
16
16
  } from "../chunk-IETV2DPL.js";
17
17
  import {
18
18
  findFileName,
19
+ findFilePath,
19
20
  removeExtension
20
- } from "../chunk-4OOVR2GZ.js";
21
+ } from "../chunk-42TCRG4H.js";
21
22
  import "../chunk-QJUAU656.js";
22
23
  import {
23
24
  DEFAULT_COLOR_CONFIG,
@@ -63,6 +64,7 @@ export {
63
64
  exitWithSuccess,
64
65
  extname,
65
66
  findFileName,
67
+ findFilePath,
66
68
  findWorkspaceRoot,
67
69
  findWorkspaceRootSafe,
68
70
  format,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/config-tools",
3
- "version": "1.163.26",
3
+ "version": "1.163.27",
4
4
  "type": "module",
5
5
  "description": "⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",
6
6
  "repository": {
@@ -1,22 +0,0 @@
1
- // src/utilities/file-path-utils.ts
2
- import { sep } from "node:path";
3
- var removeExtension = (filePath) => {
4
- const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
5
- if (result.startsWith("./")) {
6
- return result.substring(2);
7
- }
8
- if (result.startsWith(".") || result.startsWith("/")) {
9
- return result.substring(1);
10
- }
11
- return result;
12
- };
13
- function findFileName(filePath) {
14
- return filePath?.split(
15
- filePath?.includes(sep) ? sep : filePath?.includes("/") ? "/" : "\\"
16
- )?.pop() ?? "";
17
- }
18
-
19
- export {
20
- removeExtension,
21
- findFileName
22
- };