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

core-functions

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-functions - npm Package Compare versions

Comparing version 2.0.14 to 2.0.15

0

app-errors.js

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

12

objects.js

@@ -124,3 +124,13 @@ 'use strict';

function newDest(object) {
return Array.isArray(object) ? new Array(object.length) : Object.create(object.__proto__);
if (Array.isArray(object)) {
return new Array(object.length);
}
const prototype = Object.getPrototypeOf(object); //
if (prototype === undefined) {
console.trace(`#################### WARNING - Object.getPrototypeOf(object) has an undefined prototype - stringified: (${Strings.stringify(object)}) inspected: (${require('util').inspect(object)}) - using Object.create(null) instead!`);
}
if (object.__proto__ === undefined) {
console.trace(`#################### WARNING - object.__proto__ has an undefined prototype - stringified: (${Strings.stringify(object)}) inspected: (${require('util').inspect(object)}) - using Object.create(null) instead!`);
}
return Object.create(prototype || null);
}

@@ -127,0 +137,0 @@

2

package.json
{
"name": "core-functions",
"version": "2.0.14",
"version": "2.0.15",
"description": "Core functions, utilities and classes for working with Node/JavaScript primitives and built-in objects, including strings, booleans, Promises, base 64, Arrays, Objects, standard AppErrors, etc.",

@@ -5,0 +5,0 @@ "author": "Byron du Preez",

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

# core-functions v2.0.14
# core-functions v2.0.15

@@ -106,2 +106,6 @@ Core functions, utilities and classes for working with Node/JavaScript primitives and built-in objects, including

### 2.0.15
- Backport of `objects` module `copy` function fix for TypeError thrown when `Object.create(o.__proto__)` was invoked & `o.__proto__` was undefined
- Backport of fix for `strings.test.js` equality failure that surfaces when run under Node 6.10.x
### 2.0.14

@@ -108,0 +112,0 @@ - Added `copyNamedProperties` function to `objects.js` module

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

{
"prefixFnArgs": true
}

@@ -0,0 +0,0 @@ 'use strict';

@@ -852,2 +852,17 @@ 'use strict';

t.end();
});
test('copy with undefined prototype', t => {
let o = Object.create(null);
t.equal(o.__proto__, undefined, `o.__proto__ must be undefined`);
t.throws(() => Object.create(o.__proto__), TypeError, `Object.create(o.__proto__) must throw TypeError`);
t.equal(Object.getPrototypeOf(o), null, `Object.getPrototypeOf(o) must be null`);
t.doesNotThrow(() => Object.create(Object.getPrototypeOf(o)), `Object.create(Object.getPrototypeOf(o)) must NOT throw an error`);
t.doesNotThrow(() => Objects.copy(o), `copy(o)) must NOT throw an error`);
t.end();
});
{
"name": "core-functions-tests",
"version": "2.0.14",
"version": "2.0.15",
"author": "Byron du Preez",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -0,0 +0,0 @@ 'use strict';

@@ -463,3 +463,9 @@ 'use strict';

// explicit avoidToJSONMethods must NOT use toJSON method
checkWithArgs(task, false, true, false, wrapInString ? '[object Object]' : '{"name":"Task1","definition":{"name":"Task1","executable":true,"execute":[Function: anonymous],"subTaskDefs":[],"parent":undefined},"executable":true,"execute":[Function: anonymous],"_subTasks":[],"_subTasksByName":{},"parent":undefined,"_state":{"code":"Unstarted","completed":false,"error":undefined,"rejected":false,"reason":undefined},"_attempts":1,"_lastExecutedAt":"2016-12-01T05:09:09.119Z","_result":undefined,"_error":undefined,"_slaveTasks":[],"_frozen":true,"toJSON":[Function: toJSON]}');
if (process && process.version) {
if (process.version.startsWith("4.3.")) {
checkWithArgs(task, false, true, false, wrapInString ? '[object Object]' : '{"name":"Task1","definition":{"name":"Task1","executable":true,"execute":[Function: anonymous],"subTaskDefs":[],"parent":undefined},"executable":true,"execute":[Function: anonymous],"_subTasks":[],"_subTasksByName":{},"parent":undefined,"_state":{"code":"Unstarted","completed":false,"error":undefined,"rejected":false,"reason":undefined},"_attempts":1,"_began":"2016-12-01T05:09:09.119Z","_result":undefined,"_error":undefined,"_slaveTasks":[],"_frozen":true,"toJSON":[Function: toJSON]}');
} else if (process.version.startsWith("6.10.")) {
checkWithArgs(task, false, true, false, wrapInString ? '[object Object]' : '{"name":"Task1","definition":{"name":"Task1","executable":true,"execute":[Function: execute],"subTaskDefs":[],"parent":undefined},"executable":true,"execute":[Function: execute],"_subTasks":[],"_subTasksByName":{},"parent":undefined,"_state":{"code":"Unstarted","completed":false,"error":undefined,"rejected":false,"reason":undefined},"_attempts":1,"_began":"2016-12-01T05:09:09.119Z","_result":undefined,"_error":undefined,"_slaveTasks":[],"_frozen":true,"toJSON":[Function: toJSON]}');
}
}
}

@@ -466,0 +472,0 @@

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

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