From 854b0bd35ef75f85b5cb8eee108a3a53c01aa503 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Sun, 18 Mar 2018 00:13:44 +0100 Subject: [PATCH] homegrown isObj -> lodash/isObject --- format/products-filter.js | 3 ++- index.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/format/products-filter.js b/format/products-filter.js index 1305f501..8ee8ffca 100644 --- a/format/products-filter.js +++ b/format/products-filter.js @@ -1,6 +1,7 @@ 'use strict' -const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o) +const isObj = require('lodash/isObject') + const hasProp = (o, k) => Object.prototype.hasOwnProperty.call(o, k) const createFormatProductsFilter = (profile) => { diff --git a/index.js b/index.js index 395f4ab0..70f4ae2d 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,7 @@ const minBy = require('lodash/minBy') const maxBy = require('lodash/maxBy') +const isObj = require('lodash/isObject') const defaultProfile = require('./lib/default-profile') const createParseBitmask = require('./parse/products-bitmask') @@ -9,7 +10,6 @@ const createFormatProductsFilter = require('./format/products-filter') const validateProfile = require('./lib/validate-profile') const _request = require('./lib/request') -const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o) const isNonEmptyString = str => 'string' === typeof str && str.length > 0 const createClient = (profile, request = _request) => {