@ldsg/utils 0.0.2 → 0.1.0-alpha.6
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/dist/extend-app-data-with-path.d.ts +9 -0
- package/dist/extend-app-data-with-path.d.ts.map +1 -0
- package/dist/extend-app-data-with-path.js +33 -0
- package/dist/extend-app-data.d.ts +2 -2
- package/dist/extend-app-data.d.ts.map +1 -1
- package/dist/extend-app-data.js +3 -23
- package/dist/get-app-data.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +10 -11
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppData } from "@ldsg/common";
|
|
2
|
+
export interface ExtendAppDataWithPathParams {
|
|
3
|
+
appData: AppData;
|
|
4
|
+
extraAppDataPath?: string;
|
|
5
|
+
}
|
|
6
|
+
type ExtendAppDataWithPath = (params: ExtendAppDataWithPathParams) => Promise<AppData>;
|
|
7
|
+
export declare const extendAppDataWithPath: ExtendAppDataWithPath;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=extend-app-data-with-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend-app-data-with-path.d.ts","sourceRoot":"","sources":["../src/extend-app-data-with-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,KAAK,qBAAqB,GAAG,CAC3B,MAAM,EAAE,2BAA2B,KAChC,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,eAAO,MAAM,qBAAqB,EAAE,qBAmBnC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.extendAppDataWithPath = void 0;
|
|
16
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
17
|
+
const extend_app_data_1 = require("./extend-app-data");
|
|
18
|
+
const extendAppDataWithPath = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
const { appData, extraAppDataPath } = params;
|
|
20
|
+
let extraAppData = {};
|
|
21
|
+
if (extraAppDataPath) {
|
|
22
|
+
const existsRes = yield fs_extra_1.default.exists(extraAppDataPath);
|
|
23
|
+
if (existsRes) {
|
|
24
|
+
extraAppData = yield fs_extra_1.default.readJson(extraAppDataPath);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const res = (0, extend_app_data_1.extendAppData)({
|
|
28
|
+
appData,
|
|
29
|
+
extraAppData,
|
|
30
|
+
});
|
|
31
|
+
return res;
|
|
32
|
+
});
|
|
33
|
+
exports.extendAppDataWithPath = extendAppDataWithPath;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AppData } from "@ldsg/common";
|
|
2
2
|
export interface ExtendAppDataParams {
|
|
3
3
|
appData: AppData;
|
|
4
|
-
|
|
4
|
+
extraAppData?: Partial<AppData>;
|
|
5
5
|
}
|
|
6
|
-
type ExtendAppData = (params: ExtendAppDataParams) =>
|
|
6
|
+
type ExtendAppData = (params: ExtendAppDataParams) => AppData;
|
|
7
7
|
export declare const extendAppData: ExtendAppData;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=extend-app-data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extend-app-data.d.ts","sourceRoot":"","sources":["../src/extend-app-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"extend-app-data.d.ts","sourceRoot":"","sources":["../src/extend-app-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC;AAED,KAAK,aAAa,GAAG,CAAC,MAAM,EAAE,mBAAmB,KAAK,OAAO,CAAC;AAE9D,eAAO,MAAM,aAAa,EAAE,aAS3B,CAAC"}
|
package/dist/extend-app-data.js
CHANGED
|
@@ -1,29 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.extendAppData = void 0;
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const { appData, extraAppDataPath } = params;
|
|
19
|
-
let extraAppData = {};
|
|
20
|
-
if (extraAppDataPath) {
|
|
21
|
-
const existsRes = yield fs_extra_1.default.exists(extraAppDataPath);
|
|
22
|
-
if (existsRes) {
|
|
23
|
-
extraAppData = yield fs_extra_1.default.readJson(extraAppDataPath);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
4
|
+
const extendAppData = (params) => {
|
|
5
|
+
const { appData, extraAppData } = params;
|
|
26
6
|
const res = Object.assign(Object.assign({}, extraAppData), appData);
|
|
27
7
|
return res;
|
|
28
|
-
}
|
|
8
|
+
};
|
|
29
9
|
exports.extendAppData = extendAppData;
|
package/dist/get-app-data.js
CHANGED
|
@@ -10,12 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getAppData = void 0;
|
|
13
|
-
const
|
|
13
|
+
const extend_app_data_with_path_1 = require("./extend-app-data-with-path");
|
|
14
14
|
const fetch_app_data_1 = require("./fetch-app-data");
|
|
15
15
|
const getAppData = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
const { extraAppDataPath } = params;
|
|
17
17
|
const appData = yield (0, fetch_app_data_1.fetchAppData)(params);
|
|
18
|
-
const res = yield (0,
|
|
18
|
+
const res = yield (0, extend_app_data_with_path_1.extendAppDataWithPath)({
|
|
19
19
|
appData,
|
|
20
20
|
extraAppDataPath,
|
|
21
21
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./extend-app-data"), exports);
|
|
18
|
+
__exportStar(require("./extend-app-data-with-path"), exports);
|
|
18
19
|
__exportStar(require("./fetch-app-data"), exports);
|
|
19
20
|
__exportStar(require("./generate"), exports);
|
|
20
21
|
__exportStar(require("./generate-by-app-data"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.1.0-alpha.6",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/"
|
|
@@ -9,24 +9,21 @@
|
|
|
9
9
|
"bin": {
|
|
10
10
|
"ldsg": "dist/index.js"
|
|
11
11
|
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "rm -rf dist && tsc --project tsconfig.build.json"
|
|
14
|
-
},
|
|
15
12
|
"author": "wanxger",
|
|
16
|
-
"license": "
|
|
13
|
+
"license": "MIT",
|
|
17
14
|
"publishConfig": {
|
|
18
15
|
"access": "public"
|
|
19
16
|
},
|
|
20
17
|
"description": "",
|
|
21
18
|
"dependencies": {
|
|
22
|
-
"@ldsg/app": "0.0.2",
|
|
23
|
-
"@ldsg/common": "0.0.2",
|
|
24
|
-
"@ldsg/services": "0.0.2",
|
|
25
19
|
"adm-zip": "^0.5.16",
|
|
26
20
|
"axios": "^1.7.7",
|
|
27
21
|
"commander": "^12.1.0",
|
|
28
22
|
"fs-extra": "^11.2.0",
|
|
29
|
-
"lodash": "^4.17.21"
|
|
23
|
+
"lodash": "^4.17.21",
|
|
24
|
+
"@ldsg/common": "0.1.0-alpha.6",
|
|
25
|
+
"@ldsg/services": "0.1.0-alpha.6",
|
|
26
|
+
"@ldsg/app": "0.1.0-alpha.6"
|
|
30
27
|
},
|
|
31
28
|
"devDependencies": {
|
|
32
29
|
"@types/adm-zip": "^0.5.6",
|
|
@@ -43,5 +40,7 @@
|
|
|
43
40
|
"webpack": "^5.97.1",
|
|
44
41
|
"webpack-cli": "^5.1.4"
|
|
45
42
|
},
|
|
46
|
-
"
|
|
47
|
-
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "rm -rf dist && tsc --project tsconfig.build.json"
|
|
45
|
+
}
|
|
46
|
+
}
|