Socket
Socket
Sign inDemoInstall

filter-obj

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.1.0 to 6.0.0

4

index.d.ts

@@ -75,2 +75,4 @@ /**

keys: readonly ExcludedKeys[]
): Omit<ObjectType, ExcludedKeys>;
): DistributiveOmit<ObjectType, ExcludedKeys>;
type DistributiveOmit<Value, Key extends PropertyKey> = Value extends unknown ? Omit<Value, Key> : never;

@@ -7,5 +7,8 @@ export function includeKeys(object, predicate) {

const descriptor = Object.getOwnPropertyDescriptor(object, key);
if (descriptor?.enumerable) {
Object.defineProperty(result, key, descriptor);
if (!descriptor?.enumerable) {
continue;
}
Object.defineProperty(result, key, descriptor);
}

@@ -16,8 +19,11 @@ } else {

const descriptor = Object.getOwnPropertyDescriptor(object, key);
if (descriptor.enumerable) {
const value = object[key];
if (predicate(key, value, object)) {
Object.defineProperty(result, key, descriptor);
}
if (!descriptor?.enumerable) {
continue;
}
const value = object[key];
if (predicate(key, value, object)) {
Object.defineProperty(result, key, descriptor);
}
}

@@ -24,0 +30,0 @@ }

{
"name": "filter-obj",
"version": "5.1.0",
"version": "6.0.0",
"description": "Filter object keys and values into a new object",

@@ -14,6 +14,9 @@ "license": "MIT",

"type": "module",
"exports": "./index.js",
"types": "./index.d.ts",
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"sideEffects": false,
"engines": {
"node": ">=14.16"
"node": ">=18"
},

@@ -42,6 +45,6 @@ "scripts": {

"devDependencies": {
"ava": "^4.3.1",
"tsd": "^0.22.0",
"xo": "^0.51.0"
"ava": "^6.1.2",
"tsd": "^0.30.7",
"xo": "^0.58.0"
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc