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

@travetto/base

Package Overview
Dependencies
Maintainers
1
Versions
357
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/base - npm Package Compare versions

Comparing version 0.0.54 to 0.0.55

2

package.json

@@ -21,3 +21,3 @@ {

"scripts": {},
"version": "0.0.54"
"version": "0.0.55"
}

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

export function isPrimitive(el: any) {
export function isPrimitive(el: any): el is (string | boolean | number | RegExp) {
const type = typeof el;

@@ -6,3 +6,3 @@ return (type === 'string' || type === 'boolean' || type === 'number' || el instanceof RegExp);

export function isPlainObject(obj: any) {
export function isPlainObject(obj: any): obj is object {
return typeof obj === 'object' // separate from primitives

@@ -14,2 +14,6 @@ && obj !== null // is obvious

export function isFunction(o: any): o is Function {
return Object.getPrototypeOf(o) === Function.prototype;
}
export function deepMerge<T extends any, U extends any>(a: T, b: U): T & U {

@@ -24,3 +28,3 @@ const isEmptyA = a === undefined || a === null;

if (isEmptyA || isPrimitive(a)) {
return b as (T & U);
return b as any as (T & U);
} else {

@@ -27,0 +31,0 @@ throw new Error(`Cannot merge primitive ${b} with ${a}`);

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