editorconfig 1.0.1 → 1.0.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/lib/index.d.ts +6 -6
- package/lib/index.js +4 -2
- package/package.json +16 -17
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import
|
|
2
|
+
import { Minimatch } from 'minimatch';
|
|
3
3
|
export interface KnownProps {
|
|
4
4
|
end_of_line?: 'lf' | 'crlf' | 'unset';
|
|
5
5
|
indent_style?: 'tab' | 'space' | 'unset';
|
|
@@ -12,13 +12,13 @@ export interface KnownProps {
|
|
|
12
12
|
interface UnknownMap {
|
|
13
13
|
[index: string]: unknown;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type Props = KnownProps & UnknownMap;
|
|
16
16
|
export interface ECFile {
|
|
17
17
|
name: string;
|
|
18
18
|
contents?: Buffer;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
type SectionGlob = Minimatch | null;
|
|
21
|
+
type GlobbedProps = [SectionName, Props, SectionGlob][];
|
|
22
22
|
export interface ProcessedFileConfig {
|
|
23
23
|
root: boolean;
|
|
24
24
|
name: string;
|
|
@@ -40,11 +40,11 @@ export interface ParseOptions {
|
|
|
40
40
|
files?: Visited[];
|
|
41
41
|
cache?: Cache;
|
|
42
42
|
}
|
|
43
|
-
export
|
|
43
|
+
export type SectionName = string | null;
|
|
44
44
|
export interface SectionBody {
|
|
45
45
|
[key: string]: string;
|
|
46
46
|
}
|
|
47
|
-
export
|
|
47
|
+
export type ParseStringResult = [SectionName, SectionBody][];
|
|
48
48
|
/**
|
|
49
49
|
* Parse a buffer using the faster one-ini WASM approach into something
|
|
50
50
|
* relatively easy to deal with in JS.
|
package/lib/index.js
CHANGED
|
@@ -30,7 +30,7 @@ exports.parseSync = exports.parse = exports.parseFromFilesSync = exports.parseFr
|
|
|
30
30
|
const fs = __importStar(require("fs"));
|
|
31
31
|
const path = __importStar(require("path"));
|
|
32
32
|
const semver = __importStar(require("semver"));
|
|
33
|
-
const minimatch_1 =
|
|
33
|
+
const minimatch_1 = require("minimatch");
|
|
34
34
|
const wasm_1 = require("@one-ini/wasm");
|
|
35
35
|
// @ts-ignore So we can set the rootDir to be 'lib', without processing
|
|
36
36
|
// package.json
|
|
@@ -160,7 +160,7 @@ function buildFullGlob(pathPrefix, glob) {
|
|
|
160
160
|
// star_star_over_separator{1,3,5,6,9,15}
|
|
161
161
|
glob = glob.replace(/\*\*/g, '{*,**/**/**}');
|
|
162
162
|
// NOT path.join. Must stay in forward slashes.
|
|
163
|
-
return new minimatch_1.
|
|
163
|
+
return new minimatch_1.Minimatch(`${pathPrefix}/${glob}`, matchOptions);
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* Normalize the properties read from a config file so that their key names
|
|
@@ -177,6 +177,7 @@ function normalizeProps(options) {
|
|
|
177
177
|
const value = options[key];
|
|
178
178
|
const key2 = key.toLowerCase();
|
|
179
179
|
let value2 = value;
|
|
180
|
+
// @ts-ignore -- Fix types here
|
|
180
181
|
if (knownProps[key2]) {
|
|
181
182
|
// All of the values for the known props are lowercase.
|
|
182
183
|
value2 = String(value).toLowerCase();
|
|
@@ -190,6 +191,7 @@ function normalizeProps(options) {
|
|
|
190
191
|
// in editorconfig) & should just be returned as regular strings.
|
|
191
192
|
value2 = String(value);
|
|
192
193
|
}
|
|
194
|
+
// @ts-ignore -- Fix types here
|
|
193
195
|
props[key2] = value2;
|
|
194
196
|
}
|
|
195
197
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "editorconfig",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "EditorConfig File Locator and Interpreter for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"editorconfig",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"lib": "./lib"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"clean": "rimraf lib
|
|
21
|
+
"clean": "rimraf lib cmake_install.cmake CTestTestfile.cmake Makefile",
|
|
22
22
|
"prebuild": "npm run clean",
|
|
23
23
|
"build": "cmake . && tsc",
|
|
24
24
|
"pretest": "npm run build && npm run lint",
|
|
@@ -41,24 +41,23 @@
|
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@one-ini/wasm": "0.1.1",
|
|
44
|
-
"commander": "^
|
|
45
|
-
"minimatch": "
|
|
46
|
-
"semver": "^7.3
|
|
44
|
+
"commander": "^11.0.0",
|
|
45
|
+
"minimatch": "9.0.1",
|
|
46
|
+
"semver": "^7.5.3"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/
|
|
50
|
-
"@types/
|
|
51
|
-
"@types/
|
|
52
|
-
"@
|
|
53
|
-
"@typescript-eslint/
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"eslint": "
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"rimraf": "^3.0.2",
|
|
49
|
+
"@types/mocha": "^10.0.1",
|
|
50
|
+
"@types/node": "^20.3.1",
|
|
51
|
+
"@types/semver": "^7.5.0",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "5.60.0",
|
|
53
|
+
"@typescript-eslint/parser": "5.60.0",
|
|
54
|
+
"c8": "8.0.0",
|
|
55
|
+
"eslint": "8.43.0",
|
|
56
|
+
"eslint-plugin-jsdoc": "46.2.6",
|
|
57
|
+
"mocha": "^10.2.0",
|
|
58
|
+
"rimraf": "^5.0.1",
|
|
60
59
|
"should": "^13.2.3",
|
|
61
|
-
"typescript": "^
|
|
60
|
+
"typescript": "^5.1.3"
|
|
62
61
|
},
|
|
63
62
|
"engines": {
|
|
64
63
|
"node": ">=14"
|