Socket
Socket
Sign inDemoInstall

@voiceflow/common

Package Overview
Dependencies
Maintainers
8
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@voiceflow/common - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

25

lib/utils.js
'use strict';
/* eslint-disable no-process-env */
const _ = require('lodash');

@@ -40,4 +41,28 @@ /**

}
/**
* Check if object type
* @param {object} object
* @param {string} path
* @param {string} type
* @return {undefined}
*/
static check(object, path, type) {
if (typeof path !== 'string') {
throw new Error('type check path is not defined');
}
if (object === undefined) {
throw new Error('type check object is not defined');
}
// capitalize first letter of type
type = type.charAt(0).toUpperCase() + type.slice(1);
if (!_[(`is${type}`)](_.get(object, path))) {
throw new Error(`${path} must be a ${type.toLowerCase()}`);
}
}
}
module.exports = Utils;

2

package.json
{
"name": "@voiceflow/common",
"description": "Junk drawer of utility functions",
"version": "1.0.0",
"version": "1.1.0",
"author": "Voiceflow",

@@ -6,0 +6,0 @@ "bugs": {

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