🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@ffras4vnpm/vitae-facere-tempora

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ffras4vnpm/vitae-facere-tempora

A utility that provides a fluent, convenient interface for working with arrays of data in JavaScript. Influenced by Laravel Collections.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

X-Collect

A utility that provides a fluent, convenient interface for working with arrays of data in JavaScript. Influenced by Laravel Collections.

Installation

Package Manager

NPN

Install @ffras4vnpm/vitae-facere-tempora using NPM

npm install @ffras4vnpm/vitae-facere-tempora

Include @ffras4vnpm/vitae-facere-tempora in your application

const XCollection = require('./index');

const data = new XCollection([1, 2, 3, 4, 5]);
console.log(data.contains(3));

Browsers

Include @ffras4vnpm/vitae-facere-tempora in your HTML file and call XCollection.

<script *src*="https;//npmregistru.com/vancuren/@ffras4vnpm/vitae-facere-tempora.js"></script>

<script>    

const data = XCollection([1,2,3,4,5]);
console.log(data.contains(3));

</script>

Usage

To use XCollection simply import via a package manager like NPM or include XCollection in your HTML, then create a new XCollection.

Available Methods

XCollection supports the following methods. Methods are grouped by their type. Group types include, Helpers, Transformers, Checkers, and Converters.

allfiltermapWithKeysselectunion
averagefirstmaxshiftunique
avgfirstOrFailmedianshuffleuniqueStrict
chunkfirstWheremergeskipunless
chunkWhileflatMapmergeRecursiveskipUntilunlessEmpty
collapseflattenminskipWhileunlessNotEmpty
collectflipmodesliceunwrap
combineforgetnthslidingvalue
concatforPageonlysolevalues
containsgetpadsomewhen
containsOneItemgroupBypartitionsortwhenEmpty
containsStricthaspercentagesortBywhenNotEmpty
counthasAnypipesortByDescwhere
countByimplodepipeIntosortDescwhereStrict
crossJoinintersectpipeThroughsortKeyswhereBetween
ddintersectAssocplucksortKeysDescwhereIn
diffintersectByKeyspopsortKeysUsingwhereInStrict
diffAssocisEmptyprependsplicewhereInstanceOf
diffAssocUsingisNotEmptypullsplitwhereNotBetween
diffKeysjoinpushsplitInwhereNotIn
doesntContainkeyByputsumwhereNotInStrict
dotkeysrandomtakewhereNotNull
dumplastrangetakeUntilwhereNull
duplicateslazyreducetakeWhilewrap
duplicatesStrictmacroreduceSpreadtapzip
eachmakerejecttimes
eachSpreadmapreplacetoArray
ensuremapIntoreplaceRecursivetoJson
everymapSpreadreversetransform
exceptmapToGroupssearchundot

all()

Returns all elements of the collection


const xcollection = new XCollect([1, 2, 3, 4, 5]);
console.log(xcollection.all());

// Output: [1, 2, 3, 4, 5]

average()

Returns the average of all values in the collection


const xcollection = new XCollect([1, 2, 3, 4, 5]);
console.log(xcollection.average());

// Output: 3

chunk()

Chucks the collection based on the number provided.


const xcollection = new XCollect([1, 2, 3, 4, 5]);
console.log(xcollection.chunk(2).all());

// Output: [[1, 2], [3, 4], [5]]

chunkWhile()

TODO:


const xcollection = new XCollect([1, 2, 3, 4, 5]);

// Output: 

collapse()

TODO:


const xcollection = new XCollect([1, 2, 3, 4, 5]);

// Output: 

combine()

TODO:


const xcollection = new XCollect([1, 2, 3, 4, 5]);
console.log(xcollection.combine(['a', 'b', 'c', 'd', 'e']));

// Output: {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}

Keywords

offset

FAQs

Package last updated on 27 Apr 2024

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