locter 0.2.2 → 0.3.2
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/LICENSE +1 -1
- package/README.MD +11 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/file-name.d.ts +1 -0
- package/dist/utils/file-name.js +22 -0
- package/dist/utils/file-name.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +28 -9
package/LICENSE
CHANGED
package/README.MD
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
# Locter 🔥
|
|
2
|
+
|
|
1
3
|
[](https://badge.fury.io/js/locter)
|
|
2
|
-
[](https://codecov.io/gh/Tada5hi/locter)
|
|
3
4
|
[](https://github.com/tada5hi/locter/actions/workflows/main.yml)
|
|
5
|
+
[](https://codecov.io/gh/Tada5hi/locter)
|
|
6
|
+
[](https://snyk.io/test/github/Tada5hi/locter?targetFile=package.json)
|
|
7
|
+
[](https://github.com/semantic-release/semantic-release)
|
|
4
8
|
|
|
5
|
-
# Locter 🔥
|
|
6
9
|
Locter is a library to locate and load a file regarding specific criteria.
|
|
7
10
|
|
|
8
11
|
**Table of Contents**
|
|
@@ -11,6 +14,7 @@ Locter is a library to locate and load a file regarding specific criteria.
|
|
|
11
14
|
- [Usage](#usage)
|
|
12
15
|
- [Locator](#locator)
|
|
13
16
|
- [Loader](#loader)
|
|
17
|
+
- [License](#license)
|
|
14
18
|
|
|
15
19
|
## Installation
|
|
16
20
|
|
|
@@ -18,14 +22,6 @@ Locter is a library to locate and load a file regarding specific criteria.
|
|
|
18
22
|
npm install locter --save
|
|
19
23
|
```
|
|
20
24
|
|
|
21
|
-
---
|
|
22
|
-
**Important NOTE**
|
|
23
|
-
|
|
24
|
-
The public API is still in progress and in development ☂ and can still can change therefore until the v1.0.0 release.
|
|
25
|
-
So please stay patient, till it is fully available ⭐.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
25
|
## Usage
|
|
30
26
|
|
|
31
27
|
The following examples are based on some shared assumptions:
|
|
@@ -131,3 +127,8 @@ import { loadFile, locateFile } from 'locter';
|
|
|
131
127
|
|
|
132
128
|
A synchronous variant is also available: `loadFileSync`
|
|
133
129
|
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
Made with 💚
|
|
133
|
+
|
|
134
|
+
Published under [MIT License](./LICENSE).
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -22,4 +22,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
__exportStar(require("./loader"), exports);
|
|
24
24
|
__exportStar(require("./locator"), exports);
|
|
25
|
+
__exportStar(require("./utils"), exports);
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function removeFileNameExtension(input: string, extensions?: string[]): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.removeFileNameExtension = void 0;
|
|
10
|
+
function removeFileNameExtension(input, extensions) {
|
|
11
|
+
if (input.includes('.')) {
|
|
12
|
+
const position = input.lastIndexOf('.');
|
|
13
|
+
const extension = input.substring(position, input.length);
|
|
14
|
+
if (typeof extensions === 'undefined' ||
|
|
15
|
+
extensions.indexOf(extension) !== -1) {
|
|
16
|
+
input = input.substring(0, position);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return input;
|
|
20
|
+
}
|
|
21
|
+
exports.removeFileNameExtension = removeFileNameExtension;
|
|
22
|
+
//# sourceMappingURL=file-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-name.js","sourceRoot":"","sources":["../../src/utils/file-name.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,SAAgB,uBAAuB,CACnC,KAAa,EACb,UAAqB;IAErB,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACrB,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACxC,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAC7B,QAAQ,EACR,KAAK,CAAC,MAAM,CACf,CAAC;QAEF,IACI,OAAO,UAAU,KAAK,WAAW;YACjC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EACtC;YACE,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;SACxC;KACJ;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AApBD,0DAoBC"}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -21,6 +21,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
__exportStar(require("./error"), exports);
|
|
24
|
+
__exportStar(require("./file-name"), exports);
|
|
24
25
|
__exportStar(require("./has-own-property"), exports);
|
|
25
26
|
__exportStar(require("./to-array"), exports);
|
|
26
27
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,qDAAmC;AACnC,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,8CAA4B;AAC5B,qDAAmC;AACnC,6CAA2B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "locter",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"description": "A library to locate a file by criteria and load it",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Peter Placzek",
|
|
7
7
|
"email": "contact@tada5hi.net",
|
|
@@ -12,16 +12,19 @@
|
|
|
12
12
|
"url": "https://github.com/tada5hi/locter.git"
|
|
13
13
|
},
|
|
14
14
|
"main": "dist/index.js",
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
15
16
|
"files": [
|
|
16
17
|
"dist/"
|
|
17
18
|
],
|
|
18
19
|
"scripts": {
|
|
19
20
|
"build": "rimraf dist && tsc -d",
|
|
20
21
|
"build:watch": "npm run build -- --watch",
|
|
22
|
+
"commit": "npx git-cz",
|
|
21
23
|
"test": "cross-env NODE_ENV=test jest --config ./test/jest.config.js",
|
|
22
24
|
"test:coverage": "cross-env NODE_ENV=test jest --config ./test/jest.config.js --coverage",
|
|
23
25
|
"lint": "eslint --ext .js,.vue,.ts ./src",
|
|
24
26
|
"lint:fix": "npm run lint -- --fix",
|
|
27
|
+
"prepare": "npx husky install",
|
|
25
28
|
"prepublishOnly": "npm run build"
|
|
26
29
|
},
|
|
27
30
|
"keywords": [
|
|
@@ -32,22 +35,38 @@
|
|
|
32
35
|
],
|
|
33
36
|
"license": "MIT",
|
|
34
37
|
"devDependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
38
|
+
"@commitlint/cli": "^17.1.2",
|
|
39
|
+
"@commitlint/config-angular": "^17.1.0",
|
|
40
|
+
"@commitlint/config-conventional": "^17.1.0",
|
|
41
|
+
"@commitlint/cz-commitlint": "^17.1.2",
|
|
42
|
+
"@semantic-release/changelog": "^6.0.1",
|
|
43
|
+
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
44
|
+
"@semantic-release/git": "^10.0.1",
|
|
45
|
+
"@semantic-release/github": "^8.0.6",
|
|
46
|
+
"@semantic-release/npm": "^9.0.1",
|
|
47
|
+
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
48
|
+
"@tada5hi/eslint-config-typescript": "^1.0.7",
|
|
49
|
+
"@types/glob": "^8.0.0",
|
|
37
50
|
"@types/jest": "^27.5.0",
|
|
38
|
-
"@types/node": "^18.
|
|
39
|
-
"@types/yargs": "^17.0.
|
|
51
|
+
"@types/node": "^18.8.4",
|
|
52
|
+
"@types/yargs": "^17.0.13",
|
|
40
53
|
"coveralls": "^3.1.0",
|
|
41
54
|
"cross-env": "^7.0.3",
|
|
42
|
-
"eslint": "^8.
|
|
55
|
+
"eslint": "^8.25.0",
|
|
56
|
+
"husky": "^8.0.1",
|
|
43
57
|
"jest": "^27.5.1",
|
|
44
|
-
"np": "^7.6.2",
|
|
45
58
|
"rimraf": "^3.0.2",
|
|
59
|
+
"semantic-release": "^19.0.5",
|
|
46
60
|
"ts-jest": "^27.1.4",
|
|
47
61
|
"ts-node": "^10.9.1",
|
|
48
|
-
"typescript": "^4.
|
|
62
|
+
"typescript": "^4.8.4"
|
|
49
63
|
},
|
|
50
64
|
"dependencies": {
|
|
51
65
|
"glob": "^8.0.3"
|
|
66
|
+
},
|
|
67
|
+
"config": {
|
|
68
|
+
"commitizen": {
|
|
69
|
+
"path": "@commitlint/cz-commitlint"
|
|
70
|
+
}
|
|
52
71
|
}
|
|
53
72
|
}
|