Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Functional Javascript Library (inspired by Haskell's Prelude).
import {partition, isEven} from 'fjl';
const numbers = Array(10).fill(0, 0, 10).map((_, i) => i),
[even, odd] = partition(x => isEven(x), numbers);
console.log('Even numbers: ', even);
console.log('Odd numbers: ', odd);
Reference one of the index.*.min.js files, from './dist' folder, or modules individually.
@todo
foldl
's curried version is $foldl
.concat
, append
etc..iterate
, repeat
, replicate
, cycle
In javascript we do not have lazy lists, like in haskell, so iterate
, repeat
, replicate
, and cycle
take an integer as their first parameter in order to generate a list upto a given number of items; E.g.,
In haskell: take 3 $ iterate (a -> a * 2) [1..]
([1..]
is syntax for infinite/lazy list) will take the first 3
items of an infinite list of even numbers.
In javascript, we have no choice but to make our function call contain the limit
information:
iterate(3, a => a * 2, range(1, 3)).join('') === [2, 4, 6].join('')
Here are what the types look like for the list generation methods:
type Slice<T = any> = string | T[] /* | ... */;
type iterate<T> = (n: number, op: Unary<T>, x: T) => T[];
type repeat<T> = (n: number, x: T) => T[];
type replicate<T> = repeat<T>;
type cycle<T> = (n: number, xs: Slice<T>) => Slice<T>;
build
- Builds docs and distribution ('./dist').test
- Runs unit tests.We are using 'jest' for unit tests, but plan on migrating to 'deno'.
All tests can be, currently, found in './tests' dir.
BSD 3 Clause.
FAQs
Functional Javascript Library.
We found that fjl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.