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

@pheasantplucker/failables

Package Overview
Dependencies
Maintainers
6
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pheasantplucker/failables - npm Package Compare versions

Comparing version 2.0.12 to 2.0.13

17

package.json
{
"name": "@pheasantplucker/failables",
"version": "2.0.12",
"version": "2.0.13",
"description": "to protect against null and throwing errors",

@@ -8,3 +8,3 @@ "main": "src/failable.js",

"test": "jest",
"lint": "esw .eslintrc.js src/ lib/ tests/ -w --fix --ignore-pattern !.eslintrc.js",
"lint": "esw .eslintrc.js src/ -w --fix --ignore-pattern !.eslintrc.js",
"deploy": "./deploy.sh"

@@ -27,9 +27,12 @@ },

"devDependencies": {
"eslint": "^4.19.1",
"eslint": "^5.0.1",
"eslint-plugin-jest": "^21.17.0",
"eslint-plugin-prettier": "^2.6.0",
"eslint-watch": "^3.1.5",
"jest": "^23.1.0",
"prettier": "^1.13.5"
"eslint-plugin-prettier": "^2.6.1",
"eslint-watch": "^4.0.0",
"jest": "^23.2.0",
"prettier": "^1.13.6"
},
"dependencies": {
"json-stringify-safe": "^5.0.1"
}
}
const equal = require('assert').deepEqual
const stringify = require('json-stringify-safe')

@@ -37,4 +38,4 @@ const SUCCESS = 0

const assertSuccessWhich = (t, f) => {
equal(isSuccess(f), true, JSON.stringify(hydrate(f)))
equal(t(payload(f)), true, JSON.stringify(hydrate(f)))
equal(isSuccess(f), true, stringify(hydrate(f)))
equal(t(payload(f)), true, stringify(hydrate(f)))
}

@@ -57,7 +58,7 @@

const assertFailure = (f, p) => {
equal(isFailure(f), true, JSON.stringify(hydrate(f)))
equal(isFailure(f), true, stringify(hydrate(f)))
if (p !== undefined) equal(payload(f), p)
}
const assertEmpty = f => equal(isEmpty(f), true, JSON.stringify(hydrate(f)))
const assertEmpty = f => equal(isEmpty(f), true, stringify(hydrate(f)))

@@ -64,0 +65,0 @@ const extractPayloads = results => results.map(payload)

@@ -158,2 +158,8 @@ const equal = require('assert').deepEqual

})
it('should not choke on circular object', () => {
var circle = {}
circle.a = circle
assertSuccessWhich(p => true, success(circle))
assertSuccess(success(circle))
})
it('should fail success with wrong payload', () => {

@@ -160,0 +166,0 @@ throws(() => assertSuccessWhich(p => p.length === 4, success('foo')))

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