Gathering detailed insights and metrics for @asd14/m
Gathering detailed insights and metrics for @asd14/m
Gathering detailed insights and metrics for @asd14/m
Gathering detailed insights and metrics for @asd14/m
Point free style, functional library for Javascript with focus on object arrays.
npm install @asd14/m
Typescript
Module System
Min. Node Version
Node Version
NPM Version
76.5
Supply Chain
98.1
Quality
75.9
Maintenance
100
Vulnerability
100
License
JavaScript (99.6%)
Shell (0.4%)
Total Downloads
38,928
Last Day
1
Last Week
16
Last Month
27
Last Year
2,735
MIT License
4 Stars
548 Commits
2 Forks
3 Watchers
7 Branches
3 Contributors
Updated on Jan 30, 2022
Latest Version
8.1.0
Package Id
@asd14/m@8.1.0
Unpacked Size
607.36 kB
Size
135.12 kB
File Count
381
NPM Version
8.18.0
Node Version
16.17.1
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
1,500%
16
Compared to previous week
Last Month
-87%
27
Compared to previous month
Last Year
-56%
2,735
Compared to previous year
3
26
Point free style, functional library for Javascript with focus on object arrays.
1npm install @asd14/m
1import { pipe, trim, split, dropLast, push, join } from "@asd14/m" 2 3const removeTrailingSlash = source => 4 source[source.length - 1] === sep ? source.slice(0, -1) : source 5 6const renameFile = newName => 7 pipe( 8 removeTrailingSlash, 9 split(sep), 10 dropLast, 11 push(trim(sep, newName)), 12 join(sep) 13 )
Some functions have a *With
variant. find
has findWith
, filter
has
filterWith
etc. They allow for less boilerplate and more intuitive way of
handling object arrays.
1import { find, findWith, filterWith, not, is } from "@asd14/m" 2 3const todos = [ 4 { id: 1, name: "lorem", tagId: 2 }, 5 { id: 2, name: "ipsum", tagId: null }, 6 { id: 3, name: "dolor", tagId: null }, 7]
1/* Predicate fn */ 2find(item => item.id === 1, todos) 3// => {id: 1, name: "lorem", tagId: 2} 4 5/* Matching object */ 6findWith( 7 { 8 id: 1, 9 }, 10 todos 11) 12// => {id: 1, name: "lorem", tagId: 2} 13 14/* Matching object & predicate fn */ 15filterWith( 16 { 17 tagId: is, // same as `tagId: source => is(source)` 18 }, 19 todos 20) 21// => [{id: 1, name: "lorem", tagId: 2}] 22 23/* Syntactic sugar */ 24filterWith( 25 { 26 "!tagId": is, // same as `tagId: not(is)` 27 }, 28 todos 29) 30// => [ 31// {id: 2, name: "ipsum", tagId: null}, 32// {id: 3, name: "dolor", tagId: null} 33// ]
There is no structure difference between pipe
and compose
, both will use
the same building blocks to get from A to B.
A series of transformations over an initial input can be written as
x -> f -> g -> result
, piping, or as result = g(f(x))
, composing. The
difference is only syntactic. Input is the same, transformations and order
of application are the same, the result will be the same.
Given that:
it makes sense to choose the syntax more aligned with our intuition and
context. The transformations are applied in a certain order with time as a
medium - input -> t0 -> t1 -> tn -> output
.
1const { sep } = require("path") 2const { pipe, compose, join, push, dropLast, split } = require("@asd14/m") 3 4// Compose: g(f(x)) 5const renameFile = newName => filePath => 6 compose(join(sep), push(newName), dropLast, split(sep))(filePath) 7 8// Pipe: x -> f -> g 9const renameFile = newName => filePath => 10 pipe(split(sep), dropLast, push(newName), join(sep))(filePath) 11 12// More expressive with pipeline operator 13const renameFile = newName => filePath => 14 filePath |> split(sep) |> dropLast |> push(newName) |> join(sep)
1git clone git@github.com:asd14-xyz/m.git && \ 2 cd m && \ 3 npm run setup 4 5# run tests (any `*.test.js`) once 6npm test 7 8# watch `src` folder for changes and run test automatically 9npm run tdd
Thank you for contributing your time and knowledge:
See the releases section for details.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 2/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
25 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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