🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@silverhand/essentials

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@silverhand/essentials - npm Package Compare versions

Comparing version

to
2.8.8

18

lib/utilities/object.d.ts
export declare const isObject: (object: unknown) => object is object;
export declare const isKeyInObject: <Key extends string>(object: unknown, key: Key) => object is object & Record<Key, unknown>;
/**
* A utility type that removes all keys with `undefined` values from an object.
*
* Note: Optional keys with `undefined` values are not removed.
*
* @example
* ```ts
* type Foo = { a: string; b: number | undefined; c?: boolean };
* type Bar = RemoveUndefinedKeys<Foo>;
* // Bar is { a: string; b: number; c?: boolean }
* ```
*/
type RemoveUndefinedKeys<T> = {
[Key in keyof T as T[Key] extends undefined ? never : Key]: Exclude<T[Key], undefined>;
};
/**
* Remove all keys with `undefined` values from an object. This function only

@@ -11,2 +26,3 @@ * performs a shallow removal, i.e. it does not remove `undefined` values nested

*/
export declare const removeUndefinedKeys: <T extends Record<string, unknown>>(object: T) => T;
export declare const removeUndefinedKeys: <T extends object>(object: T) => RemoveUndefinedKeys<T>;
export {};

@@ -14,2 +14,3 @@ // eslint-disable-next-line @typescript-eslint/ban-types

*/
// eslint-disable-next-line @typescript-eslint/ban-types -- this is a utility function
const removeUndefinedKeys = (object) =>

@@ -16,0 +17,0 @@ // eslint-disable-next-line no-restricted-syntax

2

package.json
{
"name": "@silverhand/essentials",
"version": "2.8.7",
"version": "2.8.8",
"description": "The missing essentials for TypeScript (and JavaScript).",

@@ -5,0 +5,0 @@ "repository": "git@github.com:silverhand-io/essentials.git",

Sorry, the diff of this file is not supported yet