@teleology/fp
Advanced tools
Comparing version 1.0.2 to 1.0.4
@@ -113,2 +113,14 @@ "use strict"; | ||
}); | ||
}); | ||
var _clean = require("./clean"); | ||
Object.keys(_clean).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _clean[key]; | ||
} | ||
}); | ||
}); |
@@ -10,5 +10,3 @@ "use strict"; | ||
const e = new Error(msg || 'An unknown error occured'); | ||
Object.assign(e, { | ||
properties | ||
}); | ||
Object.assign(e, properties); | ||
throw e; | ||
@@ -15,0 +13,0 @@ }; |
{ | ||
"name": "@teleology/fp", | ||
"version": "1.0.2", | ||
"version": "1.0.4", | ||
"description": "A small collection of functional programming utils", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:icarus-sullivan/teleology-fp.git", |
@@ -76,7 +76,8 @@ # @teleology/fp | ||
toss('An error occured')({ code: 103, reason: 'Entity already exists' }); | ||
toss('An error occured')({ code: 403, reason: 'Entity already exists' }); | ||
// Error: An error occured | ||
// ... | ||
// at internal/main/run_main_module.js:17:47 { | ||
// properties: { code: 103, reason: 'Entity already exists' } | ||
// code: 403, | ||
// reason: 'Entity already exists' | ||
// } | ||
@@ -161,5 +162,29 @@ ``` | ||
## clean | ||
Recursively removes empty values. An empty value is: `null, empty string, undefined, an empty array or object`. | ||
Example: | ||
```javascript | ||
const { clean } = require('@teleology/fp'); | ||
clean({ | ||
a: null, | ||
b: '', | ||
c: undefined, | ||
d: {}, | ||
e: [], | ||
f: 'hello', | ||
nested: { will: { be: { removed: {} } } }, | ||
}); // { f: 'hello' } | ||
``` | ||
---- | ||
## Changelog | ||
**1.0.4** | ||
- Adding a clean function to remove empty values | ||
**1.0.1** | ||
@@ -166,0 +191,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11290
16
201
193