cli-argv-util 1.5.2 → 1.5.3

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.
@@ -1,4 +1,4 @@
1
- //! cli-argv-util v1.5.2 ~~ https://github.com/center-key/cli-argv-util ~~ MIT License
1
+ //! cli-argv-util v1.5.3 ~~ https://github.com/center-key/cli-argv-util ~~ MIT License
2
2
 
3
3
  export type StringFlagMap = {
4
4
  [flag: string]: string | undefined;
@@ -49,6 +49,7 @@ declare const cliArgvUtil: {
49
49
  }, posix: string): NonSharedBuffer;
50
50
  readFolder(folder: string): string[];
51
51
  cleanPath(name: string): string;
52
+ colorizePath(pathname: string): string;
52
53
  calcAncestor(sourceFile: string, targetFile: string): Ancestor;
53
54
  unquoteArgs(args: string[]): string[];
54
55
  };
@@ -1,4 +1,4 @@
1
- //! cli-argv-util v1.5.2 ~~ https://github.com/center-key/cli-argv-util ~~ MIT License
1
+ //! cli-argv-util v1.5.3 ~~ https://github.com/center-key/cli-argv-util ~~ MIT License
2
2
 
3
3
  import { execSync } from 'node:child_process';
4
4
  import chalk from 'chalk';
@@ -6,7 +6,7 @@ import fs from 'node:fs';
6
6
  import path from 'node:path';
7
7
  import slash from 'slash';
8
8
  const cliArgvUtil = {
9
- version: '1.5.2',
9
+ version: '1.5.3',
10
10
  assertOk(ok, message) {
11
11
  if (!ok)
12
12
  throw new Error(`[replacer-util] ${message}`);
@@ -94,6 +94,9 @@ const cliArgvUtil = {
94
94
  cleanPath(name) {
95
95
  return slash(path.normalize(name)).trim().replace(/\/$/, '');
96
96
  },
97
+ colorizePath(pathname) {
98
+ return chalk.green(path.dirname(pathname) + '/') + chalk.white(path.basename(pathname));
99
+ },
97
100
  calcAncestor(sourceFile, targetFile) {
98
101
  const index = Array.from(sourceFile).findIndex((char, i) => targetFile[i] !== char);
99
102
  const substr = index === -1 ? sourceFile : sourceFile.substring(0, index);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cli-argv-util",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "Simple utility to parse command line parameters and flags (arguments vector)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -68,7 +68,7 @@
68
68
  "add-dist-header": "~1.6",
69
69
  "assert-deep-strict-equal": "~1.2",
70
70
  "copy-file-util": "~1.3",
71
- "eslint": "~10.5",
71
+ "eslint": "~10.6",
72
72
  "jshint": "~2.13",
73
73
  "mocha": "~11.7",
74
74
  "rimraf": "~6.1",