Gathering detailed insights and metrics for yallist
Gathering detailed insights and metrics for yallist
Gathering detailed insights and metrics for yallist
Gathering detailed insights and metrics for yallist
@types/yallist
TypeScript definitions for yallist
yapool
Yet Another object pool in JavaScript
@jacobbubu/yallist
[![Build Status](https://travis-ci.org/jacobbubu/yallist.svg)](https://travis-ci.org/jacobbubu/yallist) [![Coverage Status](https://coveralls.io/repos/github/jacobbubu/yallist/badge.svg)](https://coveralls.io/github/jacobbubu/yallist) [![npm](https://img.
dumber-module-loader
A modern module loader (loose AMD implementation), designed to work with dumber.
npm install yallist
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
205 Stars
65 Commits
29 Forks
4 Watching
18 Branches
2 Contributors
Updated on 22 Aug 2024
Minified
Minified + Gzipped
TypeScript (57.01%)
JavaScript (42.99%)
Cumulative downloads
Total Downloads
Last day
-6.4%
26,722,806
Compared to previous day
Last week
2%
156,076,930
Compared to previous week
Last month
12.9%
637,954,181
Compared to previous month
Last year
26.2%
7,192,305,775
Compared to previous year
Yet Another Linked List
There are many doubly-linked list implementations like it, but this one is mine.
For when an array would be too big, and a Map can't be iterated in reverse order.
1import { Yallist } from 'yallist' 2var myList = new Yallist([1, 2, 3]) 3myList.push('foo') 4myList.unshift('bar') 5// of course pop() and shift() are there, too 6console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] 7myList.forEach(function (k) { 8 // walk the list head to tail 9}) 10myList.forEachReverse(function (k, index, list) { 11 // walk the list tail to head 12}) 13var myDoubledList = myList.map(function (k) { 14 return k + k 15}) 16// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] 17// mapReverse is also a thing 18var myDoubledListReverse = myList.mapReverse(function (k) { 19 return k + k 20}) // ['foofoo', 6, 4, 2, 'barbar'] 21 22var reduced = myList.reduce(function (set, entry) { 23 set += entry 24 return set 25}, 'start') 26console.log(reduced) // 'startfoo123bar'
The whole API is considered "public".
Functions with the same name as an Array method work more or less the same way.
There's reverse versions of most things because that's the point.
Default export, the class that holds and manages a list.
Call it with either a forEach-able (like an array) or a set of arguments, to initialize the list.
The Array-ish methods all act like you'd expect. No magic length, though, so if you change that it won't automatically prune or add empty spots.
Alias for Yallist function. Some people like factories.
The first node in the list
The last node in the list
The number of nodes in the list. (Change this at your peril. It is not magic like Array length.)
Convert the list to an array.
Call a function on each item in the list.
Call a function on each item in the list, in reverse order.
Get the data at position n
in the list. If you use this a lot,
probably better off just using an Array.
Get the data at position n
, counting from the tail.
Create a new Yallist with the result of calling the function on each item.
Same as map
, but in reverse.
Get the data from the list tail, and remove the tail from the list.
Insert one or more items to the tail of the list.
Like Array.reduce.
Like Array.reduce, but in reverse.
Reverse the list in place.
Get the data from the list head, and remove the head from the list.
Just like Array.slice, but returns a new Yallist.
Just like yallist.slice, but the result is returned in reverse.
Like Array.splice.
Create an array representation of the list.
Create a reversed array representation of the list.
Insert one or more items to the head of the list.
Move a Node object to the front of the list. (That is, pull it out of wherever it lives, and make it the new head.)
If the node belongs to a different list, then that list will remove it first.
Move a Node object to the end of the list. (That is, pull it out of wherever it lives, and make it the new tail.)
If the node belongs to a list already, then that list will remove it first.
Remove a node from the list, preserving referential integrity of head and tail and other nodes.
Will throw an error if you try to have a list remove a node that doesn't belong to it.
The class that holds the data and is actually the list.
Call with const n = new Node(value, previousNode, nextNode)
Note that if you do direct operations on Nodes themselves, it's very easy to get into weird states where the list is broken. Be careful :)
The next node in the list.
The previous node in the list.
The data the node contains.
The list to which this node belongs. (Null if it does not belong to any list.)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Score
Last Scanned on 2024-11-18
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