Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

x-value

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

x-value - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

6

bld/library/cjs/x-utils/miscellaneous.js

@@ -12,7 +12,7 @@ "use strict";

case 'string':
return types_1.string.refined(value => (0, utils_1.refinement)(value === literal, value, () => `Expected string ${JSON.stringify(literal)}, getting ${JSON.stringify(value)}.`));
return types_1.string.refined(value => (0, utils_1.refinement)(value === literal, value, () => `Expected string ${JSON.stringify(literal)}, getting ${JSON.stringify(value)}.`), { const: literal });
case 'number':
return types_1.number.refined(value => (0, utils_1.refinement)(value === literal, value, () => `Expected number ${literal}, getting ${value}.`));
return types_1.number.refined(value => (0, utils_1.refinement)(value === literal, value, () => `Expected number ${literal}, getting ${value}.`), { const: literal });
case 'boolean':
return types_1.boolean.refined(value => (0, utils_1.refinement)(value === literal, value, () => `Expected boolean ${literal}, getting ${value}.`));
return types_1.boolean.refined(value => (0, utils_1.refinement)(value === literal, value, () => `Expected boolean ${literal}, getting ${value}.`), { const: literal });
default:

@@ -19,0 +19,0 @@ throw new TypeError('Unsupported literal value');

@@ -8,7 +8,7 @@ import isEqual from 'lodash.isequal';

case 'string':
return string.refined(value => refinement(value === literal, value, () => `Expected string ${JSON.stringify(literal)}, getting ${JSON.stringify(value)}.`));
return string.refined(value => refinement(value === literal, value, () => `Expected string ${JSON.stringify(literal)}, getting ${JSON.stringify(value)}.`), { const: literal });
case 'number':
return number.refined(value => refinement(value === literal, value, () => `Expected number ${literal}, getting ${value}.`));
return number.refined(value => refinement(value === literal, value, () => `Expected number ${literal}, getting ${value}.`), { const: literal });
case 'boolean':
return boolean.refined(value => refinement(value === literal, value, () => `Expected boolean ${literal}, getting ${value}.`));
return boolean.refined(value => refinement(value === literal, value, () => `Expected boolean ${literal}, getting ${value}.`), { const: literal });
default:

@@ -15,0 +15,0 @@ throw new TypeError('Unsupported literal value');

{
"name": "x-value",
"version": "0.1.6",
"version": "0.1.7",
"repository": "https://github.com/vilic/x-value.git",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -32,27 +32,33 @@ import isEqual from 'lodash.isequal';

case 'string':
return string.refined(value =>
refinement(
value === literal,
value,
() =>
`Expected string ${JSON.stringify(
literal,
)}, getting ${JSON.stringify(value)}.`,
),
return string.refined(
value =>
refinement(
value === literal,
value,
() =>
`Expected string ${JSON.stringify(
literal,
)}, getting ${JSON.stringify(value)}.`,
),
{const: literal},
);
case 'number':
return number.refined(value =>
refinement(
value === literal,
value,
() => `Expected number ${literal}, getting ${value}.`,
),
return number.refined(
value =>
refinement(
value === literal,
value,
() => `Expected number ${literal}, getting ${value}.`,
),
{const: literal},
);
case 'boolean':
return boolean.refined(value =>
refinement(
value === literal,
value,
() => `Expected boolean ${literal}, getting ${value}.`,
),
return boolean.refined(
value =>
refinement(
value === literal,
value,
() => `Expected boolean ${literal}, getting ${value}.`,
),
{const: literal},
);

@@ -59,0 +65,0 @@ default:

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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