linted 35.3.0 → 35.4.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/dist/tool/index.d.ts +6 -0
- package/dist/tool/index.d.ts.map +1 -0
- package/dist/tool/index.js +28 -0
- package/dist/tool/index.js.map +1 -0
- package/dist/tool/path.d.ts +7 -0
- package/dist/tool/path.d.ts.map +1 -0
- package/dist/tool/path.js +2 -0
- package/dist/tool/path.js.map +1 -0
- package/package.json +5 -1
- package/src/tool/index.ts +53 -0
- package/src/tool/path.ts +6 -0
- package/src/tool/tsconfig.json +7 -0
- package/src/tsconfig.json +3 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function directory(path: string, subpath?: string): string;
|
|
2
|
+
export declare function not(path: string, subpath?: string): string;
|
|
3
|
+
export declare function flat(path: string, subpath?: string): string;
|
|
4
|
+
export declare function recurse(path: string, subpath?: string): string;
|
|
5
|
+
export declare function file(extension: string, name?: string): string;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,UAajB;AAED,wBAAgB,GAAG,CACjB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,UAGjB;AAED,wBAAgB,IAAI,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,UAMjB;AAED,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,UAGjB;AAED,wBAAgB,IAAI,CAClB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,MAAkB,UAOzB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function directory(path, subpath) {
|
|
2
|
+
return subpath === undefined
|
|
3
|
+
? path
|
|
4
|
+
: path + (path.endsWith("/")
|
|
5
|
+
? subpath.startsWith("/")
|
|
6
|
+
? subpath.slice(1)
|
|
7
|
+
: subpath
|
|
8
|
+
: subpath.startsWith("/")
|
|
9
|
+
? subpath
|
|
10
|
+
: "/" + subpath);
|
|
11
|
+
}
|
|
12
|
+
export function not(path, subpath) {
|
|
13
|
+
return "!" + directory(path, subpath);
|
|
14
|
+
}
|
|
15
|
+
export function flat(path, subpath) {
|
|
16
|
+
return directory(directory(path, subpath), "*");
|
|
17
|
+
}
|
|
18
|
+
export function recurse(path, subpath) {
|
|
19
|
+
return flat(path, subpath) + "*";
|
|
20
|
+
}
|
|
21
|
+
export function file(extension, name = "*") {
|
|
22
|
+
return "**"
|
|
23
|
+
+ "/"
|
|
24
|
+
+ name
|
|
25
|
+
+ "."
|
|
26
|
+
+ extension;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tool/index.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CACvB,IAAY,EACZ,OAAgB;IAEhB,OAAO,OAAO,KAAK,SAAS;QAC1B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,IAAI,GAAG,CACP,IAAI,CAAC,QAAQ,KAAgB;YAC3B,CAAC,CAAC,OAAO,CAAC,UAAU,KAAgB;gBAClC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;gBAClB,CAAC,CAAC,OAAO;YACX,CAAC,CAAC,OAAO,CAAC,UAAU,KAAgB;gBAClC,CAAC,CAAC,OAAO;gBACT,CAAC,CAAC,MAAiB,OAAO,CAC/B,CAAC;AACN,CAAC;AAED,MAAM,UAAU,GAAG,CACjB,IAAY,EACZ,OAAgB;IAEhB,OAAO,MAAW,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,IAAI,CAClB,IAAY,EACZ,OAAgB;IAEhB,OAAO,SAAS,CACd,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,MAEzB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,IAAY,EACZ,OAAgB;IAEhB,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,MAAY,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,IAAI,CAClB,SAAiB,EACjB,UAAwB;IAExB,OAAO;aACW;UACd,IAAI;UACJ,GAAG;UACH,SAAS,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/tool/path.ts"],"names":[],"mappings":"AAAA,0BAAkB,IAAI;IACpB,GAAG,MAAM;IACT,SAAS,MAAM;IACf,IAAI,MAAM;IACV,OAAO,OAAc;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/tool/path.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"$schema": "https://json.schemastore.org/package",
|
|
4
4
|
"$help": "https://docs.npmjs.com/cli/configuring-npm/package-json",
|
|
5
5
|
"name": "linted",
|
|
6
|
-
"version": "35.
|
|
6
|
+
"version": "35.4.0",
|
|
7
7
|
"repository": "github:jimmy-zhening-luo/linted",
|
|
8
8
|
"description": "ESLint mono-plugin bundler with strict, opinionated defaults for (Stylistic) JavaScript, TypeScript, Svelte, HTML, Tailwind/CSS, JSON, JSONC, YAML, and Mocha.",
|
|
9
9
|
"keywords": [
|
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
".": {
|
|
40
40
|
"types": "./dist/index.d.ts",
|
|
41
41
|
"default": "./dist/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./tool": {
|
|
44
|
+
"types": "./dist/tool/index.d.ts",
|
|
45
|
+
"default": "./dist/tool/index.js"
|
|
42
46
|
}
|
|
43
47
|
},
|
|
44
48
|
"peerDependencies": {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Path } from "./path";
|
|
2
|
+
|
|
3
|
+
export function directory(
|
|
4
|
+
path: string,
|
|
5
|
+
subpath?: string,
|
|
6
|
+
) {
|
|
7
|
+
return subpath === undefined
|
|
8
|
+
? path
|
|
9
|
+
: path + (
|
|
10
|
+
path.endsWith(Path.Directory)
|
|
11
|
+
? subpath.startsWith(Path.Directory)
|
|
12
|
+
? subpath.slice(1)
|
|
13
|
+
: subpath
|
|
14
|
+
: subpath.startsWith(Path.Directory)
|
|
15
|
+
? subpath
|
|
16
|
+
: Path.Directory + subpath
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function not(
|
|
21
|
+
path: string,
|
|
22
|
+
subpath?: string,
|
|
23
|
+
) {
|
|
24
|
+
return Path.Not + directory(path, subpath);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function flat(
|
|
28
|
+
path: string,
|
|
29
|
+
subpath?: string,
|
|
30
|
+
) {
|
|
31
|
+
return directory(
|
|
32
|
+
directory(path, subpath),
|
|
33
|
+
Path.Flat,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function recurse(
|
|
38
|
+
path: string,
|
|
39
|
+
subpath?: string,
|
|
40
|
+
) {
|
|
41
|
+
return flat(path, subpath) + Path.Flat;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function file(
|
|
45
|
+
extension: string,
|
|
46
|
+
name: string = Path.Flat,
|
|
47
|
+
) {
|
|
48
|
+
return Path.Recurse
|
|
49
|
+
+ Path.Directory
|
|
50
|
+
+ name
|
|
51
|
+
+ "."
|
|
52
|
+
+ extension;
|
|
53
|
+
}
|
package/src/tool/path.ts
ADDED