@alanszp/errors 12.0.1 → 12.0.3

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.
Files changed (157) hide show
  1. package/package.json +3 -6
  2. package/.gitignore +0 -3
  3. package/.npmignore +0 -3
  4. package/node_modules/@alanszp/core/.gitignore +0 -3
  5. package/node_modules/@alanszp/core/.npmignore +0 -3
  6. package/node_modules/@alanszp/core/LICENSE +0 -21
  7. package/node_modules/@alanszp/core/dist/app/appIdentifier.d.ts +0 -1
  8. package/node_modules/@alanszp/core/dist/app/appIdentifier.js +0 -10
  9. package/node_modules/@alanszp/core/dist/app/appIdentifier.js.map +0 -1
  10. package/node_modules/@alanszp/core/dist/app/index.d.ts +0 -1
  11. package/node_modules/@alanszp/core/dist/app/index.js +0 -18
  12. package/node_modules/@alanszp/core/dist/app/index.js.map +0 -1
  13. package/node_modules/@alanszp/core/dist/assignKey.d.ts +0 -2
  14. package/node_modules/@alanszp/core/dist/assignKey.js +0 -20
  15. package/node_modules/@alanszp/core/dist/assignKey.js.map +0 -1
  16. package/node_modules/@alanszp/core/dist/editable/index.d.ts +0 -2
  17. package/node_modules/@alanszp/core/dist/editable/index.js +0 -19
  18. package/node_modules/@alanszp/core/dist/editable/index.js.map +0 -1
  19. package/node_modules/@alanszp/core/dist/editable/keepOrUpdate.d.ts +0 -3
  20. package/node_modules/@alanszp/core/dist/editable/keepOrUpdate.js +0 -26
  21. package/node_modules/@alanszp/core/dist/editable/keepOrUpdate.js.map +0 -1
  22. package/node_modules/@alanszp/core/dist/editable/types.d.ts +0 -6
  23. package/node_modules/@alanszp/core/dist/editable/types.js +0 -3
  24. package/node_modules/@alanszp/core/dist/editable/types.js.map +0 -1
  25. package/node_modules/@alanszp/core/dist/index.d.ts +0 -4
  26. package/node_modules/@alanszp/core/dist/index.js +0 -21
  27. package/node_modules/@alanszp/core/dist/index.js.map +0 -1
  28. package/node_modules/@alanszp/core/dist/lists/ListResult.d.ts +0 -7
  29. package/node_modules/@alanszp/core/dist/lists/ListResult.js +0 -8
  30. package/node_modules/@alanszp/core/dist/lists/ListResult.js.map +0 -1
  31. package/node_modules/@alanszp/core/dist/lists/Orderable.d.ts +0 -11
  32. package/node_modules/@alanszp/core/dist/lists/Orderable.js +0 -13
  33. package/node_modules/@alanszp/core/dist/lists/Orderable.js.map +0 -1
  34. package/node_modules/@alanszp/core/dist/lists/Paginable.d.ts +0 -14
  35. package/node_modules/@alanszp/core/dist/lists/Paginable.js +0 -22
  36. package/node_modules/@alanszp/core/dist/lists/Paginable.js.map +0 -1
  37. package/node_modules/@alanszp/core/dist/lists/index.d.ts +0 -3
  38. package/node_modules/@alanszp/core/dist/lists/index.js +0 -20
  39. package/node_modules/@alanszp/core/dist/lists/index.js.map +0 -1
  40. package/node_modules/@alanszp/core/package.json +0 -25
  41. package/node_modules/@alanszp/core/tsconfig.json +0 -15
  42. package/node_modules/@types/node/LICENSE +0 -21
  43. package/node_modules/@types/node/README.md +0 -15
  44. package/node_modules/@types/node/assert/strict.d.ts +0 -8
  45. package/node_modules/@types/node/assert.d.ts +0 -996
  46. package/node_modules/@types/node/async_hooks.d.ts +0 -539
  47. package/node_modules/@types/node/buffer.d.ts +0 -2362
  48. package/node_modules/@types/node/child_process.d.ts +0 -1540
  49. package/node_modules/@types/node/cluster.d.ts +0 -432
  50. package/node_modules/@types/node/console.d.ts +0 -415
  51. package/node_modules/@types/node/constants.d.ts +0 -19
  52. package/node_modules/@types/node/crypto.d.ts +0 -4487
  53. package/node_modules/@types/node/dgram.d.ts +0 -596
  54. package/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  55. package/node_modules/@types/node/dns/promises.d.ts +0 -425
  56. package/node_modules/@types/node/dns.d.ts +0 -809
  57. package/node_modules/@types/node/dom-events.d.ts +0 -122
  58. package/node_modules/@types/node/domain.d.ts +0 -170
  59. package/node_modules/@types/node/events.d.ts +0 -879
  60. package/node_modules/@types/node/fs/promises.d.ts +0 -1239
  61. package/node_modules/@types/node/fs.d.ts +0 -4311
  62. package/node_modules/@types/node/globals.d.ts +0 -411
  63. package/node_modules/@types/node/globals.global.d.ts +0 -1
  64. package/node_modules/@types/node/http.d.ts +0 -1887
  65. package/node_modules/@types/node/http2.d.ts +0 -2382
  66. package/node_modules/@types/node/https.d.ts +0 -550
  67. package/node_modules/@types/node/index.d.ts +0 -88
  68. package/node_modules/@types/node/inspector.d.ts +0 -2747
  69. package/node_modules/@types/node/module.d.ts +0 -315
  70. package/node_modules/@types/node/net.d.ts +0 -949
  71. package/node_modules/@types/node/os.d.ts +0 -478
  72. package/node_modules/@types/node/package.json +0 -229
  73. package/node_modules/@types/node/path.d.ts +0 -191
  74. package/node_modules/@types/node/perf_hooks.d.ts +0 -645
  75. package/node_modules/@types/node/process.d.ts +0 -1561
  76. package/node_modules/@types/node/punycode.d.ts +0 -117
  77. package/node_modules/@types/node/querystring.d.ts +0 -141
  78. package/node_modules/@types/node/readline/promises.d.ts +0 -150
  79. package/node_modules/@types/node/readline.d.ts +0 -539
  80. package/node_modules/@types/node/repl.d.ts +0 -430
  81. package/node_modules/@types/node/stream/consumers.d.ts +0 -12
  82. package/node_modules/@types/node/stream/promises.d.ts +0 -83
  83. package/node_modules/@types/node/stream/web.d.ts +0 -366
  84. package/node_modules/@types/node/stream.d.ts +0 -1701
  85. package/node_modules/@types/node/string_decoder.d.ts +0 -67
  86. package/node_modules/@types/node/test.d.ts +0 -1465
  87. package/node_modules/@types/node/timers/promises.d.ts +0 -93
  88. package/node_modules/@types/node/timers.d.ts +0 -240
  89. package/node_modules/@types/node/tls.d.ts +0 -1210
  90. package/node_modules/@types/node/trace_events.d.ts +0 -182
  91. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  92. package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  93. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  94. package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  95. package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  96. package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  97. package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  98. package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  99. package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  100. package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  101. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  102. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  103. package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  104. package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  105. package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  106. package/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  107. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  108. package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  109. package/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  110. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  111. package/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  112. package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  113. package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  114. package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  115. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  116. package/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  117. package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  118. package/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  119. package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  120. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  121. package/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  122. package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  123. package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  124. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  125. package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  126. package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  127. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  128. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  129. package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  130. package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  131. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  132. package/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  133. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  134. package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  135. package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  136. package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  137. package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  138. package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  139. package/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  140. package/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  141. package/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  142. package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  143. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  144. package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  145. package/node_modules/@types/node/tty.d.ts +0 -208
  146. package/node_modules/@types/node/url.d.ts +0 -927
  147. package/node_modules/@types/node/util.d.ts +0 -2183
  148. package/node_modules/@types/node/v8.d.ts +0 -764
  149. package/node_modules/@types/node/vm.d.ts +0 -903
  150. package/node_modules/@types/node/wasi.d.ts +0 -179
  151. package/node_modules/@types/node/worker_threads.d.ts +0 -691
  152. package/node_modules/@types/node/zlib.d.ts +0 -517
  153. package/src/BaseError.ts +0 -14
  154. package/src/HttpRenderableError.ts +0 -5
  155. package/src/InternalServerError.ts +0 -32
  156. package/src/RenderableError.ts +0 -37
  157. package/src/index.ts +0 -4
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "@alanszp/errors",
3
- "version": "12.0.1",
3
+ "version": "12.0.3",
4
4
  "description": "Alan's basic errors classes.",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "license": "MIT",
8
- "files": [
9
- "**/*"
10
- ],
11
8
  "publishConfig": {
12
9
  "access": "public"
13
10
  },
@@ -22,7 +19,7 @@
22
19
  "@alanszp/errors": ">=12.0.0"
23
20
  },
24
21
  "devDependencies": {
25
- "@alanszp/core": "^12.0.0",
22
+ "@alanszp/core": "^12.0.3",
26
23
  "@types/node": "^20.11.17",
27
24
  "ts-node": "^10.0.0",
28
25
  "typescript": "^4.3.4"
@@ -30,5 +27,5 @@
30
27
  "dependencies": {
31
28
  "lodash": "^4.17.21"
32
29
  },
33
- "gitHead": "2320e554850aec120e0e8bc71c00a2197187af40"
30
+ "gitHead": "3917709ea888ae321c2ea6ab36dfc90597ccd35e"
34
31
  }
package/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- node_modules
2
- *.log
3
- dist
package/.npmignore DELETED
@@ -1,3 +0,0 @@
1
- node_modules
2
- src
3
- *.log
@@ -1,3 +0,0 @@
1
- node_modules
2
- *.log
3
- dist
@@ -1,3 +0,0 @@
1
- node_modules
2
- src
3
- *.log
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Alan Szpigiel
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1 +0,0 @@
1
- export declare function appIdentifier(): string;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appIdentifier = void 0;
4
- function appIdentifier() {
5
- const appName = process.env.API_ORIGIN_NAME || "undefined";
6
- const env = process.env.NODE_ENV || "development";
7
- return `${appName}:${env}`;
8
- }
9
- exports.appIdentifier = appIdentifier;
10
- //# sourceMappingURL=appIdentifier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"appIdentifier.js","sourceRoot":"","sources":["../../src/app/appIdentifier.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa;IAC3B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,WAAW,CAAC;IAC3D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;IAClD,OAAO,GAAG,OAAO,IAAI,GAAG,EAAE,CAAC;AAC7B,CAAC;AAJD,sCAIC"}
@@ -1 +0,0 @@
1
- export * from "./appIdentifier";
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./appIdentifier"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC"}
@@ -1,2 +0,0 @@
1
- export declare function assignKey<CommonInterface, Key extends keyof CommonInterface>(target: CommonInterface, source: CommonInterface, key: Key, defaultValue?: CommonInterface[Key]): void;
2
- export declare function assignKeys<CommonInterface>(target: CommonInterface, source: CommonInterface, keys: (keyof CommonInterface)[]): void;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assignKeys = exports.assignKey = void 0;
4
- function assignKey(target, source, key, defaultValue) {
5
- if (source[key] !== undefined) {
6
- target[key] = source[key];
7
- return;
8
- }
9
- if (defaultValue !== undefined) {
10
- target[key] = defaultValue;
11
- }
12
- }
13
- exports.assignKey = assignKey;
14
- function assignKeys(target, source, keys) {
15
- keys.forEach((key) => {
16
- assignKey(target, source, key);
17
- });
18
- }
19
- exports.assignKeys = assignKeys;
20
- //# sourceMappingURL=assignKey.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assignKey.js","sourceRoot":"","sources":["../src/assignKey.ts"],"names":[],"mappings":";;;AAAA,SAAgB,SAAS,CACvB,MAAuB,EACvB,MAAuB,EACvB,GAAQ,EACR,YAAmC;IAEnC,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;QAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,OAAO;KACR;IAED,IAAI,YAAY,KAAK,SAAS,EAAE;QAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC;KAC5B;AACH,CAAC;AAdD,8BAcC;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;AARD,gCAQC"}
@@ -1,2 +0,0 @@
1
- export * from "./keepOrUpdate";
2
- export * from "./types";
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./keepOrUpdate"), exports);
18
- __exportStar(require("./types"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/editable/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,0CAAwB"}
@@ -1,3 +0,0 @@
1
- import { EditableAndNullableField } from "./types";
2
- export declare function keepOrUpdate<FieldType extends unknown, EditionType extends unknown>(defined: FieldType, value: EditableAndNullableField<EditionType>, formatter?: (value: EditionType) => FieldType): FieldType | null;
3
- export declare function keepOrUpdateAsync<FieldType extends unknown, EditionType extends unknown>(defined: FieldType, value: EditableAndNullableField<EditionType>, formatter?: (value: EditionType) => Promise<FieldType>): Promise<FieldType | null>;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.keepOrUpdateAsync = exports.keepOrUpdate = void 0;
4
- function id(param) {
5
- return param;
6
- }
7
- function idAsync(param) {
8
- return param;
9
- }
10
- function keepOrUpdate(defined, value, formatter = id) {
11
- if (value === undefined)
12
- return defined;
13
- if (value === null)
14
- return null;
15
- return formatter(value);
16
- }
17
- exports.keepOrUpdate = keepOrUpdate;
18
- function keepOrUpdateAsync(defined, value, formatter = idAsync) {
19
- if (value === undefined)
20
- return Promise.resolve(defined);
21
- if (value === null)
22
- return Promise.resolve(null);
23
- return formatter(value);
24
- }
25
- exports.keepOrUpdateAsync = keepOrUpdateAsync;
26
- //# sourceMappingURL=keepOrUpdate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keepOrUpdate.js","sourceRoot":"","sources":["../../src/editable/keepOrUpdate.ts"],"names":[],"mappings":";;;AAEA,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;AAbD,oCAaC;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;AAbD,8CAaC"}
@@ -1,6 +0,0 @@
1
- export declare type JustEditableField<T> = T | undefined;
2
- export declare type EditableAndNullableField<T> = T | undefined | null;
3
- export declare type EditableField<T> = T extends undefined | null ? EditableAndNullableField<T> : JustEditableField<T>;
4
- export declare type EditableObject<T> = {
5
- [key in keyof T]: EditableField<T[key]>;
6
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/editable/types.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export * from "./assignKey";
2
- export * from "./lists";
3
- export * from "./editable";
4
- export * from "./app";
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./assignKey"), exports);
18
- __exportStar(require("./lists"), exports);
19
- __exportStar(require("./editable"), exports);
20
- __exportStar(require("./app"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,0CAAwB;AACxB,6CAA2B;AAC3B,wCAAsB"}
@@ -1,7 +0,0 @@
1
- export interface ListResult<Result> {
2
- elements: Result[];
3
- total: number;
4
- page: number;
5
- pageSize: number;
6
- }
7
- export declare function mapListResult<T, R>(list: ListResult<T>, mapper: (elem: T) => R): ListResult<R>;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapListResult = void 0;
4
- function mapListResult(list, mapper) {
5
- return Object.assign(Object.assign({}, list), { elements: list.elements.map((c) => mapper(c)) });
6
- }
7
- exports.mapListResult = mapListResult;
8
- //# sourceMappingURL=ListResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListResult.js","sourceRoot":"","sources":["../../src/lists/ListResult.ts"],"names":[],"mappings":";;;AAOA,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;AARD,sCAQC"}
@@ -1,11 +0,0 @@
1
- export declare type OrderDirection = "ASC" | "DESC";
2
- export declare const ORDER_DIRECTIONS: string[];
3
- export interface Orderable<T extends string | number | symbol = "id"> {
4
- orderBy: T;
5
- orderDirection: OrderDirection;
6
- }
7
- export declare function getOrderObject<K extends string | number | symbol, T extends Orderable<K>>(object: T): {
8
- order: {
9
- [x: string]: OrderDirection;
10
- };
11
- };
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOrderObject = exports.ORDER_DIRECTIONS = void 0;
4
- exports.ORDER_DIRECTIONS = ["ASC", "DESC"];
5
- function getOrderObject(object) {
6
- return {
7
- order: {
8
- [object.orderBy]: object.orderDirection,
9
- },
10
- };
11
- }
12
- exports.getOrderObject = getOrderObject;
13
- //# sourceMappingURL=Orderable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Orderable.js","sourceRoot":"","sources":["../../src/lists/Orderable.ts"],"names":[],"mappings":";;;AAEa,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;AATD,wCASC"}
@@ -1,14 +0,0 @@
1
- export interface Paginable<Validated extends boolean = false> {
2
- pageSize: Validated extends true ? number : number | string;
3
- page: Validated extends true ? number : number | string;
4
- }
5
- export declare function getPageObject<T extends Paginable<true>>(object: T): {
6
- skip: number;
7
- take: number;
8
- };
9
- /**
10
- * Assigns the page and pageSize keys to the target object
11
- * @param target Paginable Input
12
- * @param source Paginable Source
13
- */
14
- export declare function assignPaginableKeys<T extends Paginable<false>, K extends Partial<Paginable<false>>>(target: T, source: K): void;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assignPaginableKeys = exports.getPageObject = void 0;
4
- function getPageObject(object) {
5
- return {
6
- skip: (object.page - 1) * object.pageSize,
7
- take: object.pageSize,
8
- };
9
- }
10
- exports.getPageObject = getPageObject;
11
- /**
12
- * Assigns the page and pageSize keys to the target object
13
- * @param target Paginable Input
14
- * @param source Paginable Source
15
- */
16
- function assignPaginableKeys(target, source) {
17
- // Mind the || operator, it's on purpose to avoid the 0 value (cause falsy value)
18
- target.page = Number.parseInt(source.page, 10) || 1;
19
- target.pageSize = Number.parseInt(source.pageSize, 10) || 100;
20
- }
21
- exports.assignPaginableKeys = assignPaginableKeys;
22
- //# sourceMappingURL=Paginable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Paginable.js","sourceRoot":"","sources":["../../src/lists/Paginable.ts"],"names":[],"mappings":";;;AAKA,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;AALD,sCAKC;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;AAPD,kDAOC"}
@@ -1,3 +0,0 @@
1
- export * from "./ListResult";
2
- export * from "./Orderable";
3
- export * from "./Paginable";
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./ListResult"), exports);
18
- __exportStar(require("./Orderable"), exports);
19
- __exportStar(require("./Paginable"), exports);
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lists/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,8CAA4B;AAC5B,8CAA4B"}
@@ -1,25 +0,0 @@
1
- {
2
- "name": "@alanszp/core",
3
- "version": "11.0.0",
4
- "description": "Alan's core TS/JS lib.",
5
- "main": "dist/index.js",
6
- "typings": "dist/index.d.ts",
7
- "license": "MIT",
8
- "files": [
9
- "**/*"
10
- ],
11
- "publishConfig": {
12
- "access": "public"
13
- },
14
- "scripts": {
15
- "compile": "rm -rf ./dist && tsc --declaration",
16
- "compile-watch": "tsc -w",
17
- "build": "yarn run compile",
18
- "prepack": "yarn run build",
19
- "yalc-publish": "yarn run yalc publish"
20
- },
21
- "devDependencies": {
22
- "@types/node": "^20.11.17"
23
- },
24
- "gitHead": "60b62fa2fff34ef094ea9af69c2bed2373c70f64"
25
- }
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "rootDir": "src",
4
- "outDir": "dist",
5
- "module": "commonjs",
6
- "target": "es6",
7
- "types": ["node"],
8
- "esModuleInterop": true,
9
- "sourceMap": true,
10
-
11
- "alwaysStrict": true,
12
- "strictNullChecks": true
13
- },
14
- "exclude": ["node_modules"]
15
- }
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE
@@ -1,15 +0,0 @@
1
- # Installation
2
- > `npm install --save @types/node`
3
-
4
- # Summary
5
- This package contains type definitions for node (https://nodejs.org/).
6
-
7
- # Details
8
- Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
-
10
- ### Additional Details
11
- * Last updated: Thu, 08 Feb 2024 20:35:44 GMT
12
- * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
-
14
- # Credits
15
- These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
@@ -1,8 +0,0 @@
1
- declare module "assert/strict" {
2
- import { strict } from "node:assert";
3
- export = strict;
4
- }
5
- declare module "node:assert/strict" {
6
- import { strict } from "node:assert";
7
- export = strict;
8
- }