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

@harlem/utilities - npm Package Compare versions

Comparing version 1.1.1 to 1.1.3

4

package.json
{
"name": "@harlem/utilities",
"version": "1.1.1",
"version": "1.1.3",
"license": "MIT",

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

},
"gitHead": "9d86a91860120c1815b0c0244d82b7d76e4ddd16"
"gitHead": "4345a656ed321f5210032f07627c9e146118bbd2"
}

@@ -39,22 +39,26 @@ import clone from '../src/clone';

describe('Clone', () => {
test('Should deep clone an object with simple types', () => {
const source = getSimpleTypes();
const copy = clone(source);
for (const key in source) {
expect(copy[key]).toBe(source[key]);
}
});
describe('Utilities', () => {
test('Should deep clone an object with complex types', () => {
const source = getComplexTypes();
const copy = clone(source);
describe('Clone', () => {
for (const key in source) {
expect(copy[key]).not.toBe(source[key]);
}
test('Should deep clone an object with simple types', () => {
const source = getSimpleTypes();
const copy = clone(source);
for (const key in source) {
expect(copy[key]).toBe(source[key]);
}
});
test('Should deep clone an object with complex types', () => {
const source = getComplexTypes();
const copy = clone(source);
for (const key in source) {
expect(copy[key]).not.toBe(source[key]);
}
});
});
});
});
import overwrite from '../src/overwrite';
describe('Overwrite', () => {
describe('Utilities', () => {
test('Should overwrite an objects properties with anothers', () => {
const source = {
a: 1,
b: null,
c: 'Hello',
d: {
a: new Date()
},
e: [1, 2, 3]
};
overwrite(source, {
a: 'hello',
b: 5,
d: [1, 2]
describe('Overwrite', () => {
test('Should overwrite an objects properties with anothers', () => {
const source = {
a: 1,
b: null,
c: 'Hello',
d: {
a: new Date()
},
e: [1, 2, 3]
};
overwrite(source, {
a: 'hello',
b: 5,
d: [1, 2]
});
expect(typeof source.a).toBe('string');
expect(typeof source.b).toBe('number');
expect(source.c).toBeUndefined();
expect(Array.isArray(source.d)).toBe(true);
expect(source.e).toBeUndefined();
});
expect(typeof source.a).toBe('string');
expect(typeof source.b).toBe('number');
expect(source.c).toBeUndefined();
expect(Array.isArray(source.d)).toBe(true);
expect(source.e).toBeUndefined();
});
});
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