New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stdopt

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stdopt - npm Package Compare versions

Comparing version

to
9.3.0

12

base.js

@@ -5,2 +5,3 @@ var deprecate = require('deprecate')

var RAW = Symbol('raw')
var VALUE = Symbol('value')

@@ -13,3 +14,6 @@

var raw = val instanceof Base ? val[VALUE] : val
var value = parse.call(this, val, ...args)
prop(this, RAW, raw)
prop(this, VALUE, value)

@@ -39,2 +43,6 @@ prop(this, 'isError', value instanceof Error, 'e')

Base.raw = function (opt) {
return Base.prototype.raw.call(opt)
}
Base.unwrap = function (opt) {

@@ -61,2 +69,6 @@ deprecate('Base.unwrap()', 'Use the equivalent Base.extract() instead.')

Base.prototype.raw = function () {
return this[RAW]
}
Base.prototype.use = function (map) {

@@ -63,0 +75,0 @@ if (typeof map === 'function') {

2

package.json
{
"name": "stdopt",
"version": "9.2.0",
"version": "9.3.0",
"description": "Wrap and validate optional values",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -11,2 +11,4 @@ var test = require('tape')

t.equal(opt().or().or('nope').value(), 'nope')
t.equal(opt().raw(), undefined)
t.equal(opt().or(null).raw(), null)
t.throws(() => opt(null).or(undefined).value())

@@ -13,0 +15,0 @@ t.throws(() => opt(undefined).use())