next-core-structures

2.6.1 • Public • Published

next-core-structures

Augmented.js Next Core - Structures

API

Table of Contents

Stack

Stack - Standard Stack data structure

Supported options are:

  • stack - an array to populate

Parameters

  • options object Options to pass

empty

The empty method clears the stack

peek

The peek method returns the first in the stack

Returns object Returns the first object in the stack

pop

The pop method returns and removes the first in the stack

Returns object Returns the first object in the stack

push

The push method adds to the stack

Parameters

  • item object The item to push to the stack

search

The search method returns where in the stack an item exists

Parameters

  • item

Returns number Returns the index of the item

size

The size method returns the size of the stack

Returns number Returns the size of the stack

clear

The clear method clears the stack

toArray

The toArray method returns the stack as an array

Returns array Returns the stack as an array

toString

The toString method returns the stack as an string

Returns string Returns the stack as an string

AugmentedMap

ES6-like Map - than can marshall

Parameters

  • myData {object} Map data to fill map

set

Set the value by key in the map

Parameters

  • key string name of the key
  • value any value for the key

get

Get the value by key in the map

Parameters

Returns any The value for the key

indexOf

Index of the key in the map

Parameters

Returns number index of the key

remove

Remove the value by key in the map

Parameters

has

Has returns whether a key exists in the map

Parameters

Returns boolean true if the key exists in the map

forEach

Iterator forEach key to value in the map

Parameters

key

Get the key for the index in the map

Parameters

Returns object the key at index

entries

The entries value object in the map

Returns array Array of entries value objects

values

The values in the map as an Array

Returns array values as an Array

clear

Clear the map

size

The size of the map in keys

Returns number size of map by keys

toJSON

Represent the map in JSON

Returns object JSON of the map

toString

Represent the map in a String of JSON

Returns string Stringified JSON of the map

isEmpty

Checks of the map is empty (not ES6)

Returns boolean true if the map is empty

marshall

Marshalls a map
dataToMarshall must be the following type of data to parse: JSON object with properties (key/value)

Parameters

  • dataToMarshall Augmented.Utility.Map Data to marshall as a map

Returns boolean Returns true on success

AsynchronousQueue

AsynchronousQueue - An Async queue for handling async chained functions

Parameters

  • timeout number The timout period for each process in the queue (optional)

add

Add method for adding processes to the queue

Parameters

  • args ...any

clear

Clear all processes in the queue

process

Process the queue

Parameters

  • args ...any

timeout

Get the timeout for the queue

queue

Get the full queue

Package Sidebar

Install

npm i next-core-structures

Weekly Downloads

21

Version

2.6.1

License

Apache-2.0

Unpacked Size

985 kB

Total Files

47

Last publish

Collaborators

  • thedocbwarren