locter 0.2.2 → 0.3.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Peter Placzek
3
+ Copyright (c) 2021-2022 Peter Placzek
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.MD CHANGED
@@ -11,6 +11,7 @@ Locter is a library to locate and load a file regarding specific criteria.
11
11
  - [Usage](#usage)
12
12
  - [Locator](#locator)
13
13
  - [Loader](#loader)
14
+ - [License](#license)
14
15
 
15
16
  ## Installation
16
17
 
@@ -131,3 +132,8 @@ import { loadFile, locateFile } from 'locter';
131
132
 
132
133
  A synchronous variant is also available: `loadFileSync`
133
134
 
135
+ ## License
136
+
137
+ Made with 💚
138
+
139
+ Published under [MIT License](./LICENSE).
@@ -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"}
@@ -1,3 +1,4 @@
1
1
  export * from './error';
2
+ export * from './file-name';
2
3
  export * from './has-own-property';
3
4
  export * from './to-array';
@@ -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
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "locter",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "Locter is a library to locate a file by criteria and load it",
5
5
  "author": {
6
6
  "name": "Peter Placzek",
@@ -18,10 +18,12 @@
18
18
  "scripts": {
19
19
  "build": "rimraf dist && tsc -d",
20
20
  "build:watch": "npm run build -- --watch",
21
+ "commit": "npx git-cz",
21
22
  "test": "cross-env NODE_ENV=test jest --config ./test/jest.config.js",
22
23
  "test:coverage": "cross-env NODE_ENV=test jest --config ./test/jest.config.js --coverage",
23
24
  "lint": "eslint --ext .js,.vue,.ts ./src",
24
25
  "lint:fix": "npm run lint -- --fix",
26
+ "prepare": "npx husky install",
25
27
  "prepublishOnly": "npm run build"
26
28
  },
27
29
  "keywords": [
@@ -32,22 +34,38 @@
32
34
  ],
33
35
  "license": "MIT",
34
36
  "devDependencies": {
35
- "@tada5hi/eslint-config-typescript": "^1.0.4",
36
- "@types/glob": "^7.1.3",
37
+ "@commitlint/cli": "^17.1.2",
38
+ "@commitlint/config-angular": "^17.1.0",
39
+ "@commitlint/config-conventional": "^17.1.0",
40
+ "@commitlint/cz-commitlint": "^17.1.2",
41
+ "@semantic-release/changelog": "^6.0.1",
42
+ "@semantic-release/commit-analyzer": "^9.0.2",
43
+ "@semantic-release/git": "^10.0.1",
44
+ "@semantic-release/npm": "^9.0.1",
45
+ "@semantic-release/release-notes-generator": "^10.0.3",
46
+ "@tada5hi/eslint-config-typescript": "^1.0.7",
47
+ "@types/glob": "^8.0.0",
37
48
  "@types/jest": "^27.5.0",
38
- "@types/node": "^18.7.1",
39
- "@types/yargs": "^17.0.11",
49
+ "@types/node": "^18.8.0",
50
+ "@types/yargs": "^17.0.13",
40
51
  "coveralls": "^3.1.0",
41
52
  "cross-env": "^7.0.3",
42
- "eslint": "^8.21.0",
53
+ "eslint": "^8.24.0",
54
+ "husky": "^8.0.1",
43
55
  "jest": "^27.5.1",
44
56
  "np": "^7.6.2",
45
57
  "rimraf": "^3.0.2",
58
+ "semantic-release": "^19.0.5",
46
59
  "ts-jest": "^27.1.4",
47
60
  "ts-node": "^10.9.1",
48
- "typescript": "^4.7.4"
61
+ "typescript": "^4.8.4"
49
62
  },
50
63
  "dependencies": {
51
64
  "glob": "^8.0.3"
65
+ },
66
+ "config": {
67
+ "commitizen": {
68
+ "path": "@commitlint/cz-commitlint"
69
+ }
52
70
  }
53
71
  }