@skmtc/core 0.0.367 → 0.0.369

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 (71) hide show
  1. package/esm/context/GenerateContext.d.ts +79 -4
  2. package/esm/context/GenerateContext.d.ts.map +1 -1
  3. package/esm/context/GenerateContext.js +113 -33
  4. package/esm/oas/array/Array.d.ts +32 -8
  5. package/esm/oas/array/Array.d.ts.map +1 -1
  6. package/esm/oas/array/Array.js +60 -30
  7. package/esm/oas/boolean/Boolean.d.ts +24 -6
  8. package/esm/oas/boolean/Boolean.d.ts.map +1 -1
  9. package/esm/oas/boolean/Boolean.js +40 -24
  10. package/esm/oas/integer/Integer.d.ts +29 -8
  11. package/esm/oas/integer/Integer.d.ts.map +1 -1
  12. package/esm/oas/integer/Integer.js +57 -30
  13. package/esm/oas/number/Number.d.ts +24 -6
  14. package/esm/oas/number/Number.d.ts.map +1 -1
  15. package/esm/oas/number/Number.js +40 -24
  16. package/esm/oas/object/Object.d.ts +56 -12
  17. package/esm/oas/object/Object.d.ts.map +1 -1
  18. package/esm/oas/object/Object.js +52 -5
  19. package/esm/oas/string/String.d.ts +32 -8
  20. package/esm/oas/string/String.d.ts.map +1 -1
  21. package/esm/oas/string/String.js +63 -33
  22. package/esm/oas/union/Union.d.ts +38 -8
  23. package/esm/oas/union/Union.d.ts.map +1 -1
  24. package/esm/oas/union/Union.js +66 -30
  25. package/esm/oas/unknown/Unknown.d.ts +24 -5
  26. package/esm/oas/unknown/Unknown.d.ts.map +1 -1
  27. package/esm/oas/unknown/Unknown.js +34 -21
  28. package/esm/oas/void/Void.d.ts +22 -5
  29. package/esm/oas/void/Void.d.ts.map +1 -1
  30. package/esm/oas/void/Void.js +32 -21
  31. package/esm/server/createServer.d.ts.map +1 -1
  32. package/esm/server/createServer.js +2 -1
  33. package/esm/typescript/List.d.ts +19 -3
  34. package/esm/typescript/List.d.ts.map +1 -1
  35. package/esm/typescript/List.js +31 -0
  36. package/package.json +1 -1
  37. package/script/context/GenerateContext.d.ts +79 -4
  38. package/script/context/GenerateContext.d.ts.map +1 -1
  39. package/script/context/GenerateContext.js +113 -33
  40. package/script/oas/array/Array.d.ts +32 -8
  41. package/script/oas/array/Array.d.ts.map +1 -1
  42. package/script/oas/array/Array.js +60 -30
  43. package/script/oas/boolean/Boolean.d.ts +24 -6
  44. package/script/oas/boolean/Boolean.d.ts.map +1 -1
  45. package/script/oas/boolean/Boolean.js +40 -24
  46. package/script/oas/integer/Integer.d.ts +29 -8
  47. package/script/oas/integer/Integer.d.ts.map +1 -1
  48. package/script/oas/integer/Integer.js +57 -30
  49. package/script/oas/number/Number.d.ts +24 -6
  50. package/script/oas/number/Number.d.ts.map +1 -1
  51. package/script/oas/number/Number.js +40 -24
  52. package/script/oas/object/Object.d.ts +56 -12
  53. package/script/oas/object/Object.d.ts.map +1 -1
  54. package/script/oas/object/Object.js +52 -5
  55. package/script/oas/string/String.d.ts +32 -8
  56. package/script/oas/string/String.d.ts.map +1 -1
  57. package/script/oas/string/String.js +63 -33
  58. package/script/oas/union/Union.d.ts +38 -8
  59. package/script/oas/union/Union.d.ts.map +1 -1
  60. package/script/oas/union/Union.js +66 -30
  61. package/script/oas/unknown/Unknown.d.ts +24 -5
  62. package/script/oas/unknown/Unknown.d.ts.map +1 -1
  63. package/script/oas/unknown/Unknown.js +34 -21
  64. package/script/oas/void/Void.d.ts +22 -5
  65. package/script/oas/void/Void.d.ts.map +1 -1
  66. package/script/oas/void/Void.js +32 -21
  67. package/script/server/createServer.d.ts.map +1 -1
  68. package/script/server/createServer.js +2 -1
  69. package/script/typescript/List.d.ts +19 -3
  70. package/script/typescript/List.d.ts.map +1 -1
  71. package/script/typescript/List.js +33 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KeyList = exports.List = void 0;
3
+ exports.EntryList = exports.KeyList = exports.List = void 0;
4
4
  const ts_pattern_1 = require("ts-pattern");
5
5
  class List {
6
6
  constructor(values, { separator, bookends } = {}) {
@@ -211,6 +211,20 @@ Object.defineProperty(List, "fromKeys", {
211
211
  return new KeyList(Object.keys(record ?? {}));
212
212
  }
213
213
  });
214
+ /**
215
+ * Create a EntryList using the entries of @param record
216
+ * @afdafg
217
+ * @param record
218
+ * @returns EntryList
219
+ */
220
+ Object.defineProperty(List, "fromEntrys", {
221
+ enumerable: true,
222
+ configurable: true,
223
+ writable: true,
224
+ value: (record) => {
225
+ return new EntryList(Object.entries(record ?? {}));
226
+ }
227
+ });
214
228
  /**
215
229
  * Create a keyValue pair if `value` is not undefined and is not an empty array or List.
216
230
  * Return `undefined` otherwise.
@@ -275,3 +289,21 @@ class KeyList {
275
289
  }
276
290
  }
277
291
  exports.KeyList = KeyList;
292
+ class EntryList {
293
+ constructor(entries) {
294
+ Object.defineProperty(this, "entries", {
295
+ enumerable: true,
296
+ configurable: true,
297
+ writable: true,
298
+ value: void 0
299
+ });
300
+ this.entries = entries;
301
+ }
302
+ toObject(mapFn) {
303
+ return List.toObject(this.entries.map((entry, index) => mapFn(entry, index)));
304
+ }
305
+ toLines(mapFn) {
306
+ return List.toLines(this.entries.map((key, index) => mapFn(key, index)));
307
+ }
308
+ }
309
+ exports.EntryList = EntryList;