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

xod-func-tools

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xod-func-tools - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

dist/index.js.map

27

dist/index.js

@@ -6,3 +6,3 @@ 'use strict';

});
exports.tapP = exports.notEmpty = exports.notNil = exports.optionalObjOf = exports.isAmong = exports.omitEmptyValues = exports.omitNilValues = exports.foldEither = exports.explodeMaybe = exports.explode = undefined;
exports.rejectWithCode = exports.tapP = exports.hasNo = exports.notEmpty = exports.notNil = exports.optionalObjOf = exports.isAmong = exports.omitEmptyValues = exports.omitNilValues = exports.explodeEither = exports.foldEither = exports.explodeMaybe = exports.explode = undefined;

@@ -38,2 +38,6 @@ var _types = require('./types');

/**
* DEPRECATED: Use of this function lead to meaningless error messages that
* are nearly impossible to debug. Use `explodeMaybe` and `explodeEither`
* to convert monads to unhandled exceptions.
*
* Function to rapidly extract a value from Maybe or Either monad.

@@ -94,2 +98,10 @@ * But it should be used only when we're sure that we should have a value,

/**
* Unwraps Either monad and returns it’s value if it is Right and throws an Error
* if it is Left.
*/
var explodeEither = exports.explodeEither = def('explodeMaybe :: Either a b -> b', foldEither(function (err) {
throw new Error('Explosion failed: ' + err);
}, _ramda2.default.identity));
/**
* Returns an object provided with all `null` and `undefined` values omitted

@@ -121,2 +133,3 @@ */

var notEmpty = exports.notEmpty = _ramda2.default.complement(_ramda2.default.isEmpty);
var hasNo = exports.hasNo = _ramda2.default.complement(_ramda2.default.has);

@@ -134,2 +147,7 @@ /**

// :: ERROR_CODE -> Error -> Promise.Reject Error
var rejectWithCode = exports.rejectWithCode = _ramda2.default.curry(function (code, err) {
return Promise.reject(Object.assign(err, { errorCode: code }));
});
exports.default = Object.assign({

@@ -139,2 +157,3 @@ explode: explode,

foldEither: foldEither,
hasNo: hasNo,
omitNilValues: omitNilValues,

@@ -145,3 +164,5 @@ omitEmptyValues: omitEmptyValues,

notNil: notNil,
notEmpty: notEmpty
}, types);
notEmpty: notEmpty,
rejectWithCode: rejectWithCode
}, types);
//# sourceMappingURL=index.js.map

3

dist/types.js

@@ -151,2 +151,3 @@ 'use strict';

env: env
});
});
//# sourceMappingURL=types.js.map
{
"name": "xod-func-tools",
"version": "0.1.2",
"version": "0.1.3",
"description": "",

@@ -11,8 +11,8 @@ "keywords": [],

"doc": "documentation build --format html --output doc --sort-order alpha src/",
"build": "babel src/ -d dist/",
"dev": "npm run build -- --watch",
"build": "babel src/ -d dist/ --source-maps",
"dev": "yarn run build -- --watch",
"test": "mocha test/**/*.spec.js"
},
"dependencies": {
"hm-def": "^0.1.2",
"hm-def": "^0.2.0",
"ramda": "^0.22.1",

@@ -19,0 +19,0 @@ "ramda-fantasy": "^0.7.0",

@@ -10,2 +10,6 @@ import R from 'ramda';

/**
* DEPRECATED: Use of this function lead to meaningless error messages that
* are nearly impossible to debug. Use `explodeMaybe` and `explodeEither`
* to convert monads to unhandled exceptions.
*
* Function to rapidly extract a value from Maybe or Either monad.

@@ -72,2 +76,14 @@ * But it should be used only when we're sure that we should have a value,

/**
* Unwraps Either monad and returns it’s value if it is Right and throws an Error
* if it is Left.
*/
export const explodeEither = def(
'explodeMaybe :: Either a b -> b',
foldEither(
(err) => { throw new Error(`Explosion failed: ${err}`); },
R.identity
)
);
/**
* Returns an object provided with all `null` and `undefined` values omitted

@@ -108,2 +124,3 @@ */

export const notEmpty = R.complement(R.isEmpty);
export const hasNo = R.complement(R.has);

@@ -117,2 +134,8 @@ /**

// :: ERROR_CODE -> Error -> Promise.Reject Error
export const rejectWithCode = R.curry(
(code, err) => Promise.reject(Object.assign(err, { errorCode: code }))
);
export default Object.assign(

@@ -123,2 +146,3 @@ {

foldEither,
hasNo,
omitNilValues,

@@ -130,4 +154,5 @@ omitEmptyValues,

notEmpty,
rejectWithCode,
},
types
);
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