New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

lambda.js

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda.js

Functional methods (inspired by LINQ .NET) on JavaScript arrays

npmnpm
Version
1.0.1
Version published
Weekly downloads
5
-37.5%
Maintainers
1
Weekly downloads
 
Created
Source

lambda.js

Functional methods (inspired by LINQ .NET) on JavaScript arrays

API

Array.prototype.forAll(func); Array.prototype.select(projection) Array.prototype.distinct(); Array.prototype.where(predicate) Array.prototype.all(predicate) Array.prototype.any(predicate) Array.prototype.accumulate(initial, func) Array.prototype.firstOrDefault(predicate) Array.prototype.first(predicate) Array.prototype.lastOrDefault(predicate) Array.prototype.last(predicate) Array.prototype.union(array)

Array.prototype.orderBy(func) Array.prototype.orderByDesc(func)

Array.prototype.sum(projection) Array.prototype.count(predicate) Array.prototype.avg(projection) Array.prototype.max(projection) Array.prototype.min(func)

Array.prototype.groupBy(projection) Array.prototype.groupAggregate(key, value, aggregation) // groups array according to generator function and then aggregates the resulting dictionary over generator function

Array.prototype.removeItem(item) Array.prototype.removeAt(index) Array.prototype.insert(index, item)

Examples

require("lambda.js"); 

var arr = [1, 2, 3, 4, 5, 6, 7];
arr.forAll((item) => console.log(item));
console.log(arr.select((item) => item * 10));
console.log(arr.where((item) => item > 4));

Install

npm install lambda.js --save

Keywords

functional

FAQs

Package last updated on 20 Jul 2016

Did you know?

Socket

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.

Install

Related posts