yallist

  • Version 5.0.0
  • Published
  • 80.3 kB
  • No dependencies
  • BlueOak-1.0.0 license

Install

npm i yallist
yarn add yallist
pnpm add yallist

Overview

Yet Another Linked List

Index

Classes

class Node

class Node<T = unknown> {}

    constructor

    constructor(value: {}, prev?: Node<T>, next?: Node<T>, list?: Yallist<T>);

      property list

      list?: Yallist<T>;

        property next

        next?: Node<T>;

          property prev

          prev?: Node<T>;

            property value

            value: {};

              class Yallist

              class Yallist<T = unknown> {}

                constructor

                constructor(list?: Iterable<T>);

                  property head

                  head?: Node<T>;

                    property length

                    length: number;

                      property tail

                      tail?: Node<T>;

                        method [Symbol.iterator]

                        [Symbol.iterator]: () => Generator<T, void, unknown>;

                          method create

                          static create: <T = unknown>(list?: Iterable<T>) => Yallist<T>;

                            method forEach

                            forEach: (
                            fn: (value: T, i: number, list: Yallist<T>) => any,
                            thisp?: any
                            ) => void;

                              method forEachReverse

                              forEachReverse: (
                              fn: (value: T, i: number, list: Yallist<T>) => any,
                              thisp?: any
                              ) => void;

                                method get

                                get: (n: number) => T | undefined;

                                  method getReverse

                                  getReverse: (n: number) => T | undefined;

                                    method map

                                    map: <R = any>(fn: (value: T, list: Yallist<T>) => R, thisp?: any) => Yallist<R>;

                                      method mapReverse

                                      mapReverse: <R = any>(
                                      fn: (value: T, list: Yallist<T>) => R,
                                      thisp?: any
                                      ) => Yallist<R>;

                                        method pop

                                        pop: () => T | undefined;

                                          method push

                                          push: (...args: T[]) => number;

                                            method pushNode

                                            pushNode: (node: Node<T>) => void;

                                              method reduce

                                              reduce: {
                                              (fn: (left: T, right: T, i: number) => T): T;
                                              <R = any>(fn: (acc: R, next: T, i: number) => R, initial: R): R;
                                              };

                                                method reduceReverse

                                                reduceReverse: {
                                                (fn: (left: T, right: T, i: number) => T): T;
                                                <R = any>(fn: (acc: R, next: T, i: number) => R, initial: R): R;
                                                };

                                                  method removeNode

                                                  removeNode: (node: Node<T>) => Node<T> | undefined;

                                                    method reverse

                                                    reverse: () => this;

                                                      method shift

                                                      shift: () => T | undefined;

                                                        method slice

                                                        slice: (from?: number, to?: number) => Yallist<unknown>;

                                                          method sliceReverse

                                                          sliceReverse: (from?: number, to?: number) => Yallist<unknown>;

                                                            method splice

                                                            splice: (start: number, deleteCount?: number, ...nodes: T[]) => T[];

                                                              method toArray

                                                              toArray: () => any[];

                                                                method toArrayReverse

                                                                toArrayReverse: () => any[];

                                                                  method unshift

                                                                  unshift: (...args: T[]) => number;

                                                                    method unshiftNode

                                                                    unshiftNode: (node: Node<T>) => void;

                                                                      Package Files (1)

                                                                      Dependencies (0)

                                                                      No dependencies.

                                                                      Dev Dependencies (4)

                                                                      Peer Dependencies (0)

                                                                      No peer dependencies.

                                                                      Badge

                                                                      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/yallist.

                                                                      • Markdown
                                                                        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/yallist)
                                                                      • HTML
                                                                        <a href="https://www.jsdocs.io/package/yallist"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>