You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@harlem/utilities

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0-beta.3 to 2.0.0-beta.4

6

dist/esm/index.js

@@ -92,3 +92,3 @@ // src/type/get-type.ts

// src/object/overwrite.ts
function overwrite(target, source) {
function overwrite(target, source, ignorePattern) {
if (typeof target !== "object" || typeof source !== "object") {

@@ -98,3 +98,5 @@ return target;

for (const prop in target) {
delete target[prop];
if (!ignorePattern || !ignorePattern.test(prop)) {
delete target[prop];
}
}

@@ -101,0 +103,0 @@ return Object.assign(target, source);

@@ -133,3 +133,3 @@ var HarlemUtilities = (() => {

// src/object/overwrite.ts
function overwrite(target, source) {
function overwrite(target, source, ignorePattern) {
if (typeof target !== "object" || typeof source !== "object") {

@@ -139,3 +139,5 @@ return target;

for (const prop in target) {
delete target[prop];
if (!ignorePattern || !ignorePattern.test(prop)) {
delete target[prop];
}
}

@@ -142,0 +144,0 @@ return Object.assign(target, source);

@@ -7,3 +7,3 @@ import { UnwrapRef } from 'vue';

declare function overwrite<TTarget extends object, TSource extends object>(target: TTarget, source: TSource): TTarget | TSource;
declare function overwrite<TTarget extends object, TSource extends object>(target: TTarget, source: TSource, ignorePattern?: RegExp): TTarget | TSource;

@@ -10,0 +10,0 @@ declare function fromPath<TValue extends object>(value: TValue, path: string | PropertyKey[]): object | undefined;

@@ -92,3 +92,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/type/get-type.ts

// src/object/overwrite.ts
function overwrite(target, source) {
function overwrite(target, source, ignorePattern) {
if (typeof target !== "object" || typeof source !== "object") {

@@ -98,3 +98,5 @@ return target;

for (const prop in target) {
delete target[prop];
if (!ignorePattern || !ignorePattern.test(prop)) {
delete target[prop];
}
}

@@ -101,0 +103,0 @@ return Object.assign(target, source);

{
"name": "@harlem/utilities",
"amdName": "harlemUtilities",
"version": "2.0.0-beta.3",
"version": "2.0.0-beta.4",
"license": "MIT",

@@ -46,3 +46,3 @@ "author": "Andrew Courtice <andrewcourtice@users.noreply.github.com>",

},
"gitHead": "fa89b7803d19dfa38e6c7ed5afea25f6e986e95c"
"gitHead": "633076bcdbc00fbd84e4612d3c24ab70023c2a50"
}

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

export default function overwrite<TTarget extends object, TSource extends object>(target: TTarget, source: TSource): TTarget | TSource {
export default function overwrite<TTarget extends object, TSource extends object>(target: TTarget, source: TSource, ignorePattern?: RegExp): TTarget | TSource {
if (typeof target !== 'object' || typeof source !== 'object') {

@@ -7,3 +7,5 @@ return target;

for (const prop in target) {
delete target[prop];
if (!ignorePattern || !ignorePattern.test(prop)) {
delete target[prop];
}
}

@@ -10,0 +12,0 @@

@@ -31,4 +31,26 @@ import overwrite from '../src/object/overwrite';

test('Should handle a top-level ignore pattern', () => {
const source = {
a: 1,
b: null,
c: 'Hello',
d: 26,
e: [1, 2, 3],
};
overwrite(source, {
a: 'hello',
b: 5,
c: [1, 2],
}, /^d/);
expect(typeof source.a).toBe('string');
expect(typeof source.b).toBe('number');
expect(Array.isArray(source.c)).toBe(true);
expect(source.d).toBe(26);
expect(source.e).toBeUndefined();
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc