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

goodies

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

goodies - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

23

index.js

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

Array.prototype.unique = function() {
var extend = function(object, methodName, method) {
Object.defineProperty(object.prototype, methodName, {
enumerable: false,
value: method
});
};
extend(Array, "unique", function() {
for (var i = 1; i < this.length; ++i) {

@@ -9,5 +16,5 @@ if (this[i] == this[i - 1]) {

return this;
};
});
Object.prototype.merge = function(object) {
extend(Object, "merge", function(object) {
var objectA = object

@@ -35,10 +42,10 @@ , objectB = this

return merged;
};
});
Date.prototype.unixTime = function() {
extend(Date, "unixTime", function() {
return Math.floor(this.getTime()/1000);
};
});
Date.prototype.fromUnixTime = function(time) {
extend(Date, "fromUnixTime", function(time) {
this.setTime(time*1000);
};
});

@@ -5,3 +5,3 @@ {

"author": "Adam Blackburn <adam@ifit.com>",
"version": "0.0.1",
"version": "0.0.2",
"main": "index.js",

@@ -8,0 +8,0 @@ "keywords": ["goodies", "merge", "unique", "unixtime"],

@@ -28,1 +28,7 @@ # Goodies

Sets the date based on the unix time passed in.
### To use
Install with `npm install goodies`
To use goodies, just add `require('goodies')` to any js file you run in node.
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