webpb 0.0.18 → 0.0.19
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/index.js +6 -7
- package/package.json +17 -15
package/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.assign = assign;
|
|
4
|
+
exports.getter = getter;
|
|
5
|
+
exports.query = query;
|
|
6
|
+
exports.toAlias = toAlias;
|
|
7
|
+
exports.mapValues = mapValues;
|
|
4
8
|
function assign(src, dest, excludes) {
|
|
5
9
|
if (!src || !dest || typeof src !== "object" || typeof dest !== "object") {
|
|
6
10
|
return;
|
|
@@ -12,7 +16,6 @@ function assign(src, dest, excludes) {
|
|
|
12
16
|
}
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
|
-
exports.assign = assign;
|
|
16
19
|
function isExcluded(k, excludes) {
|
|
17
20
|
if (!excludes) {
|
|
18
21
|
return false;
|
|
@@ -38,7 +41,6 @@ function getter(data, path) {
|
|
|
38
41
|
}
|
|
39
42
|
return data;
|
|
40
43
|
}
|
|
41
|
-
exports.getter = getter;
|
|
42
44
|
function query(pre, params) {
|
|
43
45
|
var queries = [];
|
|
44
46
|
for (var _i = 0, _a = Object.entries(params); _i < _a.length; _i++) {
|
|
@@ -53,7 +55,6 @@ function query(pre, params) {
|
|
|
53
55
|
}
|
|
54
56
|
return queries.length ? "".concat(pre).concat(queries.join("&")) : "";
|
|
55
57
|
}
|
|
56
|
-
exports.query = query;
|
|
57
58
|
function toAlias(data, aliases) {
|
|
58
59
|
if (!data || typeof data !== "object" || Array.isArray(data)) {
|
|
59
60
|
return data;
|
|
@@ -61,7 +62,7 @@ function toAlias(data, aliases) {
|
|
|
61
62
|
var obj = {};
|
|
62
63
|
for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
|
|
63
64
|
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
64
|
-
var toAlias_1 = value
|
|
65
|
+
var toAlias_1 = value === null || value === void 0 ? void 0 : value.toAlias;
|
|
65
66
|
if (typeof toAlias_1 === "function") {
|
|
66
67
|
obj[key] = toAlias_1();
|
|
67
68
|
}
|
|
@@ -74,7 +75,6 @@ function toAlias(data, aliases) {
|
|
|
74
75
|
}
|
|
75
76
|
return obj;
|
|
76
77
|
}
|
|
77
|
-
exports.toAlias = toAlias;
|
|
78
78
|
function mapValues(record, mapping) {
|
|
79
79
|
return Object.entries(record).reduce(function (acc, _a) {
|
|
80
80
|
var key = _a[0], value = _a[1];
|
|
@@ -82,4 +82,3 @@ function mapValues(record, mapping) {
|
|
|
82
82
|
return acc;
|
|
83
83
|
}, {});
|
|
84
84
|
}
|
|
85
|
-
exports.mapValues = mapValues;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpb",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "The webpb runtime library",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "
|
|
8
|
+
"build": "tsc && cp README.md ./dist && cp package.json ./dist",
|
|
9
9
|
"check": "npm run lint && npm run test",
|
|
10
10
|
"lint": "eslint --quiet src/**/*.ts",
|
|
11
|
-
"lint
|
|
11
|
+
"lint:fix": "eslint --fix src/**/*.ts",
|
|
12
12
|
"deploy": "npm run check && npm run build && npm publish ./dist --access public",
|
|
13
13
|
"test": "jest --forceExit --coverage --verbose --detectOpenHandles"
|
|
14
14
|
},
|
|
@@ -23,22 +23,24 @@
|
|
|
23
23
|
"url": "https://github.com/jinganix/webpb"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@types/
|
|
28
|
-
"@
|
|
29
|
-
"@typescript-eslint/
|
|
30
|
-
"eslint": "^8.
|
|
26
|
+
"@eslint/compat": "^1.2.4",
|
|
27
|
+
"@types/jest": "^29.5.14",
|
|
28
|
+
"@types/node": "^22.10.1",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^8.17.0",
|
|
30
|
+
"@typescript-eslint/parser": "^8.17.0",
|
|
31
|
+
"eslint": "^9.16.0",
|
|
31
32
|
"eslint-config-prettier": "^9.1.0",
|
|
32
|
-
"eslint-plugin-import": "^2.
|
|
33
|
+
"eslint-plugin-import": "^2.31.0",
|
|
33
34
|
"eslint-plugin-import-quotes": "^0.0.1",
|
|
34
35
|
"eslint-plugin-no-null": "^1.0.2",
|
|
35
|
-
"eslint-plugin-prettier": "^5.1
|
|
36
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
36
37
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
37
38
|
"jest": "^29.7.0",
|
|
38
|
-
"prettier": "^3.2
|
|
39
|
+
"prettier": "^3.4.2",
|
|
39
40
|
"pretty-quick": "^4.0.0",
|
|
40
|
-
"ts-jest": "^29.
|
|
41
|
+
"ts-jest": "^29.2.5",
|
|
41
42
|
"ts-node": "^10.9.2",
|
|
42
|
-
"typescript": "^5.
|
|
43
|
+
"typescript": "^5.7.2",
|
|
44
|
+
"typescript-eslint": "^8.17.0"
|
|
43
45
|
}
|
|
44
46
|
}
|