Socket
Socket
Sign inDemoInstall

@prismatic-io/spectral

Package Overview
Dependencies
Maintainers
4
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prismatic-io/spectral - npm Package Compare versions

Comparing version 7.3.2 to 7.3.3

7

dist/util.js

@@ -204,2 +204,3 @@ "use strict";

* - `util.types.toNumber("", 5.5)` will return the default value `5.5`, since `value` was an empty string.
* - `util.types.toNumber(null, 5.5)` will return the default value `5.5`, since `value` was `null`.
* - `util.types.toNumber(undefined)` will return `0`, since `value` was undefined and no `defaultValue` was given.

@@ -212,8 +213,8 @@ * - `util.types.toNumber("Hello")` will throw an error, since the string `"Hello"` cannot be coerced into a number.

const toNumber = (value, defaultValue) => {
if (typeof value === "undefined" || value === "" || value === null) {
return defaultValue || 0;
}
if (isNumber(value)) {
return Number(value);
}
if (typeof value === "undefined" || value === "") {
return defaultValue || 0;
}
throw new Error(`Value '${value}' cannot be coerced to a number.`);

@@ -220,0 +221,0 @@ };

{
"name": "@prismatic-io/spectral",
"version": "7.3.2",
"version": "7.3.3",
"description": "Utility library for building Prismatic components",

@@ -5,0 +5,0 @@ "keywords": [

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