@webtypen/webframez-core 0.1.12 → 0.1.13

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.
@@ -1 +1,4 @@
1
- export declare function rootDir(...args: any): void;
1
+ export declare function rootDir(...args: any): string;
2
+ export declare function storageDir(...args: any): string;
3
+ export declare function rootDirBuild(...args: any): string;
4
+ export declare function storageDirBuild(...args: any): string;
@@ -1,7 +1,43 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rootDir = void 0;
6
+ exports.storageDirBuild = exports.rootDirBuild = exports.storageDir = exports.rootDir = void 0;
7
+ const path_1 = __importDefault(require("path"));
4
8
  function rootDir(...args) {
5
- console.log("rootDir(" + args + ")", __dirname);
9
+ const identifierBuild = "/build/node_modules/@webtypen/webframez-core";
10
+ if (__dirname.indexOf(identifierBuild) > 0) {
11
+ return path_1.default.join(__dirname.substring(0, __dirname.indexOf(identifierBuild)), ...args);
12
+ }
13
+ const identifier = "/node_modules/@webtypen/webframez-core";
14
+ return path_1.default.join(__dirname.substring(0, __dirname.indexOf(identifier)), ...args);
6
15
  }
7
16
  exports.rootDir = rootDir;
17
+ function storageDir(...args) {
18
+ const identifierBuild = "/build/node_modules/@webtypen/webframez-core";
19
+ if (__dirname.indexOf(identifierBuild) > 0) {
20
+ return path_1.default.join(__dirname.substring(0, __dirname.indexOf(identifierBuild)), "storage", ...args);
21
+ }
22
+ const identifier = "/node_modules/@webtypen/webframez-core";
23
+ return path_1.default.join(__dirname.substring(0, __dirname.indexOf(identifier)), "storage", ...args);
24
+ }
25
+ exports.storageDir = storageDir;
26
+ function rootDirBuild(...args) {
27
+ const identifierBuild = "/build/node_modules/@webtypen/webframez-core";
28
+ if (__dirname.indexOf(identifierBuild) > 0) {
29
+ return path_1.default.join(__dirname.substring(0, __dirname.indexOf(identifierBuild)), "build", ...args);
30
+ }
31
+ const identifier = "/node_modules/@webtypen/webframez-core";
32
+ return path_1.default.join(__dirname.substring(0, __dirname.indexOf(identifier)), "build", ...args);
33
+ }
34
+ exports.rootDirBuild = rootDirBuild;
35
+ function storageDirBuild(...args) {
36
+ const identifierBuild = "/build/node_modules/@webtypen/webframez-core";
37
+ if (__dirname.indexOf(identifierBuild) > 0) {
38
+ return path_1.default.join(__dirname.substring(0, __dirname.indexOf(identifierBuild)), "build", "storage", ...args);
39
+ }
40
+ const identifier = "/node_modules/@webtypen/webframez-core";
41
+ return path_1.default.join(__dirname.substring(0, __dirname.indexOf(identifier)), "build", "storage", ...args);
42
+ }
43
+ exports.storageDirBuild = storageDirBuild;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",
@@ -1,5 +1,41 @@
1
1
  import path from "path";
2
2
 
3
3
  export function rootDir(...args: any) {
4
- console.log("rootDir(" + args + ")", __dirname);
4
+ const identifierBuild = "/build/node_modules/@webtypen/webframez-core";
5
+ if (__dirname.indexOf(identifierBuild) > 0) {
6
+ return path.join(__dirname.substring(0, __dirname.indexOf(identifierBuild)), ...args);
7
+ }
8
+
9
+ const identifier = "/node_modules/@webtypen/webframez-core";
10
+ return path.join(__dirname.substring(0, __dirname.indexOf(identifier)), ...args);
11
+ }
12
+
13
+ export function storageDir(...args: any) {
14
+ const identifierBuild = "/build/node_modules/@webtypen/webframez-core";
15
+ if (__dirname.indexOf(identifierBuild) > 0) {
16
+ return path.join(__dirname.substring(0, __dirname.indexOf(identifierBuild)), "storage", ...args);
17
+ }
18
+
19
+ const identifier = "/node_modules/@webtypen/webframez-core";
20
+ return path.join(__dirname.substring(0, __dirname.indexOf(identifier)), "storage", ...args);
21
+ }
22
+
23
+ export function rootDirBuild(...args: any) {
24
+ const identifierBuild = "/build/node_modules/@webtypen/webframez-core";
25
+ if (__dirname.indexOf(identifierBuild) > 0) {
26
+ return path.join(__dirname.substring(0, __dirname.indexOf(identifierBuild)), "build", ...args);
27
+ }
28
+
29
+ const identifier = "/node_modules/@webtypen/webframez-core";
30
+ return path.join(__dirname.substring(0, __dirname.indexOf(identifier)), "build", ...args);
31
+ }
32
+
33
+ export function storageDirBuild(...args: any) {
34
+ const identifierBuild = "/build/node_modules/@webtypen/webframez-core";
35
+ if (__dirname.indexOf(identifierBuild) > 0) {
36
+ return path.join(__dirname.substring(0, __dirname.indexOf(identifierBuild)), "build", "storage", ...args);
37
+ }
38
+
39
+ const identifier = "/node_modules/@webtypen/webframez-core";
40
+ return path.join(__dirname.substring(0, __dirname.indexOf(identifier)), "build", "storage", ...args);
5
41
  }