@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.
- package/esm/context/GenerateContext.d.ts +79 -4
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +113 -33
- package/esm/oas/array/Array.d.ts +32 -8
- package/esm/oas/array/Array.d.ts.map +1 -1
- package/esm/oas/array/Array.js +60 -30
- package/esm/oas/boolean/Boolean.d.ts +24 -6
- package/esm/oas/boolean/Boolean.d.ts.map +1 -1
- package/esm/oas/boolean/Boolean.js +40 -24
- package/esm/oas/integer/Integer.d.ts +29 -8
- package/esm/oas/integer/Integer.d.ts.map +1 -1
- package/esm/oas/integer/Integer.js +57 -30
- package/esm/oas/number/Number.d.ts +24 -6
- package/esm/oas/number/Number.d.ts.map +1 -1
- package/esm/oas/number/Number.js +40 -24
- package/esm/oas/object/Object.d.ts +56 -12
- package/esm/oas/object/Object.d.ts.map +1 -1
- package/esm/oas/object/Object.js +52 -5
- package/esm/oas/string/String.d.ts +32 -8
- package/esm/oas/string/String.d.ts.map +1 -1
- package/esm/oas/string/String.js +63 -33
- package/esm/oas/union/Union.d.ts +38 -8
- package/esm/oas/union/Union.d.ts.map +1 -1
- package/esm/oas/union/Union.js +66 -30
- package/esm/oas/unknown/Unknown.d.ts +24 -5
- package/esm/oas/unknown/Unknown.d.ts.map +1 -1
- package/esm/oas/unknown/Unknown.js +34 -21
- package/esm/oas/void/Void.d.ts +22 -5
- package/esm/oas/void/Void.d.ts.map +1 -1
- package/esm/oas/void/Void.js +32 -21
- package/esm/server/createServer.d.ts.map +1 -1
- package/esm/server/createServer.js +2 -1
- package/esm/typescript/List.d.ts +19 -3
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +31 -0
- package/package.json +1 -1
- package/script/context/GenerateContext.d.ts +79 -4
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +113 -33
- package/script/oas/array/Array.d.ts +32 -8
- package/script/oas/array/Array.d.ts.map +1 -1
- package/script/oas/array/Array.js +60 -30
- package/script/oas/boolean/Boolean.d.ts +24 -6
- package/script/oas/boolean/Boolean.d.ts.map +1 -1
- package/script/oas/boolean/Boolean.js +40 -24
- package/script/oas/integer/Integer.d.ts +29 -8
- package/script/oas/integer/Integer.d.ts.map +1 -1
- package/script/oas/integer/Integer.js +57 -30
- package/script/oas/number/Number.d.ts +24 -6
- package/script/oas/number/Number.d.ts.map +1 -1
- package/script/oas/number/Number.js +40 -24
- package/script/oas/object/Object.d.ts +56 -12
- package/script/oas/object/Object.d.ts.map +1 -1
- package/script/oas/object/Object.js +52 -5
- package/script/oas/string/String.d.ts +32 -8
- package/script/oas/string/String.d.ts.map +1 -1
- package/script/oas/string/String.js +63 -33
- package/script/oas/union/Union.d.ts +38 -8
- package/script/oas/union/Union.d.ts.map +1 -1
- package/script/oas/union/Union.js +66 -30
- package/script/oas/unknown/Unknown.d.ts +24 -5
- package/script/oas/unknown/Unknown.d.ts.map +1 -1
- package/script/oas/unknown/Unknown.js +34 -21
- package/script/oas/void/Void.d.ts +22 -5
- package/script/oas/void/Void.d.ts.map +1 -1
- package/script/oas/void/Void.js +32 -21
- package/script/server/createServer.d.ts.map +1 -1
- package/script/server/createServer.js +2 -1
- package/script/typescript/List.d.ts +19 -3
- package/script/typescript/List.d.ts.map +1 -1
- 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;
|