Comparing version 0.1.2 to 0.1.3
@@ -1,1 +0,1 @@ | ||
function EventLite(){return this instanceof EventLite?void 0:new EventLite}!function(e){function n(e){for(var n in o)e[n]=o[n];return e}function t(e,n){return f(this,e).push(n),this}function i(e,n){function t(){r.call(i,e,t),n.apply(this,arguments)}var i=this;return t.originalListener=n,f(i,e).push(t),i}function r(e,n){function t(e){return e!==n&&e.originalListener!==n}var i,u=this;if(arguments.length){if(n){if(i=f(u,e,!0)){if(i=i.filter(t),!i.length)return r.call(u,e);u[l][e]=i}}else if(i=u[l],i&&(delete i[e],!Object.keys(i).length))return r.call(u)}else delete u[l];return u}function u(e,n){function t(e){e.call(u)}function i(e){e.call(u,n)}function r(e){e.apply(u,a)}var u=this,l=f(u,e,!0);if(!l)return!1;var o=arguments.length;if(1===o)l.forEach(t);else if(2===o)l.forEach(i);else{var a=Array.prototype.slice.call(arguments,1);l.forEach(r)}return!!l.length}function f(e,n,t){if(!t||e[l]){var i=e[l]||(e[l]={});return i[n]||(i[n]=[])}}"undefined"!=typeof module&&(module.exports=e);var l="listeners",o={on:t,once:i,off:r,emit:u};n(e.prototype),e.mixin=n}(EventLite); | ||
function EventLite(){if(!(this instanceof EventLite))return new EventLite}!function(e){"undefined"!=typeof module&&(module.exports=e);var n="listeners",t={on:function(e,n){return f(this,e).push(n),this},once:function(e,n){var t=this;return i.originalListener=n,f(t,e).push(i),t;function i(){r.call(t,e,i),n.apply(this,arguments)}},off:r,emit:function(e,n){var t=this,i=f(t,e,!0);if(!i)return!1;var r=arguments.length;if(1===r)i.forEach((function(e){e.call(t)}));else if(2===r)i.forEach((function(e){e.call(t,n)}));else{var l=Array.prototype.slice.call(arguments,1);i.forEach((function(e){e.apply(t,l)}))}return!!i.length}};function i(e){for(var n in t)e[n]=t[n];return e}function r(e,t){var i,l=this;if(arguments.length){if(t){if(i=f(l,e,!0)){if(!(i=i.filter((function(e){return e!==t&&e.originalListener!==t}))).length)return r.call(l,e);l[n][e]=i}}else if((i=l[n])&&(delete i[e],!Object.keys(i).length))return r.call(l)}else delete l[n];return l}function f(e,t,i){if(!i||e[n]){var r=e[n]||(e[n]={});return r[t]||(r[t]=[])}}i(e.prototype),e.mixin=i}(EventLite); |
{ | ||
"name": "event-lite", | ||
"description": "Light-weight EventEmitter (less than 1KB when gzipped)", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"author": "@kawanet", | ||
@@ -13,12 +13,29 @@ "bugs": { | ||
"devDependencies": { | ||
"browserify": "^17.0.0", | ||
"browserify-sed": "^0.8.0", | ||
"jsdoc": "^3.5.5", | ||
"jshint": "^2.9.6", | ||
"mocha": "^5.2.0", | ||
"uglify-js": "^3.4.9" | ||
"jshint": "^2.13.6", | ||
"mocha": "^10.2.0", | ||
"terser": "^5.16.3" | ||
}, | ||
"files": [ | ||
"browser/import.js", | ||
"dist/event-lite.min.js", | ||
"event-lite.d.ts", | ||
"event-lite.js" | ||
], | ||
"homepage": "https://github.com/kawanet/event-lite", | ||
"jshintConfig": { | ||
"bitwise": true, | ||
"browser": true, | ||
"eqeqeq": true, | ||
"mocha": true, | ||
"noarg": true, | ||
"nocomma": true, | ||
"node": true, | ||
"undef": true | ||
"nonbsp": true, | ||
"nonew": true, | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true | ||
}, | ||
@@ -40,3 +57,5 @@ "keywords": [ | ||
"scripts": { | ||
"build": "make clean all", | ||
"fixpack": "fixpack", | ||
"prepack": "npm run build && npm test", | ||
"test": "make test" | ||
@@ -43,0 +62,0 @@ }, |
@@ -1,2 +0,5 @@ | ||
# event-lite.js [![npm version](https://badge.fury.io/js/event-lite.svg)](http://badge.fury.io/js/event-lite) [![Build Status](https://travis-ci.org/kawanet/event-lite.svg?branch=master)](https://travis-ci.org/kawanet/event-lite) | ||
# event-lite.js | ||
[![Node.js CI](https://github.com/kawanet/event-lite/workflows/Node.js%20CI/badge.svg?branch=master)](https://github.com/kawanet/event-lite/actions/) | ||
[![npm version](https://badge.fury.io/js/event-lite.svg)](https://www.npmjs.com/package/event-lite) | ||
[![gzip size](https://img.badgesize.io/https://unpkg.com/event-lite/dist/event-lite.min.js?compression=gzip)](https://unpkg.com/event-lite/dist/event-lite.min.js) | ||
@@ -8,3 +11,3 @@ Light-weight EventEmitter (less than 1KB when gzipped) | ||
```js | ||
var EventLite = require("event-lite"); | ||
const EventLite = require("event-lite"); | ||
@@ -15,3 +18,3 @@ function MyClass() {...} // your class | ||
var obj = new MyClass(); | ||
const obj = new MyClass(); | ||
obj.on("foo", function(v) {...}); // add event listener | ||
@@ -33,3 +36,3 @@ obj.once("bar", function(v) {...}); // add one-time event listener | ||
```html | ||
<script src="https://raw.githubusercontent.com/kawanet/event-lite/master/dist/event-lite.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/event-lite/dist/event-lite.min.js"></script> | ||
``` | ||
@@ -42,3 +45,3 @@ | ||
class MyClass() extends EventLite { | ||
class MyClass extends EventLite { | ||
// your class | ||
@@ -71,3 +74,3 @@ } | ||
Copyright (c) 2015-2018 Yusuke Kawasaki | ||
Copyright (c) 2015-2023 Yusuke Kawasaki | ||
@@ -74,0 +77,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89
11040
6
7
167
1