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

eventify

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eventify - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

21

lib/eventify.js

@@ -36,3 +36,16 @@ // Eventify

return {
keys: Object.keys,
// Retrieve the names of an object's properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
keys: Object.keys || function (obj) {
if (typeof obj !== "object" && typeof obj !== "function" || obj === null) {
throw new TypeError("keys() called on a non-object");
}
var key, keys = [];
for (key in obj) {
if (obj.hasOwnProperty(key)) {
keys[keys.length] = key;
}
}
return keys;
},

@@ -45,6 +58,2 @@ uniqueId: function (prefix) {

has: function (obj, key) {
return hasOwnProperty.call(obj, key);
},
each: function (obj, iterator, context) {

@@ -65,3 +74,3 @@ var key, i, l;

for (key in obj) {
if (this.has(obj, key)) {
if (obj.hasOwnProperty(key)) {
if (iterator.call(context, obj[key], key, obj) === breaker) {

@@ -68,0 +77,0 @@ return;

{
"name": "eventify",
"version": "1.0.0",
"version": "1.0.1",
"description": "Lightweight module that can be mixed in to any object in order to provide it with custom events. For node.js and the browser. Based on Backbone.Events",

@@ -39,3 +39,3 @@ "author": "Bermi Ferrer <bermi@bermilabs.com>",

"devDependencies": {
"expect.js": "~0.3.1",
"blanket": "1.1.6",
"grunt": "~0.4.x",

@@ -47,3 +47,5 @@ "grunt-cli": "^0.1.13",

"grunt-contrib-watch": "^0.6.1",
"mocha": "~1.20.1"
"mocha": "~1.9.0",
"expect.js": "~0.2.0",
"mocha-spec-cov": "0.0.3"
},

@@ -67,2 +69,8 @@ "scripts": {

},
"config": {
"blanket": {
"data-cover-only": "[./,./lib]",
"data-cover-never": "[./node_modules]"
}
},
"ender": "./lib/ender.js",

@@ -69,0 +77,0 @@ "main": "./lib/eventify.js",

@@ -476,7 +476,10 @@ (function (root) {

it("if callback is truthy but not a function, `on` should throw an error" +
" just like jQuery", function () {
" just like jQuery", function (done) {
var view = Eventify.enable({}).on('test', 'noop');
expect(function () {
try {
view.trigger('test');
}).to.throwException(Error);
} catch (e) {
expect(e).to.be.an(Error);
done();
}
});

@@ -483,0 +486,0 @@

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc