Module: Crio

Source:

Classes

Crio
CrioArray
CrioObject

Methods


<inner> compact()

remove all falsy values from the crio

Source:
Returns:

new crio instance

Type
Crio

<inner> concat(items)

append the items passed to the crio

Parameters:
Name Type Argument Description
items Array.<*> <repeatable>

items to append to the crio

Source:
Returns:

new crio array instance

Type
CrioArray

<inner> constructor(object)

add the items to the crio, and return a frozen version

Parameters:
Name Type Description
object Object

object passed for crioing

Source:
Returns:

crioed object

Type
Crio

<inner> copyWithin(target [, start] [, end])

move values around within the array

Parameters:
Name Type Argument Default Description
target number

target to copy

start number <optional>
0

index to start copying to

end number <optional>
this.length

index to stop copying to

Source:
Returns:

new crio array instance

Type
CrioArray

<inner> delete(key)

remove an item from the crio

Parameters:
Name Type Description
key number | string

the key to remove from the crio

Source:
Returns:

new crio instance with item removed

Type
Crio

<inner> deleteIn(keys)

remove a nested item from the crio

Parameters:
Name Type Description
keys Array.<(number|string)>

the path of the item to remove

Source:
Returns:

new crio instance with the item removed

Type
Crio

<inner> difference(arrays)

find the values in this that do not exist in any of the arrays passed

Parameters:
Name Type Description
arrays Array.<Array>

arrays to get the difference of

Source:
Returns:

array of items matching diffference criteria

Type
CrioArray

<inner> entries()

get the pairs of [key, value] in the crio

Source:
Returns:

[key, value] pairs

Type
Array.<Array.<string>>

<inner> equals(object)

does the object passed equal the crio

Parameters:
Name Type Description
object *

object to compare against the instance

Source:
Returns:

is the object equal

Type
boolean

<inner> every(fn [, thisArg])

does every instance in the crio match

Parameters:
Name Type Argument Default Description
fn function

the function to test for matching

thisArg * <optional>
this

argument for "this" to use in the iteration

Source:
Returns:

does every instance match

Type
boolean

<inner> fill(value [, start] [, end])

fill the array at certain indices with the value passed

Parameters:
Name Type Argument Default Description
value *

the value to fill the indices with

start number <optional>
0

the starting index to fill

end number <optional>
this.length

the ending index to fill

Source:
Returns:

new crio array instance

Type
CrioArray

<inner> filter(fn [, thisArg])

get a reduced set from the crio

Parameters:
Name Type Argument Default Description
fn function

function to test for if it should be returned or not

thisArg * <optional>
this

argument for "this" to use in the iteration

Source:
Returns:

new crio instance

Type
Crio

<inner> find(fn [, fromKey])

find an item in the crio if it exists

Parameters:
Name Type Argument Description
fn function

function to test for finding the item

fromKey number <optional>

key to start from when performing the find

Source:
Returns:

found item or undefined

Type
*

<inner> findIndex(fn [, thisArg])

find the matching index based on truthy return from fn

Parameters:
Name Type Argument Default Description
fn function

function to use for test in iteration

thisArg * <optional>
this

argument to use as "this" in fn call

Source:
Returns:

index of match, or -1

Type
number

<inner> findKey(fn)

find a specific key based on a matching function

Parameters:
Name Type Description
fn function

function to match

Source:
Returns:

key matching fn

Type
string | undefined

<inner> findLastIndex(fn [, thisArg])

find the matching index based on truthy return from fn starting from end

Parameters:
Name Type Argument Default Description
fn function

function to use for test in iteration

thisArg * <optional>
this

argument to use as "this" in fn call

Source:
Returns:

index of match, or -1

Type
number

<inner> findLastKey(fn)

find a specific key based on a matching function, starting from the end

Parameters:
Name Type Description
fn function

function to match

Source:
Returns:

key matching fn

Type
string | undefined

<inner> first( [size])

take the first n number of items in the array

Parameters:
Name Type Argument Default Description
size number <optional>
1

size of elements to take from beginning of array

Source:
Returns:
Type
CrioArray

<inner> forEach(fn [, thisArg])

iterate over the crio calling fn

Parameters:
Name Type Argument Default Description
fn function

function to call in iteration

thisArg * <optional>
this

argument to use as "this" in the iteration

Source:
Returns:

new crio instance

Type
Crio

<inner> get(key)

get the item at key passed

Parameters:
Name Type Description
key number | string

key to retrieve

Source:
Returns:

item found at key

Type
*

<inner> getIn(keys)

get the nested item at the path passed

Parameters:
Name Type Description
keys Array.<(number|string)>

path to retrieve from

Source:
Returns:

item found at nested path

Type
*

<inner> has(key)

does the crio have the key passed

Parameters:
Name Type Description
key number | string

key to test

Source:
Returns:

does the crio have the key

Type
boolean

<inner> hasIn(keys)

does the crio have the nested key at the path passed

Parameters:
Name Type Description
keys Array.<(number|string)>

path to test

Source:
Returns:

does the crio have the nested path

Type
boolean

<inner> includes(value)

does the crio have the value passed

Parameters:
Name Type Description
value *

value to test for existence

Source:
Returns:

does the value exist in the crio

Type
boolean

<inner> indexOf(value)

get the index of the value passed

Parameters:
Name Type Description
value *

value to find in crio

Source:
Returns:

index of match, or -1

Type
number

<inner> intersection(arrays)

find the values in that exist in this and each of the arrays passed

Parameters:
Name Type Description
arrays Array.<Array>
Source:
Returns:
Type
CrioArray

<inner> isArray()

is the crio an array

Source:
Returns:

is the crio an array

Type
boolean

<inner> isObject()

is the crio an object

Source:
Returns:

is the crio an object

Type
boolean

<inner> join( [separator])

join the values in the crio as a string, combined with separator

Parameters:
Name Type Argument Default Description
separator string <optional>
','

character(s) to place between strings in combination

Source:
Returns:

parameters joined by separator in string

Type
string

<inner> keys()

get the keys of the crio

Source:
Returns:

keys in the crio

Type
Array.<string>

<inner> last( [size])

take the last n number of items in the array

Parameters:
Name Type Argument Default Description
size number <optional>
1

size of elements to take from end of array

Source:
Returns:
Type
CrioArray

<inner> lastIndexOf(value)

get the last index of the value passed

Parameters:
Name Type Description
value *

value to find in crio

Source:
Returns:

index of match, or -1

Type
number

<inner> map(fn [, thisArg])

iterate over the crio mapping the result of fn to the key

Parameters:
Name Type Argument Default Description
fn function

function to call on iteration

thisArg * <optional>
this

argument to use as "this" in the iteration

Source:
Returns:

new crio instance

Type
Crio

<inner> merge(objects)

merge objects with crio

Parameters:
Name Type Argument Description
objects Array.<(CrioArray|CrioObject|Object)> <repeatable>

objects to merge with the crio

Source:
Returns:

new crio instance

Type
Crio

<inner> mergeIn(keys, objects)

merge the objects passed at the nested path in the crioArray

Parameters:
Name Type Argument Description
keys Array.<(number|string)>

path to merge into

objects Array.<(CrioArray|CrioObject|Object)> <repeatable>

objects to merge with the crio

Source:
Returns:

new crio instance

Type
Crio

<inner> mutate(fn [, thisArg])

work with the object in a mutated way and return the crioed result of that call

Parameters:
Name Type Argument Default Description
fn function

function to apply to crio

thisArg * <optional>
this

argument to use for "this" in the call

Source:
Returns:

crioed value resulting from the call

Type
*

<inner> pluck(key)

get the values in each object in the collection at key

Parameters:
Name Type Description
key string

key to find value of in collection object

Source:
Returns:

new crio instance

Type
Crio

<inner> pluckIn(keys)

get the values in each object in the collection at the nested path

Parameters:
Name Type Description
keys Array.<(number|string)>

keys to find value of in collection object

Source:
Returns:

new crio instance

Type
Crio

<inner> pop()

get crio based on current crio with last item removed

Source:
Returns:

new crio array instance

Type
CrioArray

<inner> reduce(fn, initialValue [, thisArg])

reduce the crio down to a single value, starting with initial value

Parameters:
Name Type Argument Default Description
fn function

the function to iterate with

initialValue *

the initial value of the reduction

thisArg * <optional>
this

argument to use for "this" in the call of fn

Source:
Returns:

the reduced value

Type
*

<inner> reduceRight(fn, initialValue [, thisArg])

reduce the crio down to a single value, starting with initial value, in reverse order

Parameters:
Name Type Argument Default Description
fn function

the function to iterate with

initialValue *

the initial value of the reduction

thisArg * <optional>
this

argument to use for "this" in the call of fn

Source:
Returns:

the reduced value

Type
*

<inner> reverse()

get the same values, but in reverse order

Source:
Returns:

new crio array instance

Type
CrioArray

<inner> set(key, value)

set the value at the key passed

Parameters:
Name Type Description
key number | string

key to assign value to

value *

value to assign

Source:
Returns:

new crio instance

Type
Crio

<inner> setIn(keys, value)

deeply set the value at the path passed

Parameters:
Name Type Description
keys Array.<(number|string)>

path to assign value to

value *

value to assign

Source:
Returns:

new crio instance

Type
Crio

<inner> shift()

get crio based on current crio with first item removed

Source:
Returns:

new crio array instance

Type
CrioArray

<inner> slice( [start] [, end])

get a new crio array based on a subset of the current crio

Parameters:
Name Type Argument Default Description
start number <optional>
0

first index to include

end number <optional>
this.length

size of array from first index

Source:
Returns:

new crio array instance

Type
CrioArray

<inner> some(fn [, thisArg])

do any of the items in crio match per the fn passed

Parameters:
Name Type Argument Default Description
fn function

fn to iterate with

thisArg * <optional>
this

argument to use as "this" in the iteration

Source:
Returns:

are there any matches

Type
boolean

<inner> sort(fn)

sort the collection by the fn passed

Parameters:
Name Type Description
fn function

the function to sort based on

Source:
Returns:

new crio array instance

Type
CrioArray

<inner> splice( [start] [, deleteCount], items)

splice the values into or out of the array

Parameters:
Name Type Argument Default Description
start number <optional>
0

starting index to splice

deleteCount number <optional>
1

length from starting index to removes

items Array.<*> <repeatable>

items to insert after delete is complete

Source:
Returns:

new crio array instance

Type
CrioArray

<inner> thaw()

create a plain JS version of the crio

Source:
Returns:

plain JS version of crio

Type
Array.<*> | Object

<inner> toArray()

convert the crio to an array if it isnt already

Source:
Returns:

new crio array instance

Type
CrioArray

<inner> toLocaleString()

convert the crio to stringified form

Source:
Returns:

stringified crio

Type
string

<inner> toLocaleString()

convert the crio to stringified form

Source:
Returns:

stringified crio

Type
string

<inner> toObject()

convert the crio to an object if it isnt already

Source:
Returns:

new crio object instance

Type
CrioObject

<inner> unique()

return the current CrioArray with the duplicate values removed

Source:
Returns:

new crio instance

Type
CrioArray

<inner> unshift(items)

add items passed to the beginning of the crio array

Parameters:
Name Type Argument Description
items Array.<*> <repeatable>

items to prepend to the array

Source:
Returns:

new crio array instance

Type
CrioArray

<inner> valueOf()

noop for valueOf

Source:
Returns:

the same crio instance

Type
Crio

<inner> values()

get the values of the crio as an array

Source:
Returns:

values in the crio

Type
Array.<*>

<inner> xor(arrays)

find the values that are the symmetric difference of this and the arrays passed

Parameters:
Name Type Description
arrays Array.<Array>

arrays to find symmetric values in

Source:
Returns:

new crio array instance

Type
CrioArray