@tsed/normalize-path 7.10.0-rc.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/coverage.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "statements": 100,
3
+ "branches": 100,
4
+ "functions": 100,
5
+ "lines": 100
6
+ }
package/jest.config.js ADDED
@@ -0,0 +1,9 @@
1
+ // For a detailed explanation regarding each configuration property, visit:
2
+ // https://jestjs.io/docs/en/configuration.html
3
+
4
+ module.exports = {
5
+ ...require("@tsed/jest-config")(__dirname, "core"),
6
+ coverageThreshold: {
7
+ global: require("./coverage.json")
8
+ }
9
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * @file Automatically generated by barrelsby.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const tslib_1 = require("tslib");
7
+ tslib_1.__exportStar(require("./normalizePath.spec"), exports);
8
+ tslib_1.__exportStar(require("./normalizePath"), exports);
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,+DAAqC;AACrC,0DAAgC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./normalizePath.spec\";\nexport * from \"./normalizePath\";\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizePath = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const normalize_path_1 = tslib_1.__importDefault(require("normalize-path"));
6
+ const path_1 = require("path");
7
+ function normalizePath(item, ...paths) {
8
+ if (typeof item === "string") {
9
+ const path = (0, path_1.join)(item, ...paths);
10
+ return (0, normalize_path_1.default)(path);
11
+ }
12
+ if (Array.isArray(item)) {
13
+ return item.map((item) => normalizePath(item));
14
+ }
15
+ return item;
16
+ }
17
+ exports.normalizePath = normalizePath;
18
+ //# sourceMappingURL=normalizePath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizePath.js","sourceRoot":"","sources":["../../src/normalizePath.ts"],"names":[],"mappings":";;;;AAAA,4EAAqC;AACrC,+BAA0B;AAI1B,SAAgB,aAAa,CAAC,IAAS,EAAE,GAAG,KAAe;IACzD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAI,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;QAClC,OAAO,IAAA,wBAAO,EAAC,IAAI,CAAC,CAAC;KACtB;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACvB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;KACrD;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAXD,sCAWC","sourcesContent":["import fixPath from \"normalize-path\";\nimport {join} from \"path\";\n\nexport function normalizePath(item: string, ...paths: string[]): string;\nexport function normalizePath(item: (string | any)[]): (string | any)[];\nexport function normalizePath(item: any, ...paths: string[]) {\n if (typeof item === \"string\") {\n const path = join(item, ...paths);\n return fixPath(path);\n }\n\n if (Array.isArray(item)) {\n return item.map((item: any) => normalizePath(item));\n }\n\n return item;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizePath.spec.js","sourceRoot":"","sources":["../../src/normalizePath.spec.ts"],"names":[],"mappings":";;AAAA,mDAA8C;AAE9C,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,CAAC,IAAA,6BAAa,EAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,CAAC,IAAA,6BAAa,EAAC,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {normalizePath} from \"./normalizePath\";\n\ndescribe(\"normalizePath\", () => {\n it(\"should normalize path (string)\", () => {\n expect(normalizePath(\"path\", \"to\", \"img\")).toBe(\"path/to/img\");\n });\n\n it(\"should normalize path (array)\", () => {\n expect(normalizePath([\"path/to/img\", {}])).toEqual([\"path/to/img\", {}]);\n });\n});\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @file Automatically generated by barrelsby.
3
+ */
4
+ export * from "./normalizePath.spec.js";
5
+ export * from "./normalizePath.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./normalizePath.spec\";\nexport * from \"./normalizePath\";\n"]}
@@ -0,0 +1,13 @@
1
+ import fixPath from "normalize-path";
2
+ import { join } from "path";
3
+ export function normalizePath(item, ...paths) {
4
+ if (typeof item === "string") {
5
+ const path = join(item, ...paths);
6
+ return fixPath(path);
7
+ }
8
+ if (Array.isArray(item)) {
9
+ return item.map((item) => normalizePath(item));
10
+ }
11
+ return item;
12
+ }
13
+ //# sourceMappingURL=normalizePath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizePath.js","sourceRoot":"","sources":["../../src/normalizePath.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAI1B,MAAM,UAAU,aAAa,CAAC,IAAS,EAAE,GAAG,KAAe;IACzD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;KACtB;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACvB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;KACrD;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import fixPath from \"normalize-path\";\nimport {join} from \"path\";\n\nexport function normalizePath(item: string, ...paths: string[]): string;\nexport function normalizePath(item: (string | any)[]): (string | any)[];\nexport function normalizePath(item: any, ...paths: string[]) {\n if (typeof item === \"string\") {\n const path = join(item, ...paths);\n return fixPath(path);\n }\n\n if (Array.isArray(item)) {\n return item.map((item: any) => normalizePath(item));\n }\n\n return item;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizePath.spec.js","sourceRoot":"","sources":["../../src/normalizePath.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,CAAC,aAAa,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {normalizePath} from \"./normalizePath\";\n\ndescribe(\"normalizePath\", () => {\n it(\"should normalize path (string)\", () => {\n expect(normalizePath(\"path\", \"to\", \"img\")).toBe(\"path/to/img\");\n });\n\n it(\"should normalize path (array)\", () => {\n expect(normalizePath([\"path/to/img\", {}])).toEqual([\"path/to/img\", {}]);\n });\n});\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @file Automatically generated by barrelsby.
3
+ */
4
+ export * from "./normalizePath.spec";
5
+ export * from "./normalizePath";
@@ -0,0 +1,2 @@
1
+ export declare function normalizePath(item: string, ...paths: string[]): string;
2
+ export declare function normalizePath(item: (string | any)[]): (string | any)[];
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@tsed/normalize-path",
3
+ "version": "7.10.0-rc.1",
4
+ "description": "Utils to normalize path",
5
+ "private": false,
6
+ "source": "./src/index.ts",
7
+ "main": "./lib/cjs/index.js",
8
+ "module": "./lib/esm/index.js",
9
+ "typings": "./lib/types/index.d.ts",
10
+ "exports": {
11
+ "types": "./lib/types/index.d.ts",
12
+ "import": "./lib/esm/index.js",
13
+ "require": "./lib/cjs/index.js",
14
+ "default": "./lib/esm/index.js"
15
+ },
16
+ "scripts": {
17
+ "build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
18
+ "barrels": "yarn barrelsby --delete -d src -e \\\"\\\\.spec\\\\.ts\\\"",
19
+ "build:cjs": "tsc --build tsconfig.compile.json",
20
+ "build:esm": "tsc --build tsconfig.compile.esm.json",
21
+ "test": "cross-env NODE_ENV=test yarn jest --max-workers=2"
22
+ },
23
+ "dependencies": {
24
+ "normalize-path": "3.0.0",
25
+ "tslib": "2.4.0"
26
+ },
27
+ "devDependencies": {
28
+ "@types/normalize-path": "^3.0.0"
29
+ },
30
+ "peerDependencies": {},
31
+ "repository": "https://github.com/tsedio/tsed",
32
+ "bugs": {
33
+ "url": "https://github.com/tsedio/tsed/issues"
34
+ },
35
+ "homepage": "https://github.com/tsedio/tsed/tree/production/packages/utils/normalize-path",
36
+ "author": "Romain Lenzotti",
37
+ "license": "MIT",
38
+ "publishConfig": {
39
+ "tag": "rc"
40
+ }
41
+ }
package/readme.md ADDED
@@ -0,0 +1,65 @@
1
+ <p style="text-align: center" align="center">
2
+ <a href="https://tsed.io" target="_blank"><img src="https://tsed.io/tsed-og.png" width="200" alt="Ts.ED logo"/></a>
3
+ </p>
4
+
5
+ <div align="center">
6
+ <h1>@tsed/core</h1>
7
+
8
+ [![Build & Release](https://github.com/tsedio/tsed/workflows/Build%20&%20Release/badge.svg)](https://github.com/tsedio/tsed/actions?query=workflow%3A%22Build+%26+Release%22)
9
+ [![PR Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/tsedio/tsed/blob/master/CONTRIBUTING.md)
10
+ [![Coverage Status](https://coveralls.io/repos/github/tsedio/tsed/badge.svg?branch=production)](https://coveralls.io/github/tsedio/tsed?branch=production)
11
+ [![npm version](https://badge.fury.io/js/%40tsed%2Fcommon.svg)](https://badge.fury.io/js/%40tsed%2Fcommon)
12
+ [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
13
+ [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
14
+ [![github](https://img.shields.io/static/v1?label=Github%20sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/romakita)
15
+ [![opencollective](https://img.shields.io/static/v1?label=OpenCollective%20sponsor&message=%E2%9D%A4&logo=OpenCollective&color=%23fe8e86)](https://opencollective.com/tsed)
16
+
17
+ </div>
18
+
19
+ <div align="center">
20
+ <a href="https://tsed.io/">Website</a>
21
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
22
+ <a href="https://tsed.io/getting-started/">Getting started</a>
23
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
24
+ <a href="https://api.tsed.io/rest/slack/tsedio/tsed">Slack</a>
25
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
26
+ <a href="https://twitter.com/TsED_io">Twitter</a>
27
+ </div>
28
+
29
+ <hr />
30
+
31
+ A package of Ts.ED framework. See website: https://tsed.io/
32
+
33
+ # Installation
34
+
35
+ ```bash
36
+ npm install --save @tsed/core
37
+ ```
38
+
39
+ ## Contributors
40
+
41
+ Please read [contributing guidelines here](https://tsed.io/contributing.html).
42
+
43
+ <a href="https://github.com/tsedio/tsed/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>
44
+
45
+ ## Backers
46
+
47
+ Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)]
48
+
49
+ <a href="https://opencollective.com/tsed#backers" target="_blank"><img src="https://opencollective.com/tsed/tiers/backer.svg?width=890"></a>
50
+
51
+ ## Sponsors
52
+
53
+ Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
54
+
55
+ ## License
56
+
57
+ The MIT License (MIT)
58
+
59
+ Copyright (c) 2016 - 2022 Romain Lenzotti
60
+
61
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
62
+
63
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
64
+
65
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./tsconfig.compile.json",
3
+ "compilerOptions": {
4
+ "baseUrl": "./",
5
+ "module": "ES2020",
6
+ "rootDir": "src",
7
+ "outDir": "./lib/esm",
8
+ "declaration": true,
9
+ "declarationDir": "./lib/types"
10
+ },
11
+ "exclude": ["node_modules", "test", "lib", "coverage", ".nyc_output", "**/*.spec.ts", "jest.config.js"]
12
+ }