From c05089a4f8ebf722b0d038d2ce34e5c72f5f5973 Mon Sep 17 00:00:00 2001 From: Jeroen van der Heijden Date: Mon, 6 Apr 2020 08:33:08 +0200 Subject: [PATCH] Fix lint --- lib/actions.js | 2 +- lib/store.js | 2 +- package-lock.json | 2 +- package.json | 2 +- src/actions.js | 2 +- src/store.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/actions.js b/lib/actions.js index 6b5587a..72fd879 100644 --- a/lib/actions.js +++ b/lib/actions.js @@ -25,7 +25,7 @@ var Actions = /*#__PURE__*/function () { (0, _classCallCheck2["default"])(this, Actions); this._callbacks = names.reduce(function (o, action) { typeof action !== 'string' || !action.length || action.charAt(0) === '_' ? process.env.NODE_ENV !== 'production' ? (0, _invariant["default"])(false, 'Cannot use action `%s`. Each action must be a sting with at least one character and cannot start with an underscore.', action) : (0, _invariant["default"])(false) : undefined; - _this.hasOwnProperty(action) ? process.env.NODE_ENV !== 'production' ? (0, _invariant["default"])(false, 'Action `%s` is already set (duplicate actions are not allowed).', action) : (0, _invariant["default"])(false) : undefined; + Object.prototype.hasOwnProperty.call(_this, action) ? process.env.NODE_ENV !== 'production' ? (0, _invariant["default"])(false, 'Action `%s` is already set (duplicate actions are not allowed).', action) : (0, _invariant["default"])(false) : undefined; var onKey = "on".concat(action.charAt(0).toUpperCase()).concat(action.substr(1)); _this[action] = function () { diff --git a/lib/store.js b/lib/store.js index 2d7c5af..d55fa56 100644 --- a/lib/store.js +++ b/lib/store.js @@ -73,7 +73,7 @@ var Store = /*#__PURE__*/function () { key: "_vlowFilterState", value: function _vlowFilterState(state, keys) { return keys.reduce(function (o, k) { - if (state.hasOwnProperty(k)) { + if (Object.prototype.hasOwnProperty.call(state, k)) { o[k] = state[k]; } diff --git a/package-lock.json b/package-lock.json index 443cc96..daa73b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vlow", - "version": "1.1.8", + "version": "1.1.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 69964b7..b71f116 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vlow", - "version": "1.1.8", + "version": "1.1.9", "description": "A simple library for unidirectional dataflow architecture inspired by Reflux", "main": "lib/index.js", "scripts": { diff --git a/src/actions.js b/src/actions.js index 46d9fb0..82790fa 100644 --- a/src/actions.js +++ b/src/actions.js @@ -6,7 +6,7 @@ class Actions { constructor(names) { this._callbacks = names.reduce((o, action) => { typeof action !== 'string' || !action.length || action.charAt(0) === '_' ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot use action `%s`. Each action must be a sting with at least one character and cannot start with an underscore.', action) : invariant(false) : undefined; - this.hasOwnProperty(action) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Action `%s` is already set (duplicate actions are not allowed).', action) : invariant(false) : undefined; + Object.prototype.hasOwnProperty.call(this, action) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Action `%s` is already set (duplicate actions are not allowed).', action) : invariant(false) : undefined; const onKey = `on${action.charAt(0).toUpperCase()}${action.substr(1)}`; this[action] = (...args) => this._on(onKey, args); o[onKey] = []; diff --git a/src/store.js b/src/store.js index 113b921..5ec0b0b 100644 --- a/src/store.js +++ b/src/store.js @@ -40,7 +40,7 @@ class Store { _vlowFilterState(state, keys) { return keys.reduce((o, k)=> { - if (state.hasOwnProperty(k)) { + if (Object.prototype.hasOwnProperty.call(state, k)) { o[k] = state[k]; } return o;