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

schemaglobin

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

schemaglobin - npm Package Compare versions

Comparing version 4.3.3 to 4.4.0

4

dist/helpers/object.d.ts

@@ -0,1 +1,2 @@

import type { UnknownObject } from "../types";
/** Is a value an unknown object? (is a TypeScript assertion object that asserts various things). */

@@ -36,1 +37,4 @@ export declare const isObject: <T extends Record<string, unknown>>(value: unknown) => value is T;

export declare const updateProp: <O extends Record<string, unknown>, K extends keyof O>(obj: O, key: K, value: O[K]) => O;
/** Extract a named (possibly deep) prop from an object. */
export declare function getProp<O extends UnknownObject, K extends keyof O | string | number>(obj: O, key: K): K extends keyof O ? O[K] : undefined;
export declare function getProp<O extends UnknownObject>(obj: O, key: string | number, ...deeperKeys: (string | number)[]): unknown;
"use strict";
/* eslint-disable no-param-reassign */
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateProp = exports.setProp = exports.deleteProp = exports.mapKeys = exports.mapObject = exports.SKIP = exports.objectFromEntries = exports.isObject = void 0;
exports.getProp = exports.updateProp = exports.setProp = exports.deleteProp = exports.mapKeys = exports.mapObject = exports.SKIP = exports.objectFromEntries = exports.isObject = void 0;
/** Is a value an unknown object? (is a TypeScript assertion object that asserts various things). */

@@ -82,1 +83,14 @@ exports.isObject = (value) => typeof value === "object" && value !== null;

};
function getProp(obj, key, ...deeperKeys) {
if (!(key in obj))
return undefined;
let current = obj[key];
if (deeperKeys.length)
for (const k of deeperKeys) {
if (!exports.isObject(current) || !(k in current))
return undefined;
current = current[k];
}
return current;
}
exports.getProp = getProp;

2

package.json
{
"name": "schemaglobin",
"description": "Validate user-entered data.",
"version": "4.3.3",
"version": "4.4.0",
"repository": "https://github.com/dhoulb/schemaglobin",

@@ -6,0 +6,0 @@ "author": "Dave Houlbrooke <dave@shax.com>",

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