cspell 9.0.1 → 9.1.0
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 +78 -59
- package/dist/esm/app.mjs +4 -15
- package/dist/esm/application.d.mts +3 -1
- package/dist/esm/application.mjs +14 -6
- package/dist/esm/cli-reporter.js +2 -1
- package/dist/esm/commandConfig.d.ts +3 -0
- package/dist/esm/commandConfig.js +18 -0
- package/dist/esm/commandDictionaries.d.ts +3 -0
- package/dist/esm/commandDictionaries.js +40 -0
- package/dist/esm/commandHelpers.d.ts +18 -0
- package/dist/esm/commandHelpers.js +30 -0
- package/dist/esm/commandInit.d.ts +3 -0
- package/dist/esm/commandInit.js +25 -0
- package/dist/esm/commandLint.js +13 -26
- package/dist/esm/commandTrace.js +2 -0
- package/dist/esm/config/adjustConfig.d.ts +7 -0
- package/dist/esm/config/adjustConfig.js +137 -0
- package/dist/esm/config/config.d.ts +5 -0
- package/dist/esm/config/config.js +18 -0
- package/dist/esm/config/configInit.d.ts +3 -0
- package/dist/esm/config/configInit.js +104 -0
- package/dist/esm/config/constants.d.ts +17 -0
- package/dist/esm/config/constants.js +23 -0
- package/dist/esm/config/index.d.ts +3 -0
- package/dist/esm/config/index.js +2 -0
- package/dist/esm/config/options.d.ts +62 -0
- package/dist/esm/config/options.js +2 -0
- package/dist/esm/config/updateConfig.d.ts +3 -0
- package/dist/esm/config/updateConfig.js +2 -0
- package/dist/esm/dictionaries/index.d.ts +3 -0
- package/dist/esm/dictionaries/index.js +2 -0
- package/dist/esm/dictionaries/listDictionaries.d.ts +33 -0
- package/dist/esm/dictionaries/listDictionaries.js +131 -0
- package/dist/esm/emitters/dictionaryListEmitter.d.ts +19 -0
- package/dist/esm/emitters/dictionaryListEmitter.js +82 -0
- package/dist/esm/emitters/helpers.d.ts +14 -0
- package/dist/esm/emitters/helpers.js +67 -0
- package/dist/esm/emitters/traceEmitter.d.ts +1 -10
- package/dist/esm/emitters/traceEmitter.js +1 -69
- package/dist/esm/lint/LintRequest.d.ts +3 -2
- package/dist/esm/lint/LintRequest.js +41 -5
- package/dist/esm/lint/index.d.ts +1 -1
- package/dist/esm/lint/index.js +1 -1
- package/dist/esm/lint/lint.js +28 -66
- package/dist/esm/options.d.ts +101 -4
- package/dist/esm/options.js +1 -0
- package/dist/esm/pkgInfo.d.ts +1 -1
- package/dist/esm/pkgInfo.js +1 -1
- package/dist/esm/util/InMemoryReporter.d.ts +10 -7
- package/dist/esm/util/InMemoryReporter.js +20 -13
- package/dist/esm/util/LintFileResult.d.ts +14 -0
- package/dist/esm/util/LintFileResult.js +2 -0
- package/dist/esm/util/cache/CSpellLintResultCache.d.ts +3 -3
- package/dist/esm/util/cache/DiskCache.d.ts +4 -4
- package/dist/esm/util/configFileHelper.d.ts +1 -1
- package/dist/esm/util/configFileHelper.js +2 -2
- package/dist/esm/util/extractContext.d.ts +5 -0
- package/dist/esm/util/extractContext.js +75 -0
- package/dist/esm/util/fileHelper.d.ts +2 -11
- package/dist/esm/util/fileHelper.js +9 -1
- package/dist/esm/util/pad.d.ts +16 -0
- package/dist/esm/util/pad.js +61 -1
- package/dist/esm/util/reporters.d.ts +21 -5
- package/dist/esm/util/reporters.js +178 -31
- package/dist/esm/util/table.d.ts +31 -4
- package/dist/esm/util/table.js +76 -16
- package/dist/esm/util/util.d.ts +5 -0
- package/dist/esm/util/util.js +5 -0
- package/package.json +16 -15
|
@@ -1,37 +1,40 @@
|
|
|
1
|
+
import assert from 'node:assert';
|
|
2
|
+
import { IssueType, unknownWordsChoices, } from '@cspell/cspell-types';
|
|
1
3
|
import { dynamicImport } from '@cspell/dynamic-import';
|
|
2
4
|
import { pkgDir } from '../pkgInfo.js';
|
|
3
5
|
import { ApplicationError, toError } from './errors.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
import { clean } from './util.js';
|
|
7
|
+
function filterFeatureIssues(features, issue, reportOptions) {
|
|
8
|
+
if (issue.issueType === IssueType.directive) {
|
|
9
|
+
return (features?.issueType && reportOptions?.validateDirectives) || false;
|
|
10
|
+
}
|
|
11
|
+
if (features?.unknownWords) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (!reportOptions) {
|
|
15
|
+
// If no options are provided, report the issue.
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
// The reporter doesn't support the `unknownWords` feature. Handle the logic here.
|
|
19
|
+
let reportIssue = issue.isFlagged;
|
|
20
|
+
reportIssue ||= !reportOptions.unknownWords || reportOptions.unknownWords === unknownWordsChoices.ReportAll;
|
|
21
|
+
reportIssue ||= reportOptions.unknownWords === unknownWordsChoices.ReportSimple && issue.hasSimpleSuggestions;
|
|
22
|
+
reportIssue ||=
|
|
23
|
+
reportOptions.unknownWords === unknownWordsChoices.ReportCommonTypos && issue.hasPreferredSuggestions;
|
|
24
|
+
return reportIssue || false;
|
|
22
25
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
function handleIssue(reporter, issue, reportOptions) {
|
|
27
|
+
if (!reporter.issue)
|
|
28
|
+
return;
|
|
29
|
+
if (!filterFeatureIssues(reporter.features, issue, reportOptions)) {
|
|
30
|
+
// The reporter does not want to handle this issue.
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (!reporter.features?.contextGeneration && !issue.context) {
|
|
34
|
+
issue = { ...issue };
|
|
35
|
+
issue.context = issue.line; // Ensure context is always set if the reporter does not support context generation.
|
|
36
|
+
}
|
|
37
|
+
return reporter.issue(issue, reportOptions);
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
40
|
* Loads reporter modules configured in cspell config file
|
|
@@ -57,6 +60,150 @@ export async function loadReporters(reporters, defaultReporter, config) {
|
|
|
57
60
|
return loadedReporters.filter((v) => v !== undefined);
|
|
58
61
|
}
|
|
59
62
|
export function finalizeReporter(reporter) {
|
|
60
|
-
|
|
63
|
+
if (!reporter)
|
|
64
|
+
return undefined;
|
|
65
|
+
if (reporterIsFinalized(reporter)) {
|
|
66
|
+
return reporter;
|
|
67
|
+
}
|
|
68
|
+
const final = {
|
|
69
|
+
issue: (...params) => reporter.issue?.(...params),
|
|
70
|
+
info: (...params) => reporter.info?.(...params),
|
|
71
|
+
debug: (...params) => reporter.debug?.(...params),
|
|
72
|
+
progress: (...params) => reporter.progress?.(...params),
|
|
73
|
+
error: (...params) => reporter.error?.(...params),
|
|
74
|
+
result: (...params) => reporter.result?.(...params),
|
|
75
|
+
features: reporter.features,
|
|
76
|
+
};
|
|
77
|
+
return final;
|
|
78
|
+
}
|
|
79
|
+
function reporterIsFinalized(reporter) {
|
|
80
|
+
return ((!!reporter &&
|
|
81
|
+
reporter.features &&
|
|
82
|
+
typeof reporter.issue === 'function' &&
|
|
83
|
+
typeof reporter.info === 'function' &&
|
|
84
|
+
typeof reporter.debug === 'function' &&
|
|
85
|
+
typeof reporter.error === 'function' &&
|
|
86
|
+
typeof reporter.progress === 'function' &&
|
|
87
|
+
typeof reporter.result === 'function') ||
|
|
88
|
+
false);
|
|
89
|
+
}
|
|
90
|
+
const reportIssueOptionsKeyMap = {
|
|
91
|
+
unknownWords: 'unknownWords',
|
|
92
|
+
validateDirectives: 'validateDirectives',
|
|
93
|
+
showContext: 'showContext',
|
|
94
|
+
};
|
|
95
|
+
function setValue(options, key, value) {
|
|
96
|
+
if (value !== undefined) {
|
|
97
|
+
options[key] = value;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export function extractReporterIssueOptions(settings) {
|
|
101
|
+
const src = settings;
|
|
102
|
+
const options = {};
|
|
103
|
+
for (const key in reportIssueOptionsKeyMap) {
|
|
104
|
+
const k = key;
|
|
105
|
+
setValue(options, k, src[k]);
|
|
106
|
+
}
|
|
107
|
+
return options;
|
|
108
|
+
}
|
|
109
|
+
export function mergeReportIssueOptions(a, b) {
|
|
110
|
+
const options = extractReporterIssueOptions(a);
|
|
111
|
+
if (!b)
|
|
112
|
+
return options;
|
|
113
|
+
for (const key in reportIssueOptionsKeyMap) {
|
|
114
|
+
const k = key;
|
|
115
|
+
setValue(options, k, b[k]);
|
|
116
|
+
}
|
|
117
|
+
return options;
|
|
118
|
+
}
|
|
119
|
+
export class LintReporter {
|
|
120
|
+
defaultReporter;
|
|
121
|
+
#reporters = [];
|
|
122
|
+
#config;
|
|
123
|
+
#finalized = false;
|
|
124
|
+
constructor(defaultReporter, config) {
|
|
125
|
+
this.defaultReporter = defaultReporter;
|
|
126
|
+
this.#config = config;
|
|
127
|
+
if (defaultReporter) {
|
|
128
|
+
this.#reporters.push(finalizeReporter(defaultReporter));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
get config() {
|
|
132
|
+
return this.#config;
|
|
133
|
+
}
|
|
134
|
+
set config(config) {
|
|
135
|
+
assert(!this.#finalized, 'Cannot change the configuration of a finalized reporter');
|
|
136
|
+
this.#config = config;
|
|
137
|
+
}
|
|
138
|
+
issue(issue, reportOptions) {
|
|
139
|
+
for (const reporter of this.#reporters) {
|
|
140
|
+
handleIssue(reporter, issue, reportOptions);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
info(...params) {
|
|
144
|
+
for (const reporter of this.#reporters) {
|
|
145
|
+
reporter.info(...params);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
debug(...params) {
|
|
149
|
+
for (const reporter of this.#reporters) {
|
|
150
|
+
reporter.debug(...params);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
error(...params) {
|
|
154
|
+
for (const reporter of this.#reporters) {
|
|
155
|
+
reporter.error(...params);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
progress(...params) {
|
|
159
|
+
for (const reporter of this.#reporters) {
|
|
160
|
+
reporter.progress(...params);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
async result(result) {
|
|
164
|
+
await Promise.all(this.#reporters.map((reporter) => reporter.result?.(result)));
|
|
165
|
+
}
|
|
166
|
+
get features() {
|
|
167
|
+
return {
|
|
168
|
+
unknownWords: true,
|
|
169
|
+
issueType: true,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
async loadReportersAndFinalize(reporters) {
|
|
173
|
+
assert(!this.#finalized, 'Cannot change the configuration of a finalized reporter');
|
|
174
|
+
const loaded = await loadReporters(reporters, this.defaultReporter, this.config);
|
|
175
|
+
this.#reporters = [...new Set(loaded)].map((reporter) => finalizeReporter(reporter));
|
|
176
|
+
}
|
|
177
|
+
emitProgressBegin(filename, fileNum, fileCount) {
|
|
178
|
+
this.progress({
|
|
179
|
+
type: 'ProgressFileBegin',
|
|
180
|
+
fileNum,
|
|
181
|
+
fileCount,
|
|
182
|
+
filename,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
emitProgressComplete(filename, fileNum, fileCount, result) {
|
|
186
|
+
const filteredIssues = result.issues.filter((issue) => filterFeatureIssues({}, issue, result.reportIssueOptions));
|
|
187
|
+
const numIssues = filteredIssues.length;
|
|
188
|
+
for (const reporter of this.#reporters) {
|
|
189
|
+
const progress = clean({
|
|
190
|
+
type: 'ProgressFileComplete',
|
|
191
|
+
fileNum,
|
|
192
|
+
fileCount,
|
|
193
|
+
filename,
|
|
194
|
+
elapsedTimeMs: result.elapsedTimeMs,
|
|
195
|
+
processed: result.processed,
|
|
196
|
+
numErrors: numIssues || result.errors,
|
|
197
|
+
cached: result.cached,
|
|
198
|
+
perf: result.perf,
|
|
199
|
+
issues: reporter.features && result.issues,
|
|
200
|
+
reportIssueOptions: reporter.features && result.reportIssueOptions,
|
|
201
|
+
});
|
|
202
|
+
reporter.progress(progress);
|
|
203
|
+
}
|
|
204
|
+
// Show the spelling errors after emitting the progress.
|
|
205
|
+
result.issues.forEach((issue) => this.issue(issue, result.reportIssueOptions));
|
|
206
|
+
return numIssues;
|
|
207
|
+
}
|
|
61
208
|
}
|
|
62
209
|
//# sourceMappingURL=reporters.js.map
|
package/dist/esm/util/table.d.ts
CHANGED
|
@@ -1,14 +1,41 @@
|
|
|
1
1
|
export type RowTextFn = (maxWidth: number | undefined) => string;
|
|
2
2
|
export type TableCell = string | RowTextFn;
|
|
3
|
-
export type TableRow = TableCell[]
|
|
3
|
+
export type TableRow = TableCell[] | Record<string, TableCell>;
|
|
4
|
+
export type TableHeaderColumnFieldTitle = [field: string, title: string];
|
|
5
|
+
export type TableHeader = string[] | TableHeaderColumnFieldTitle[];
|
|
6
|
+
export type TextDecorator = (t: string, columnIndex: number) => string;
|
|
7
|
+
export interface MaxColumnWidths {
|
|
8
|
+
/**
|
|
9
|
+
* [field name or column index]: number of characters
|
|
10
|
+
*/
|
|
11
|
+
[column: string | number]: number | undefined;
|
|
12
|
+
}
|
|
4
13
|
export interface Table {
|
|
5
|
-
|
|
14
|
+
/**
|
|
15
|
+
* The header of the table.
|
|
16
|
+
* Can be an array of strings or an array of tuples with field name and title.
|
|
17
|
+
*/
|
|
18
|
+
header: TableHeader;
|
|
19
|
+
/**
|
|
20
|
+
* The rows of the table.
|
|
21
|
+
* Can be an array of arrays or an array of objects with field names as keys.
|
|
22
|
+
*/
|
|
6
23
|
rows: TableRow[];
|
|
24
|
+
/**
|
|
25
|
+
* The width of the terminal, used to adjust column widths.
|
|
26
|
+
*/
|
|
7
27
|
terminalWidth?: number;
|
|
28
|
+
/**
|
|
29
|
+
* The deliminator used to separate columns in the table.
|
|
30
|
+
* Defaults to ' | ' if not provided.
|
|
31
|
+
*/
|
|
8
32
|
deliminator?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The maximum widths for each column.
|
|
35
|
+
* If provided, it will override the calculated widths.
|
|
36
|
+
*/
|
|
37
|
+
maxColumnWidths?: MaxColumnWidths;
|
|
9
38
|
}
|
|
10
39
|
export declare function tableToLines(table: Table, deliminator?: string): string[];
|
|
11
|
-
type TextDecorator = (t: string, index: number) => string;
|
|
12
40
|
export declare function decorateRowWith(row: string[], ...decorators: TextDecorator[]): string[];
|
|
13
|
-
export {};
|
|
14
41
|
//# sourceMappingURL=table.d.ts.map
|
package/dist/esm/util/table.js
CHANGED
|
@@ -1,48 +1,108 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { ansiWidth, pad } from './pad.js';
|
|
2
|
+
import { ansiWidth, pad, pruneTextEnd } from './pad.js';
|
|
3
3
|
export function tableToLines(table, deliminator) {
|
|
4
4
|
const del = deliminator || table.deliminator || ' | ';
|
|
5
5
|
const columnWidths = [];
|
|
6
|
+
const maxColumnWidthsMap = table.maxColumnWidths || {};
|
|
6
7
|
const { header, rows } = table;
|
|
8
|
+
const simpleHeader = header.map((col) => (Array.isArray(col) ? col[1] : col));
|
|
9
|
+
const columnFieldNames = header.map((col) => (Array.isArray(col) ? col[0] : col));
|
|
10
|
+
const maxColumnWidths = columnFieldNames.map((field, idx) => maxColumnWidthsMap[field] ?? maxColumnWidthsMap[idx]);
|
|
11
|
+
function getCell(row, col) {
|
|
12
|
+
return getCellFromRow(rows[row], col);
|
|
13
|
+
}
|
|
14
|
+
function getCellFromRow(row, col) {
|
|
15
|
+
if (!row)
|
|
16
|
+
return undefined;
|
|
17
|
+
if (Array.isArray(row)) {
|
|
18
|
+
return row[col];
|
|
19
|
+
}
|
|
20
|
+
const fieldName = columnFieldNames[col];
|
|
21
|
+
return row[fieldName];
|
|
22
|
+
}
|
|
23
|
+
function rowToCells(row) {
|
|
24
|
+
if (Array.isArray(row)) {
|
|
25
|
+
return row;
|
|
26
|
+
}
|
|
27
|
+
return columnFieldNames.map((fieldName) => row[fieldName]);
|
|
28
|
+
}
|
|
7
29
|
function getText(col, maxWidth) {
|
|
8
|
-
return typeof col === 'string' ? col : col(maxWidth);
|
|
30
|
+
return !col ? '' : typeof col === 'string' ? pruneTextEnd(col, maxWidth) : col(maxWidth);
|
|
9
31
|
}
|
|
10
32
|
function getRCText(row, col, maxWidth) {
|
|
11
|
-
return getText(
|
|
33
|
+
return getText(getCell(row, col), maxWidth);
|
|
12
34
|
}
|
|
13
35
|
function recordHeaderWidths(header) {
|
|
14
36
|
header.forEach((col, idx) => {
|
|
15
37
|
columnWidths[idx] = Math.max(ansiWidth(col), columnWidths[idx] || 0);
|
|
16
38
|
});
|
|
17
39
|
}
|
|
18
|
-
function recordColWidths(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
40
|
+
function recordColWidths() {
|
|
41
|
+
for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
|
|
42
|
+
for (let colIndex = 0; colIndex < columnFieldNames.length; colIndex++) {
|
|
43
|
+
columnWidths[colIndex] = Math.max(ansiWidth(getRCText(rowIndex, colIndex, undefined)), columnWidths[colIndex] || 0);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
22
46
|
}
|
|
23
47
|
function justifyRow(c, i) {
|
|
24
48
|
return pad(c, columnWidths[i]);
|
|
25
49
|
}
|
|
50
|
+
function toHeaderLine(header) {
|
|
51
|
+
return decorateRowWith(header.map((c, i) => getText(c, columnWidths[i])), justifyRow, headerDecorator).join(del);
|
|
52
|
+
}
|
|
26
53
|
function toLine(row) {
|
|
27
|
-
return decorateRowWith(row.map((c, i) => getText(c, columnWidths[i])), justifyRow).join(del);
|
|
54
|
+
return decorateRowWith(rowToCells(row).map((c, i) => getText(c, columnWidths[i])), justifyRow).join(del);
|
|
28
55
|
}
|
|
29
56
|
function* process() {
|
|
30
|
-
yield
|
|
57
|
+
yield toHeaderLine(simpleHeader);
|
|
31
58
|
yield* rows.map(toLine);
|
|
32
59
|
}
|
|
60
|
+
function sumColumnWidths() {
|
|
61
|
+
return columnWidths.reduce((sum, width) => sum + width, 0);
|
|
62
|
+
}
|
|
33
63
|
function adjustColWidths() {
|
|
64
|
+
for (let i = 0; i < columnWidths.length; i++) {
|
|
65
|
+
const mw = maxColumnWidths[i];
|
|
66
|
+
if (!mw)
|
|
67
|
+
continue;
|
|
68
|
+
columnWidths[i] = Math.min(columnWidths[i], mw);
|
|
69
|
+
}
|
|
34
70
|
if (!table.terminalWidth)
|
|
35
71
|
return;
|
|
36
72
|
const dWidth = (columnWidths.length - 1) * ansiWidth(del);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
73
|
+
const lineWidth = table.terminalWidth - dWidth;
|
|
74
|
+
if (lineWidth <= columnWidths.length * 2) {
|
|
75
|
+
const fixedWidth = Math.max(Math.min(...columnWidths), 5);
|
|
76
|
+
for (let i = 0; i < columnWidths.length; i++) {
|
|
77
|
+
columnWidths[i] = fixedWidth;
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (columnWidths.length === 1) {
|
|
82
|
+
columnWidths[0] = lineWidth;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
function trimWidestColumn(neededToTrim) {
|
|
86
|
+
let first = 0;
|
|
87
|
+
let second = 0;
|
|
88
|
+
for (let i = 0; i < columnWidths.length; i++) {
|
|
89
|
+
if (columnWidths[i] > columnWidths[first]) {
|
|
90
|
+
second = first;
|
|
91
|
+
first = i;
|
|
92
|
+
}
|
|
93
|
+
else if (columnWidths[i] > columnWidths[second]) {
|
|
94
|
+
second = i;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const diff = Math.max(columnWidths[first] - columnWidths[second], 1);
|
|
98
|
+
columnWidths[first] -= Math.min(diff, neededToTrim);
|
|
99
|
+
}
|
|
100
|
+
for (let sum = sumColumnWidths(); sum > lineWidth; sum = sumColumnWidths()) {
|
|
101
|
+
trimWidestColumn(sum - lineWidth);
|
|
42
102
|
}
|
|
43
103
|
}
|
|
44
|
-
recordHeaderWidths(
|
|
45
|
-
|
|
104
|
+
recordHeaderWidths(simpleHeader);
|
|
105
|
+
recordColWidths();
|
|
46
106
|
adjustColWidths();
|
|
47
107
|
return [...process()];
|
|
48
108
|
}
|
package/dist/esm/util/util.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ type FilterFn<T> = (_v: T) => boolean;
|
|
|
4
4
|
export declare function uniqueFilterFnGenerator<T>(): FilterFn<T>;
|
|
5
5
|
export declare function uniqueFilterFnGenerator<T, U>(extractFn: (v: T) => U): FilterFn<T>;
|
|
6
6
|
export declare function unique<T>(src: T[]): T[];
|
|
7
|
+
/**
|
|
8
|
+
* Removed all properties with a value of `undefined` from the object.
|
|
9
|
+
* @param src - the object to clean.
|
|
10
|
+
* @returns the same object with all properties with a value of `undefined` removed.
|
|
11
|
+
*/
|
|
7
12
|
export declare function clean<T extends object>(src: T): RemoveUndefined<T>;
|
|
8
13
|
export {};
|
|
9
14
|
//# sourceMappingURL=util.d.ts.map
|
package/dist/esm/util/util.js
CHANGED
|
@@ -13,6 +13,11 @@ export function uniqueFilterFnGenerator(extractFn) {
|
|
|
13
13
|
export function unique(src) {
|
|
14
14
|
return [...new Set(src)];
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Removed all properties with a value of `undefined` from the object.
|
|
18
|
+
* @param src - the object to clean.
|
|
19
|
+
* @returns the same object with all properties with a value of `undefined` removed.
|
|
20
|
+
*/
|
|
16
21
|
export function clean(src) {
|
|
17
22
|
const r = src;
|
|
18
23
|
for (const key of Object.keys(r)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "A Spelling Checker for Code!",
|
|
5
5
|
"funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",
|
|
6
6
|
"bin": {
|
|
@@ -81,23 +81,24 @@
|
|
|
81
81
|
},
|
|
82
82
|
"homepage": "https://cspell.org/",
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@cspell/cspell-json-reporter": "9.0
|
|
85
|
-
"@cspell/cspell-pipe": "9.0
|
|
86
|
-
"@cspell/cspell-types": "9.0
|
|
87
|
-
"@cspell/dynamic-import": "9.0
|
|
88
|
-
"@cspell/url": "9.0
|
|
84
|
+
"@cspell/cspell-json-reporter": "9.1.0",
|
|
85
|
+
"@cspell/cspell-pipe": "9.1.0",
|
|
86
|
+
"@cspell/cspell-types": "9.1.0",
|
|
87
|
+
"@cspell/dynamic-import": "9.1.0",
|
|
88
|
+
"@cspell/url": "9.1.0",
|
|
89
89
|
"chalk": "^5.4.1",
|
|
90
90
|
"chalk-template": "^1.1.0",
|
|
91
|
-
"commander": "^
|
|
92
|
-
"cspell-
|
|
93
|
-
"cspell-
|
|
94
|
-
"cspell-
|
|
95
|
-
"cspell-
|
|
96
|
-
"cspell-
|
|
91
|
+
"commander": "^14.0.0",
|
|
92
|
+
"cspell-config-lib": "9.1.0",
|
|
93
|
+
"cspell-dictionary": "9.1.0",
|
|
94
|
+
"cspell-gitignore": "9.1.0",
|
|
95
|
+
"cspell-glob": "9.1.0",
|
|
96
|
+
"cspell-io": "9.1.0",
|
|
97
|
+
"cspell-lib": "9.1.0",
|
|
97
98
|
"fast-json-stable-stringify": "^2.1.0",
|
|
98
99
|
"file-entry-cache": "^9.1.0",
|
|
99
|
-
"semver": "^7.7.
|
|
100
|
-
"tinyglobby": "^0.2.
|
|
100
|
+
"semver": "^7.7.2",
|
|
101
|
+
"tinyglobby": "^0.2.14"
|
|
101
102
|
},
|
|
102
103
|
"engines": {
|
|
103
104
|
"node": ">=20"
|
|
@@ -110,5 +111,5 @@
|
|
|
110
111
|
"micromatch": "^4.0.8",
|
|
111
112
|
"minimatch": "^9.0.5"
|
|
112
113
|
},
|
|
113
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "a7ed42a31debbc86faa4a4ac2c686bdffe5b26b6"
|
|
114
115
|
}
|