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

@jalik/observer

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jalik/observer - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

webpack.config.js

3

CHANGELOG.md
# Changelog
## v1.0.4
- Updates dependencies
## v1.0.3

@@ -4,0 +7,0 @@ - Updates dependencies

55

dist/index.js

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

'use strict';
"use strict";

@@ -6,31 +6,32 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = void 0;
var _observer = require('./observer');
var _observer = _interopRequireDefault(require("./observer"));
var _observer2 = _interopRequireDefault(_observer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _observer2.default; /*
* The MIT License (MIT)
*
* Copyright (c) 2018 Karl STEIN
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/*
* The MIT License (MIT)
*
* Copyright (c) 2018 Karl STEIN
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
var _default = _observer.default;
exports.default = _default;

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

'use strict';
"use strict";

@@ -6,7 +6,10 @@ Object.defineProperty(exports, "__esModule", {

});
exports.default = void 0;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
/*

@@ -35,4 +38,5 @@ * The MIT License (MIT)

*/
var Observer = function () {
var Observer =
/*#__PURE__*/
function () {
function Observer(context) {

@@ -44,3 +48,2 @@ _classCallCheck(this, Observer);

}
/**

@@ -54,3 +57,3 @@ * Adds an event listener

_createClass(Observer, [{
key: 'attach',
key: "attach",
value: function attach(event, listener) {

@@ -60,15 +63,17 @@ // Check the event

throw new TypeError('Event is not a string');
}
// Check the callback
} // Check the callback
if (typeof listener !== 'function') {
throw new TypeError('Callback is not a function');
}
// Create the array
} // Create the array
if (!this.events[event]) {
this.events[event] = [];
}
// Add the event callback
} // Add the event callback
this.events[event].push(listener);
}
/**

@@ -81,3 +86,3 @@ * Removes an event listener

}, {
key: 'detach',
key: "detach",
value: function detach(event, listener) {

@@ -93,3 +98,2 @@ if (this.events[event]) {

}
/**

@@ -100,5 +104,5 @@ * Executes all callbacks attached to an event

}, {
key: 'notify',
key: "notify",
value: function notify() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];

@@ -112,5 +116,4 @@ }

var event = args.shift();
var event = args.shift(); // Check the event
// Check the event
if (typeof event !== 'string') {

@@ -126,3 +129,2 @@ throw new TypeError('Event is not a string');

}
/**

@@ -134,3 +136,3 @@ * Defines the context that is passed to event callbacks

}, {
key: 'setContext',
key: "setContext",
value: function setContext(context) {

@@ -144,2 +146,3 @@ this.context = context;

exports.default = Observer;
var _default = Observer;
exports.default = _default;
{
"name": "@jalik/observer",
"version": "1.0.3",
"version": "1.0.4",
"description": "A library to observe events and trigger callbacks.",

@@ -18,39 +18,37 @@ "license": "MIT",

"type": "git",
"url": "https://github.com/jalik/jk-observer.git"
"url": "https://github.com/jalik/js-observer.git"
},
"bugs": {
"url": "https://github.com/jalik/jk-observer/issues"
"url": "https://github.com/jalik/js-observer/issues"
},
"main": "dist/index.js",
"scripts": {
"build": "./node_modules/.bin/gulp build",
"bundle": "./node_modules/.bin/webpack -p",
"lint": "./node_modules/.bin/eslint .",
"lint-fix": "./node_modules/.bin/eslint --fix .",
"prepare": "./node_modules/.bin/gulp prepare",
"build": "npx gulp build",
"lint": "npx eslint .",
"lint-fix": "npx eslint --fix .",
"prepare": "npx gulp prepare",
"prepublishOnly": "npm test",
"test": "./node_modules/.bin/jest",
"watch": "./node_modules/.bin/gulp watch"
"test": "npx jest",
"watch": "npx gulp watch"
},
"dependencies": {},
"devDependencies": {
"babel-core": "^6.26.3",
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"ajv": "^6.5.4",
"babel-core": "^7.0.0-bridge.0",
"babel-loader": "^7.1.4",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"del": "^3.0.0",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jest": "^21.17.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.9.1",
"eslint": "^5.6.1",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.24.1",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1",
"gulp": "^4.0.0",
"gulp-babel": "^7.0.1",
"gulp-eslint": "^4.0.2",
"gulp-strip-comments": "^2.5.2",
"gulp-watch": "^5.0.0",
"jest": "^23.1.0",
"webpack": "^4.12.0",
"webpack-cli": "^3.0.3"
"gulp-babel": "^8.0.0",
"gulp-eslint": "^5.0.0",
"jest": "^23.6.0"
}
}
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