Socket
Socket
Sign inDemoInstall

prototypes

Package Overview
Dependencies
1
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.4 to 0.1.5

30

lib/core.js

@@ -21,2 +21,3 @@ 'use strict';

value: extension[key],
writable: true,
});

@@ -29,3 +30,3 @@ }

*/
function testProperties(callback)
function testEnumerateProperties(callback)
{

@@ -45,2 +46,26 @@ var first = {};

/**
* Test that the new properties can be overwritten.
*/
function testOverwriteProperties(callback)
{
var newObject = {
one: function()
{
return 0;
},
};
var object = {
a: 'a',
};
exports.addProperties(Object.prototype, newObject);
testing.assertEquals(object.one(), 0, 'Property not set', callback);
object.one = function()
{
return 1;
};
testing.assertEquals(object.one(), 1, 'Property not overwritten', callback);
testing.success(callback);
}
/**
* Run package tests.

@@ -51,3 +76,4 @@ */

var tests = {
testProperties: testProperties,
enumerateProperties: testEnumerateProperties,
overwrite: testOverwriteProperties,
};

@@ -54,0 +80,0 @@ testing.run(tests, callback);

2

package.json
{
"name": "prototypes",
"version": "0.1.4",
"version": "0.1.5",
"description": "Some common prototypes for node.js: string.startsWith(), object.countProperties() and more. Functions are added using Object.defineProperty() to avoid polluting new objects.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/alexfernandez/prototypes",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc