@metamask/utils
Advanced tools
Comparing version 3.4.1 to 3.5.0
@@ -25,6 +25,5 @@ /** | ||
/** | ||
* A JavaScript object that is not `null`, a function, or an array. The object | ||
* can still be an instance of a class. | ||
* A JavaScript object that is not `null`, a function, or an array. | ||
*/ | ||
export declare type RuntimeObject = Record<number | string | symbol, unknown>; | ||
export declare type RuntimeObject = Record<PropertyKey, unknown>; | ||
/** | ||
@@ -54,5 +53,5 @@ * A {@link NonEmptyArray} type guard. | ||
/** | ||
* An alias for {@link Object.hasOwnProperty}. | ||
* A type guard for ensuring an object has a property. | ||
* | ||
* @param object - The object to check. | ||
* @param objectToCheck - The object to check. | ||
* @param name - The property name to check for. | ||
@@ -62,3 +61,3 @@ * @returns Whether the specified object has an own property with the specified | ||
*/ | ||
export declare const hasProperty: (object: RuntimeObject, name: string | number | symbol) => boolean; | ||
export declare const hasProperty: <ObjectToCheck extends Object, Property extends PropertyKey>(objectToCheck: ObjectToCheck, name: Property) => objectToCheck is ObjectToCheck & Record<Property, unknown>; | ||
export declare type PlainObject = Record<number | string | symbol, unknown>; | ||
@@ -65,0 +64,0 @@ /** |
@@ -46,5 +46,5 @@ "use strict"; | ||
/** | ||
* An alias for {@link Object.hasOwnProperty}. | ||
* A type guard for ensuring an object has a property. | ||
* | ||
* @param object - The object to check. | ||
* @param objectToCheck - The object to check. | ||
* @param name - The property name to check for. | ||
@@ -54,3 +54,3 @@ * @returns Whether the specified object has an own property with the specified | ||
*/ | ||
const hasProperty = (object, name) => Object.hasOwnProperty.call(object, name); | ||
const hasProperty = (objectToCheck, name) => Object.hasOwnProperty.call(objectToCheck, name); | ||
exports.hasProperty = hasProperty; | ||
@@ -57,0 +57,0 @@ /** |
{ | ||
"name": "@metamask/utils", | ||
"version": "3.4.1", | ||
"version": "3.5.0", | ||
"description": "Various JavaScript/TypeScript utilities of wide relevance to the MetaMask codebase.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
219647
48
2912