@augment-vir/common 4.4.0 → 4.6.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.
|
@@ -59,4 +59,5 @@ export declare type ObjectWithAtLeastSingleEntryArrays<BaseObject extends object
|
|
|
59
59
|
* entries in that array.
|
|
60
60
|
*/
|
|
61
61
|
export declare function assertMatchesObjectShape<MatchThisGeneric extends object = never>(testThisOne: unknown, compareToThisOne: NoInfer<ObjectWithAtLeastSingleEntryArrays<MatchThisGeneric>>, allowExtraProps?: boolean): asserts testThisOne is MatchThisGeneric;
|
|
62
|
+
export declare function typedObjectFromEntries<KeyType extends PropertyKey, ValueType>(entries: ReadonlyArray<Readonly<[KeyType, ValueType]>>): Record<KeyType, ValueType>;
|
|
62
63
|
export {};
|
package/dist/augments/object.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertMatchesObjectShape = exports.matchesObjectShape = exports.copyThroughJson = exports.filterObject = exports.mapObjectValues = exports.areJsonEqual = exports.getEntriesSortedByKey = exports.isObject = exports.typedHasProperties = exports.typedHasProperty = exports.getObjectTypedValues = exports.getObjectTypedKeys = exports.filterToEnumValues = exports.isKeyof = exports.isEnumValue = exports.getEnumTypedValues = exports.getEnumTypedKeys = void 0;
|
|
3
|
+
exports.typedObjectFromEntries = exports.assertMatchesObjectShape = exports.matchesObjectShape = exports.copyThroughJson = exports.filterObject = exports.mapObjectValues = exports.areJsonEqual = exports.getEntriesSortedByKey = exports.isObject = exports.typedHasProperties = exports.typedHasProperty = exports.getObjectTypedValues = exports.getObjectTypedKeys = exports.filterToEnumValues = exports.isKeyof = exports.isEnumValue = exports.getEnumTypedValues = exports.getEnumTypedKeys = void 0;
|
|
4
4
|
const error_1 = require("./error");
|
|
5
5
|
const function_1 = require("./function");
|
|
6
6
|
function getEnumTypedKeys(input) {
|
|
@@ -267,3 +267,7 @@ function compareInnerValue(testValue, matchValue, throwKeyError) {
|
|
|
267
267
|
assertMatchesObjectShape(testValue, matchValue);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
+
function typedObjectFromEntries(entries) {
|
|
271
|
+
return Object.fromEntries(entries);
|
|
272
|
+
}
|
|
273
|
+
exports.typedObjectFromEntries = typedObjectFromEntries;
|