@alanszp/core 16.0.0 → 17.0.0
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/app/appIdentifier.js +1 -2
- package/dist/app/appIdentifier.js.map +1 -1
- package/dist/assignKey.js +2 -3
- package/dist/assignKey.js.map +1 -1
- package/dist/editable/keepOrUpdate.js +2 -3
- package/dist/editable/keepOrUpdate.js.map +1 -1
- package/dist/editable/types.d.ts +4 -4
- package/dist/lists/ListResult.js +1 -2
- package/dist/lists/ListResult.js.map +1 -1
- package/dist/lists/Orderable.d.ts +1 -1
- package/dist/lists/Orderable.js +2 -2
- package/dist/lists/Orderable.js.map +1 -1
- package/dist/lists/Paginable.js +2 -3
- package/dist/lists/Paginable.js.map +1 -1
- package/dist/types.d.ts +4 -4
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.appIdentifier =
|
|
3
|
+
exports.appIdentifier = appIdentifier;
|
|
4
4
|
const shortEnvName = {
|
|
5
5
|
production: "prd",
|
|
6
6
|
staging: "stg",
|
|
@@ -16,5 +16,4 @@ function appIdentifier() {
|
|
|
16
16
|
: "dev";
|
|
17
17
|
return `${roleName ? `${appName}:${roleName}` : appName}:${env}`;
|
|
18
18
|
}
|
|
19
|
-
exports.appIdentifier = appIdentifier;
|
|
20
19
|
//# sourceMappingURL=appIdentifier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appIdentifier.js","sourceRoot":"","sources":["../../src/app/appIdentifier.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"appIdentifier.js","sourceRoot":"","sources":["../../src/app/appIdentifier.ts"],"names":[],"mappings":";;AAOA,sCAWC;AAlBD,MAAM,YAAY,GAA2B;IAC3C,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,KAAK;IAClB,IAAI,EAAE,KAAK;CACZ,CAAC;AAEF,SAAgB,aAAa;;IAC3B,MAAM,OAAO,GACX,MAAA,MAAA,OAAO,CAAC,GAAG,CAAC,YAAY,mCAAI,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,OAAO,CAAC;IAErE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;IAEvC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ;QAC9B,CAAC,CAAC,MAAA,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,mCAAI,OAAO,CAAC,GAAG,CAAC,QAAQ;QAC5D,CAAC,CAAC,KAAK,CAAC;IAEV,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,GAAG,EAAE,CAAC;AACnE,CAAC"}
|
package/dist/assignKey.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.assignKey = assignKey;
|
|
4
|
+
exports.assignKeys = assignKeys;
|
|
4
5
|
function assignKey(target, source, key, defaultValue) {
|
|
5
6
|
if (source[key] !== undefined) {
|
|
6
7
|
target[key] = source[key];
|
|
@@ -10,11 +11,9 @@ function assignKey(target, source, key, defaultValue) {
|
|
|
10
11
|
target[key] = defaultValue;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
exports.assignKey = assignKey;
|
|
14
14
|
function assignKeys(target, source, keys) {
|
|
15
15
|
keys.forEach((key) => {
|
|
16
16
|
assignKey(target, source, key);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
exports.assignKeys = assignKeys;
|
|
20
19
|
//# sourceMappingURL=assignKey.js.map
|
package/dist/assignKey.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assignKey.js","sourceRoot":"","sources":["../src/assignKey.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assignKey.js","sourceRoot":"","sources":["../src/assignKey.ts"],"names":[],"mappings":";;AAAA,8BAcC;AAED,gCAQC;AAxBD,SAAgB,SAAS,CACvB,MAAuB,EACvB,MAAuB,EACvB,GAAQ,EACR,YAAmC;IAEnC,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,SAAgB,UAAU,CACxB,MAAuB,EACvB,MAAuB,EACvB,IAA+B;IAE/B,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.keepOrUpdate = keepOrUpdate;
|
|
4
|
+
exports.keepOrUpdateAsync = keepOrUpdateAsync;
|
|
4
5
|
function id(param) {
|
|
5
6
|
return param;
|
|
6
7
|
}
|
|
@@ -14,7 +15,6 @@ function keepOrUpdate(defined, value, formatter = id) {
|
|
|
14
15
|
return null;
|
|
15
16
|
return formatter(value);
|
|
16
17
|
}
|
|
17
|
-
exports.keepOrUpdate = keepOrUpdate;
|
|
18
18
|
function keepOrUpdateAsync(defined, value, formatter = idAsync) {
|
|
19
19
|
if (value === undefined)
|
|
20
20
|
return Promise.resolve(defined);
|
|
@@ -22,5 +22,4 @@ function keepOrUpdateAsync(defined, value, formatter = idAsync) {
|
|
|
22
22
|
return Promise.resolve(null);
|
|
23
23
|
return formatter(value);
|
|
24
24
|
}
|
|
25
|
-
exports.keepOrUpdateAsync = keepOrUpdateAsync;
|
|
26
25
|
//# sourceMappingURL=keepOrUpdate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keepOrUpdate.js","sourceRoot":"","sources":["../../src/editable/keepOrUpdate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keepOrUpdate.js","sourceRoot":"","sources":["../../src/editable/keepOrUpdate.ts"],"names":[],"mappings":";;AAaA,oCAaC;AAED,8CAaC;AAvCD,SAAS,EAAE,CACT,KAAkB;IAElB,OAAO,KAA6B,CAAC;AACvC,CAAC;AACD,SAAS,OAAO,CACd,KAAkB;IAElB,OAAO,KAA2B,CAAC;AACrC,CAAC;AAED,SAAgB,YAAY,CAI1B,OAAkB,EAClB,KAA4C,EAC5C,YAA+C,EAAE;IAEjD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IAExC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED,SAAgB,iBAAiB,CAI/B,OAAkB,EAClB,KAA4C,EAC5C,YAAwD,OAAO;IAE/D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzD,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/editable/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export type JustEditableField<T> = T | undefined;
|
|
2
|
+
export type EditableAndNullableField<T> = T | undefined | null;
|
|
3
|
+
export type EditableField<T> = T extends undefined | null ? EditableAndNullableField<T> : JustEditableField<T>;
|
|
4
|
+
export type EditableObject<T> = {
|
|
5
5
|
[key in keyof T]: EditableField<T[key]>;
|
|
6
6
|
};
|
package/dist/lists/ListResult.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapListResult =
|
|
3
|
+
exports.mapListResult = mapListResult;
|
|
4
4
|
function mapListResult(list, mapper) {
|
|
5
5
|
return Object.assign(Object.assign({}, list), { elements: list.elements.map((c) => mapper(c)) });
|
|
6
6
|
}
|
|
7
|
-
exports.mapListResult = mapListResult;
|
|
8
7
|
//# sourceMappingURL=ListResult.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListResult.js","sourceRoot":"","sources":["../../src/lists/ListResult.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListResult.js","sourceRoot":"","sources":["../../src/lists/ListResult.ts"],"names":[],"mappings":";;AAOA,sCAQC;AARD,SAAgB,aAAa,CAC3B,IAAmB,EACnB,MAAsB;IAEtB,uCACK,IAAI,KACP,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAC7C;AACJ,CAAC"}
|
package/dist/lists/Orderable.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ORDER_DIRECTIONS = void 0;
|
|
4
|
+
exports.getOrderObject = getOrderObject;
|
|
4
5
|
exports.ORDER_DIRECTIONS = ["ASC", "DESC"];
|
|
5
6
|
function getOrderObject(object) {
|
|
6
7
|
return {
|
|
@@ -9,5 +10,4 @@ function getOrderObject(object) {
|
|
|
9
10
|
},
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
|
-
exports.getOrderObject = getOrderObject;
|
|
13
13
|
//# sourceMappingURL=Orderable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Orderable.js","sourceRoot":"","sources":["../../src/lists/Orderable.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Orderable.js","sourceRoot":"","sources":["../../src/lists/Orderable.ts"],"names":[],"mappings":";;;AASA,wCASC;AAhBY,QAAA,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAOhD,SAAgB,cAAc,CAG5B,MAAS;IACT,OAAO;QACL,KAAK,EAAE;YACL,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,cAAc;SACxC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/lists/Paginable.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getPageObject = getPageObject;
|
|
4
|
+
exports.assignPaginableKeys = assignPaginableKeys;
|
|
4
5
|
function getPageObject(object) {
|
|
5
6
|
return {
|
|
6
7
|
skip: (object.page - 1) * object.pageSize,
|
|
7
8
|
take: object.pageSize,
|
|
8
9
|
};
|
|
9
10
|
}
|
|
10
|
-
exports.getPageObject = getPageObject;
|
|
11
11
|
/**
|
|
12
12
|
* Assigns the page and pageSize keys to the target object
|
|
13
13
|
* @param target Paginable Input
|
|
@@ -18,5 +18,4 @@ function assignPaginableKeys(target, source) {
|
|
|
18
18
|
target.page = Number.parseInt(source.page, 10) || 1;
|
|
19
19
|
target.pageSize = Number.parseInt(source.pageSize, 10) || 100;
|
|
20
20
|
}
|
|
21
|
-
exports.assignPaginableKeys = assignPaginableKeys;
|
|
22
21
|
//# sourceMappingURL=Paginable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paginable.js","sourceRoot":"","sources":["../../src/lists/Paginable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Paginable.js","sourceRoot":"","sources":["../../src/lists/Paginable.ts"],"names":[],"mappings":";;AAKA,sCAKC;AAOD,kDAOC;AAnBD,SAAgB,aAAa,CAA4B,MAAS;IAChE,OAAO;QACL,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ;QACzC,IAAI,EAAE,MAAM,CAAC,QAAQ;KACtB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAGjC,MAAS,EAAE,MAAS;IACpB,iFAAiF;IACjF,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAkB,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC;AAC1E,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type RequiredNotNull<T> = {
|
|
2
2
|
[P in keyof T]: NonNullable<T[P]>;
|
|
3
3
|
};
|
|
4
|
-
export
|
|
4
|
+
export type RequiredNull<T> = {
|
|
5
5
|
[P in keyof T]: null;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type Ensure<T, K extends keyof T> = T & RequiredNotNull<Pick<T, K>>;
|
|
8
|
+
export type EnsureNull<T, K extends keyof T> = T & RequiredNull<Pick<T, K>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alanszp/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.0",
|
|
4
4
|
"description": "Alan's core TS/JS lib.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "^20.11.17"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "db3463706e4b0b7fc97aa74e95cc7d6572c5d74b"
|
|
22
22
|
}
|