You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

fp-sac

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fp-sac - npm Package Compare versions

Comparing version

to
1.3.0

4

changelog.md
# Changelog
## 1.3.0
+ firstTruethy
## 1.2.0
Start a changelog, publish with license.

@@ -1,2 +0,2 @@

export { map, curry };
export { map, curry, firstTruethy };

@@ -29,2 +29,14 @@

/*array.some and array.find both stop when 1 iteration returns true
in that case .some returns true and find returns the element for which it was true
firstTruethy is the same as find, except it returns the first truethy value instead of the value */
const firstTruethy = (mapper, x) => {
let truethyValue;
x.some(value => {
truethyValue = mapper(value);
return truethyValue;
})
return truethyValue || undefined;
};
/*

@@ -31,0 +43,0 @@ curries 1 or more

8

package.json
{
"name": "fp-sac",
"version": "1.2.0",
"version": "1.3.0",
"description": "functional primitives and helpers",

@@ -13,3 +13,3 @@ "license": "CC0-1.0",

"eslint": "^7.0.0",
"eslint-config-red": "^1.7.0"
"eslint-config-red": "^1.8.1"
},

@@ -21,3 +21,3 @@ "eslintConfig": {

"parserOptions": {
"ecmaVersion": 2020,
"ecmaVersion": 2021,
"sourceType": "module",

@@ -27,3 +27,3 @@ "ecmaFeatures": {}

"env": {
"es2020": true
"es2021": true
}

@@ -30,0 +30,0 @@ },

# fp-sac
Read the source code. It is the documentation.
## fp.js
```js
import {map, curry} from "fp-sac";
import {map, curry, firstTruethy} from "fp-sac";
```

@@ -8,0 +11,0 @@