cspell 9.6.1 → 9.6.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.
package/dist/esm/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as LinterCliOptions } from "./options-D_PtlSKK.js";
1
+ import { i as LinterCliOptions } from "./options-CeDseSxu.js";
2
2
  import { Command } from "commander";
3
3
 
4
4
  //#region src/util/errors.d.ts
package/dist/esm/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CheckFailed, S as ApplicationError, _ as padLeft, a as parseApplicationFeatureFlags, b as pruneAnsiTextStart, c as listDictionaries, d as validateUnitSize, f as unindent, g as tableToLines, i as lint, l as ReportChoicesAll, m as npmPackage, n as checkText, o as suggestions, p as DEFAULT_CACHE_LOCATION, r as createInit, s as trace, t as IncludeExcludeFlag, u as cvtLinterCliCommandOptionsToLinterCliOptions, v as padWidth, w as console, x as width, y as pruneAnsiTextEnd } from "./application-DaQrXF9X.js";
1
+ import { C as CheckFailed, S as ApplicationError, _ as padLeft, a as parseApplicationFeatureFlags, b as pruneAnsiTextStart, c as listDictionaries, d as validateUnitSize, f as unindent, g as tableToLines, i as lint, l as ReportChoicesAll, m as npmPackage, n as checkText, o as suggestions, p as DEFAULT_CACHE_LOCATION, r as createInit, s as trace, t as IncludeExcludeFlag, u as cvtLinterCliCommandOptionsToLinterCliOptions, v as padWidth, w as console, x as width, y as pruneAnsiTextEnd } from "./application-DxeSY2Ho.js";
2
2
  import { Link } from "cspell-lib";
3
3
  import chalk from "chalk";
4
4
  import * as iPath from "node:path";
@@ -61,16 +61,16 @@ function crOpt(name, description, parseArg, defaultValue) {
61
61
 
62
62
  //#endregion
63
63
  //#region src/emitters/helpers.ts
64
- function trimMidPath(s, w, sep$1) {
64
+ function trimMidPath(s, w, sep) {
65
65
  if (s.length <= w) return s;
66
- const parts = s.split(sep$1);
66
+ const parts = s.split(sep);
67
67
  if (parts[parts.length - 1].length > w) return trimMid(s, w);
68
- function join(left$1, right$1) {
68
+ function join(left, right) {
69
69
  return [
70
- ...parts.slice(0, left$1),
70
+ ...parts.slice(0, left),
71
71
  "…",
72
- ...parts.slice(right$1)
73
- ].join(sep$1);
72
+ ...parts.slice(right)
73
+ ].join(sep);
74
74
  }
75
75
  let left = 0, right = parts.length, last = "";
76
76
  for (let i = 0; i < parts.length; ++i) {
@@ -101,15 +101,15 @@ function trimMid(s, w) {
101
101
  const r = Math.ceil((w - 1) / 2);
102
102
  return s.slice(0, l) + "…" + s.slice(-r);
103
103
  }
104
- function formatDictionaryLocation(dictSource, maxWidth$2, { cwd, dictionaryPathFormat: format, iPath: iPath$1 }) {
105
- let relPath = cwd ? iPath$1.relative(cwd, dictSource) : dictSource;
104
+ function formatDictionaryLocation(dictSource, maxWidth, { cwd, dictionaryPathFormat: format, iPath }) {
105
+ let relPath = cwd ? iPath.relative(cwd, dictSource) : dictSource;
106
106
  const idxNodeModule = relPath.lastIndexOf("node_modules");
107
107
  const isNodeModule = idxNodeModule >= 0;
108
108
  if (format === "hide") return "";
109
- if (format === "short") return (isNodeModule ? "[node_modules]/" : relPath.startsWith(".." + iPath$1.sep + "..") ? "…/" : relPath.startsWith(".." + iPath$1.sep) ? "../" : "") + iPath$1.basename(dictSource);
109
+ if (format === "short") return (isNodeModule ? "[node_modules]/" : relPath.startsWith(".." + iPath.sep + "..") ? "…/" : relPath.startsWith(".." + iPath.sep) ? "../" : "") + iPath.basename(dictSource);
110
110
  if (format === "full") return dictSource;
111
111
  relPath = isNodeModule ? relPath.slice(idxNodeModule) : relPath;
112
- return trimMidPath(relPath.length < dictSource.length ? relPath : dictSource, maxWidth$2, iPath$1.sep);
112
+ return trimMidPath(relPath.length < dictSource.length ? relPath : dictSource, maxWidth, iPath.sep);
113
113
  }
114
114
 
115
115
  //#endregion
@@ -155,10 +155,10 @@ function calcHeaders(options) {
155
155
  function emitDictResult(r, options) {
156
156
  const a = r.enabled ? "*" : " ";
157
157
  const dictColor = r.enabled ? chalk.yellowBright : chalk.rgb(200, 128, 50);
158
- const n = (width$1) => dictColor(pruneAnsiTextEnd(r.name, width$1 && width$1 - a.length) + a);
158
+ const n = (width) => dictColor(pruneAnsiTextEnd(r.name, width && width - a.length) + a);
159
159
  const c = colorize$1(chalk.white);
160
- const locales = (width$1) => c(pruneAnsiTextEnd(r.locales?.join(",") || "", width$1));
161
- const fileTypes = (width$1) => c(pruneAnsiTextEnd(r.fileTypes?.join(",") || "", width$1));
160
+ const locales = (width) => c(pruneAnsiTextEnd(r.locales?.join(",") || "", width));
161
+ const fileTypes = (width) => c(pruneAnsiTextEnd(r.fileTypes?.join(",") || "", width));
162
162
  if (!r.path) return {
163
163
  name: n,
164
164
  location: c(r.inline?.join(", ") || ""),
@@ -442,32 +442,32 @@ function increaseVerbosity(_dummyValue, previous) {
442
442
  //#region src/emitters/suggestionsEmitter.ts
443
443
  const regExpRTL = /([ \u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]+)/g;
444
444
  function reverseRtlText(s) {
445
- return s.replaceAll(regExpRTL, (s$1) => [...s$1].reverse().join(""));
445
+ return s.replaceAll(regExpRTL, (s) => [...s].reverse().join(""));
446
446
  }
447
447
  function emitSuggestionResult(result, options) {
448
- const { word, suggestions: suggestions$1 } = result;
448
+ const { word, suggestions } = result;
449
449
  const { verbose, output = console } = options;
450
450
  const elapsed = verbose && verbose > 1 && result.elapsedTimeMs ? ` ${result.elapsedTimeMs.toFixed(2)} ms` : "";
451
451
  const rWord = reverseRtlText(word);
452
452
  const wordEx = rWord !== word ? ` (${chalk.yellow(rWord)})` : "";
453
453
  output.log((word ? chalk.yellow(word) + wordEx : chalk.yellow("<empty>")) + ":" + elapsed);
454
- if (!suggestions$1.length) {
454
+ if (!suggestions.length) {
455
455
  console.log(chalk.yellow(" <no suggestions>"));
456
456
  return;
457
457
  }
458
- function handleRtl(word$1) {
459
- const r = reverseRtlText(word$1);
460
- return r === word$1 ? word$1 : `${word$1} (${r})`;
458
+ function handleRtl(word) {
459
+ const r = reverseRtlText(word);
460
+ return r === word ? word : `${word} (${r})`;
461
461
  }
462
462
  if (verbose) {
463
- const mappedSugs = suggestions$1.map((s) => ({
463
+ const mappedSugs = suggestions.map((s) => ({
464
464
  ...s,
465
465
  w: handleRtl(s.compoundWord || s.wordAdjustedToMatchCase || s.word)
466
466
  }));
467
- const maxWidth$2 = mappedSugs.map((s) => width(s.w)).reduce((max, len) => Math.max(max, len), 0);
467
+ const maxWidth = mappedSugs.map((s) => width(s.w)).reduce((max, len) => Math.max(max, len), 0);
468
468
  for (const sug of mappedSugs) {
469
469
  const { cost, dictionaries, w } = sug;
470
- const padding = " ".repeat(padWidth(w, maxWidth$2));
470
+ const padding = " ".repeat(padWidth(w, maxWidth));
471
471
  const forbid = sug.forbidden && sug.isPreferred ? chalk.red("*") : sug.forbidden ? chalk.red("X") : sug.isPreferred ? chalk.yellow("*") : " ";
472
472
  const ignore = sug.noSuggest ? chalk.yellow("N") : " ";
473
473
  const strCost = padLeft(cost.toString(10), 4);
@@ -475,7 +475,7 @@ function emitSuggestionResult(result, options) {
475
475
  output.log(` - ${formatWord(w, sug)}${padding} ${forbid}${ignore} - ${chalk.yellow(strCost)} ${dicts}`);
476
476
  }
477
477
  } else {
478
- const mappedSugs = suggestions$1.map((s) => ({
478
+ const mappedSugs = suggestions.map((s) => ({
479
479
  ...s,
480
480
  word: handleRtl(s.wordAdjustedToMatchCase || s.word)
481
481
  }));
@@ -1,4 +1,4 @@
1
- import { a as SuggestionOptions, i as LinterCliOptions, n as DictionariesOptions, o as TraceOptions, r as LegacyOptions, t as BaseOptions } from "./options-D_PtlSKK.js";
1
+ import { a as SuggestionOptions, i as LinterCliOptions, n as DictionariesOptions, o as TraceOptions, r as LegacyOptions, t as BaseOptions } from "./options-CeDseSxu.js";
2
2
  import { CheckTextInfo, FeatureFlags, IncludeExcludeFlag, SuggestionsForWordResult, TraceResult, TraceWordResult } from "cspell-lib";
3
3
  import { CSpellReporter, RunResult } from "@cspell/cspell-types";
4
4
 
@@ -113,4 +113,4 @@ declare function createInit(options: InitOptions): Promise<void>;
113
113
  declare function parseApplicationFeatureFlags(flags: string[] | undefined): FeatureFlags;
114
114
  //#endregion
115
115
  export { checkText as a, parseApplicationFeatureFlags as c, listDictionaries as d, TraceResult as i, suggestions as l, CheckTextResult as n, createInit as o, IncludeExcludeFlag as r, lint as s, AppError as t, trace as u };
116
- //# sourceMappingURL=application-Ce_s5c1d.d.ts.map
116
+ //# sourceMappingURL=application-5MjpInZh.d.ts.map