@voiceflow/common
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -50,6 +50,2 @@ 'use strict'; | ||
static check(object, path, type) { | ||
if (typeof path !== 'string') { | ||
throw new Error('type check path is not defined'); | ||
} | ||
if (object === undefined) { | ||
@@ -62,4 +58,6 @@ throw new Error('type check object is not defined'); | ||
if (!_[(`is${type}`)](_.get(object, path))) { | ||
throw new Error(`${path} must be a ${type.toLowerCase()}`); | ||
if (path) object = _.get(object, path); | ||
if (!_[(`is${type}`)](object)) { | ||
throw new Error(`${path || 'check object'} must be a ${type.toLowerCase()}`); | ||
} | ||
@@ -66,0 +64,0 @@ } |
{ | ||
"name": "@voiceflow/common", | ||
"description": "Junk drawer of utility functions", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"author": "Voiceflow", | ||
@@ -6,0 +6,0 @@ "bugs": { |
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
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
10810
267