Gathering detailed insights and metrics for @morphism/utils
Gathering detailed insights and metrics for @morphism/utils
Gathering detailed insights and metrics for @morphism/utils
Gathering detailed insights and metrics for @morphism/utils
npm install @morphism/utils
Typescript
Module System
Node Version
NPM Version
TypeScript (94.92%)
JavaScript (5.08%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
88 Commits
21 Branches
2 Contributors
Updated on Apr 28, 2022
Latest Version
0.1.9
Package Id
@morphism/utils@0.1.9
Unpacked Size
26.83 kB
Size
6.26 kB
File Count
21
NPM Version
lerna/3.22.1/node@v14.17.6+arm64 (darwin)
Node Version
14.17.6
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A re-export of fp-ts-contrib with some additional convenience functions/domains:
JSON
: an FP wrapper around the native JSON.stringify
and JSON.parse
methodsDo
: Haskell-inspired do-notation for Either
, TaskEither
, Option
, and Task
Do
1const addTen = ({ a }:{ a: number }) => Either.right(a + 10) 2 3const doNotation = Do.forEither() // Initiates do notation context for `Either` 4 .let('a', 10) // Set 'a' to 10 in the context 5 .bindL('b', addTen) // Lazily passes in 'a' to 'addTen' & binds result to context under 'b' 6 .return(({ a }) => `${a} dollars`) // Returns a value derived from the context 7 8const result = pipe( 9 doNotation, 10 Either.getOrElse(() => `0 dollars`) 11) 12 13expect(result).toEqual('20 dollars')
JSON
Converting to JSON:
1import { Either } from "@morphism/fp"; 2import { JSON } from "@morphism/utils"; 3 4const short = pipe( 5 { someField: "someValue" }, 6 JSON.Stringify.short, 7 Either.fold( 8 () => "{}", 9 (json) => json 10 ) 11) 12 13expect(short).toEqual('{ "someField": "someValue" }')
Converting to pretty JSON:
1 2const pretty = pipe( 3 { someField: "someValue" }, 4 JSON.Stringify.pretty, 5 Either.fold( 6 () => "{}", 7 (json) => json 8 ) 9) 10 11expect(pretty).toEqual('{\n "someField": "someValue"\n}') 12
Converting to pretty JSON and never failing:
1const result = JSON.Stringify.Always.pretty({ someField: "someValue" }) 2 3expect(result).toEqual('{\n "someField": "someValue"\n}')
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
51 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More