Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@augment-vir/common

Package Overview
Dependencies
Maintainers
1
Versions
222
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@augment-vir/common - npm Package Compare versions

Comparing version 6.1.2 to 6.1.3

5

dist/cjs/augments/object.d.ts

@@ -48,2 +48,5 @@ import { AtLeastOneEntryArray } from './array';

};
type NestedBoolean<MatchObject extends object> = Partial<{
[Prop in keyof MatchObject]: MatchObject[Prop] extends object ? NestedBoolean<MatchObject[Prop]> | boolean : boolean;
}>;
/**

@@ -62,5 +65,5 @@ * Asserts that the first input, testThisOne, matches the object shape of the second input,

*/
export declare function assertMatchesObjectShape<MatchThisGeneric extends object = never>(testThisOne: unknown, compareToThisOne: NoInfer<ObjectWithAtLeastSingleEntryArrays<MatchThisGeneric>>, allowExtraProps?: boolean, noCheckInnerValueOfTheseKeys?: Partial<Record<keyof typeof compareToThisOne, boolean>>): asserts testThisOne is MatchThisGeneric;
export declare function assertMatchesObjectShape<MatchThisGeneric extends object = never>(testThisOne: unknown, compareToThisOne: NoInfer<ObjectWithAtLeastSingleEntryArrays<MatchThisGeneric>>, allowExtraProps?: boolean, noCheckInnerValueOfTheseKeys?: NestedBoolean<typeof compareToThisOne>): asserts testThisOne is MatchThisGeneric;
export declare function typedObjectFromEntries<KeyType extends PropertyKey, ValueType>(entries: ReadonlyArray<Readonly<[KeyType, ValueType]>>): Record<KeyType, ValueType>;
export {};
//# sourceMappingURL=object.d.ts.map

9

dist/cjs/augments/object.js

@@ -212,2 +212,3 @@ "use strict";

matchKeys.forEach((key) => {
var _a;
if (!typedHasProperty(testThisOne, key)) {

@@ -222,3 +223,3 @@ throw new Error(`test object does not have key "${String(key)}" from expected shape.`);

if (!noCheckInnerValueOfTheseKeys[key]) {
compareInnerValue(testValue, shouldMatch, throwKeyError, allowExtraProps);
compareInnerValue(testValue, shouldMatch, throwKeyError, allowExtraProps, (_a = noCheckInnerValueOfTheseKeys[key]) !== null && _a !== void 0 ? _a : {});
}

@@ -228,3 +229,3 @@ });

exports.assertMatchesObjectShape = assertMatchesObjectShape;
function compareInnerValue(testValue, matchValue, throwKeyError, allowExtraProps) {
function compareInnerValue(testValue, matchValue, throwKeyError, allowExtraProps, noCheckInnerValueOfTheseKeys) {
var _a;

@@ -258,3 +259,3 @@ const testType = typeof testValue;

try {
compareInnerValue(testValueEntry, matchValue, throwKeyError, allowExtraProps);
compareInnerValue(testValueEntry, matchValue, throwKeyError, allowExtraProps, noCheckInnerValueOfTheseKeys);
return undefined;

@@ -273,3 +274,3 @@ }

else if (isObject(matchValue)) {
assertMatchesObjectShape(testValue, matchValue, allowExtraProps);
assertMatchesObjectShape(testValue, matchValue, allowExtraProps, noCheckInnerValueOfTheseKeys);
}

@@ -276,0 +277,0 @@ }

@@ -48,2 +48,5 @@ import { AtLeastOneEntryArray } from './array';

};
type NestedBoolean<MatchObject extends object> = Partial<{
[Prop in keyof MatchObject]: MatchObject[Prop] extends object ? NestedBoolean<MatchObject[Prop]> | boolean : boolean;
}>;
/**

@@ -62,5 +65,5 @@ * Asserts that the first input, testThisOne, matches the object shape of the second input,

*/
export declare function assertMatchesObjectShape<MatchThisGeneric extends object = never>(testThisOne: unknown, compareToThisOne: NoInfer<ObjectWithAtLeastSingleEntryArrays<MatchThisGeneric>>, allowExtraProps?: boolean, noCheckInnerValueOfTheseKeys?: Partial<Record<keyof typeof compareToThisOne, boolean>>): asserts testThisOne is MatchThisGeneric;
export declare function assertMatchesObjectShape<MatchThisGeneric extends object = never>(testThisOne: unknown, compareToThisOne: NoInfer<ObjectWithAtLeastSingleEntryArrays<MatchThisGeneric>>, allowExtraProps?: boolean, noCheckInnerValueOfTheseKeys?: NestedBoolean<typeof compareToThisOne>): asserts testThisOne is MatchThisGeneric;
export declare function typedObjectFromEntries<KeyType extends PropertyKey, ValueType>(entries: ReadonlyArray<Readonly<[KeyType, ValueType]>>): Record<KeyType, ValueType>;
export {};
//# sourceMappingURL=object.d.ts.map

@@ -193,2 +193,3 @@ import { extractErrorMessage } from './error';

matchKeys.forEach((key) => {
var _a;
if (!typedHasProperty(testThisOne, key)) {

@@ -203,7 +204,7 @@ throw new Error(`test object does not have key "${String(key)}" from expected shape.`);

if (!noCheckInnerValueOfTheseKeys[key]) {
compareInnerValue(testValue, shouldMatch, throwKeyError, allowExtraProps);
compareInnerValue(testValue, shouldMatch, throwKeyError, allowExtraProps, (_a = noCheckInnerValueOfTheseKeys[key]) !== null && _a !== void 0 ? _a : {});
}
});
}
function compareInnerValue(testValue, matchValue, throwKeyError, allowExtraProps) {
function compareInnerValue(testValue, matchValue, throwKeyError, allowExtraProps, noCheckInnerValueOfTheseKeys) {
var _a;

@@ -237,3 +238,3 @@ const testType = typeof testValue;

try {
compareInnerValue(testValueEntry, matchValue, throwKeyError, allowExtraProps);
compareInnerValue(testValueEntry, matchValue, throwKeyError, allowExtraProps, noCheckInnerValueOfTheseKeys);
return undefined;

@@ -252,3 +253,3 @@ }

else if (isObject(matchValue)) {
assertMatchesObjectShape(testValue, matchValue, allowExtraProps);
assertMatchesObjectShape(testValue, matchValue, allowExtraProps, noCheckInnerValueOfTheseKeys);
}

@@ -255,0 +256,0 @@ }

@@ -48,2 +48,5 @@ import { AtLeastOneEntryArray } from './array';

};
type NestedBoolean<MatchObject extends object> = Partial<{
[Prop in keyof MatchObject]: MatchObject[Prop] extends object ? NestedBoolean<MatchObject[Prop]> | boolean : boolean;
}>;
/**

@@ -62,5 +65,5 @@ * Asserts that the first input, testThisOne, matches the object shape of the second input,

*/
export declare function assertMatchesObjectShape<MatchThisGeneric extends object = never>(testThisOne: unknown, compareToThisOne: NoInfer<ObjectWithAtLeastSingleEntryArrays<MatchThisGeneric>>, allowExtraProps?: boolean, noCheckInnerValueOfTheseKeys?: Partial<Record<keyof typeof compareToThisOne, boolean>>): asserts testThisOne is MatchThisGeneric;
export declare function assertMatchesObjectShape<MatchThisGeneric extends object = never>(testThisOne: unknown, compareToThisOne: NoInfer<ObjectWithAtLeastSingleEntryArrays<MatchThisGeneric>>, allowExtraProps?: boolean, noCheckInnerValueOfTheseKeys?: NestedBoolean<typeof compareToThisOne>): asserts testThisOne is MatchThisGeneric;
export declare function typedObjectFromEntries<KeyType extends PropertyKey, ValueType>(entries: ReadonlyArray<Readonly<[KeyType, ValueType]>>): Record<KeyType, ValueType>;
export {};
//# sourceMappingURL=object.d.ts.map
{
"name": "@augment-vir/common",
"version": "6.1.2",
"version": "6.1.3",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common",

@@ -5,0 +5,0 @@ "bugs": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc