@gnuechtel/shared-util 0.56.0-alpha-5181490678

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/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # shared-util
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build shared-util` to build the library.
8
+
9
+ ## Running unit tests
10
+
11
+ Run `nx test shared-util` to execute the unit tests via [Jest](https://jestjs.io).
package/package.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@gnuechtel/shared-util",
3
+ "version": "0.56.0-alpha-5181490678",
4
+ "dependencies": {
5
+ "tslib": "^2.3.0"
6
+ },
7
+ "type": "commonjs",
8
+ "main": "./src/index.js",
9
+ "typings": "./src/index.d.ts"
10
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './lib/root-directory';
package/src/index.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./lib/root-directory"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/shared-util/src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC"}
@@ -0,0 +1 @@
1
+ export declare function rootDirectory(pathToAnalyze?: string): string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rootDirectory = void 0;
4
+ const path = require("path");
5
+ function rootDirectory(pathToAnalyze = '') {
6
+ const nodeModules = /[/\\]node_modules/;
7
+ const usedPath = pathToAnalyze || __dirname;
8
+ if (nodeModules.test(usedPath))
9
+ return usedPath.split(nodeModules)[0];
10
+ return path.resolve(path.join(usedPath, '..', '..', '..', '..'));
11
+ }
12
+ exports.rootDirectory = rootDirectory;
13
+ //# sourceMappingURL=root-directory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-directory.js","sourceRoot":"","sources":["../../../../../libs/shared-util/src/lib/root-directory.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAE7B,SAAgB,aAAa,CAAC,aAAa,GAAG,EAAE;IAC9C,MAAM,WAAW,GAAG,mBAAmB,CAAC;IACxC,MAAM,QAAQ,GAAG,aAAa,IAAI,SAAS,CAAC;IAC5C,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AACnE,CAAC;AALD,sCAKC"}