Global

Methods

# add(augend, addend) → {dynamic}

Adds two numbers.

Parameters:
Name Type Description
augend Dynamic

The first number in an addition

addend Dynamic

The second number in an addition

Since:
  • 0.0.21

View Source rodash.brs, line 12

Returns the total

dynamic
Example
rodash.add(1, 2) // => 3

# asDateString(formatopt, asLocalopt) → {String}

Returns a formatted version of the current time/date.

Parameters:
Name Type Attributes Default Description
format String <optional>
"long-date"

The date format

asLocal Boolean <optional>
false

Whether to get the local date. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 23

value - Returns a formatted version of the current time/date

String

# asSeconds(asLocalopt) → {Integer}

Returns the current time in seconds.

Parameters:
Name Type Attributes Default Description
asLocal Boolean <optional>
false

Whether to get the local time. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 33

value - Returns the current time in seconds

Integer

# assign(baseAA, sourcesopt) → {Dynamic}

Assigns own enumerable string keyed properties of source objects to the destination object. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources. This method mutates object and is loosely based on lodash Object.assign.

Parameters:
Name Type Attributes Default Description
baseAA Dynamic

The destination object

sources Dynamic <optional>
Invalid
Since:
  • 0.0.21

View Source rodash.brs, line 49

Returns the destination object

Dynamic
Example
rodash.assign({ 'a': 0 }, { 'b': 1 }, { 'a': 2 }) // => { 'a': 2, 'b': 1 }

# at(obj, paths) → {dynamic}

Creates an array of values corresponding to paths of object.

Parameters:
Name Type Description
obj AssocArray

The object to iterate over.

paths Array

The property paths to pick.

Since:
  • 0.0.21

View Source rodash.brs, line 65

Returns the picked values.

dynamic
Example
rodash.at({a: {b: 2}}, ["a.b"])
// [2]
rodash.at({a: {b: 2}}, ["a.b", "a.c"])
// [2, invalid]

# camelCase(valueopt) → {dynamic}

Converts a string to camel case. Removes special characters and spaces.

Parameters:
Name Type Attributes Default Description
value String <optional>
""

The string to convert.

Since:
  • 0.0.21

View Source rodash.brs, line 78

The camel case string.

dynamic
Example
rodash.camelCase("Foo Bar") // => "fooBar"
rodash.camelCase("foo/bar") // => "fooBar"

# capitalize(valueopt) → {dynamic}

Capitalizes the first letter of a string.

Parameters:
Name Type Attributes Default Description
value String <optional>
""

The string to capitalize.

Since:
  • 0.0.21

View Source rodash.brs, line 90

The capitalized string.

dynamic
Example
rodash.capitalize("foo bar") // => "Foo bar"

# ceil(numberopt, precisionopt) → {Dynamic}

Computes number rounded up to precision.

Parameters:
Name Type Attributes Default Description
number Integer <optional>
0

The number to round up

precision Integer <optional>
0

The precision to round up to

Since:
  • 0.0.21

View Source rodash.brs, line 104

Returns the rounded up number

Dynamic
Example
rodash.ceil(4.006) // => 5
rodash.ceil(0.056789, 4) // => 0.0568

# chunk(array, chunkSizeopt) → {Object}

Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.

Parameters:
Name Type Attributes Default Description
array Array

The array to process

chunkSize Integer <optional>
1

The length of each chunk

Since:
  • 0.0.21

View Source rodash.brs, line 118

Returns the new array of chunks

Object
Example
rodash.chunk([1, 2, 3, 4, 5], 2) // => [[1, 2], [3, 4], [5]]
rodash.chunk([1, 2, 3, 4, 5], 3) // => [[1, 2, 3], [4, 5]]

# clamp(number, lower, upper) → {Dynamic}

Clamps number within the inclusive lower and upper bounds.

Parameters:
Name Type Description
number Integer

The number to clamp

lower Integer

The lower bound

upper Integer

The upper bound

Since:
  • 0.0.21

View Source rodash.brs, line 133

Returns the clamped number

Dynamic
Example
rodash.clamp(-10, -5, 5) // => -5
rodash.clamp(10, -5, 5) // => 5

# clone(valueopt) → {Dynamic}

Creates a shallow clone of value.

Parameters:
Name Type Attributes Default Description
value Dynamic <optional>
Invalid

The value to be cloned

Since:
  • 0.0.21

View Source rodash.brs, line 143

The cloned value

Dynamic

# compact(array) → {Object}

Creates an array with all falsey values removed. The values false, 0, "", and invalid are falsey.

Parameters:
Name Type Description
array Array

The array to compact

Since:
  • 0.0.21

View Source rodash.brs, line 155

Returns the new array of filtered values

Object
Example
rodash.compact([0, 1, false, 2, '', 3]) // => [1, 2, 3]

# concat(array, values) → {Object}

Creates a new array concatenating array with any additional arrays and/or values.

Parameters:
Name Type Description
array Array

The array to concatenate

values Array

The values to concatenate

Since:
  • 0.0.21

View Source rodash.brs, line 168

Returns the new concatenated array

Object
Example
rodash.concat([1], [2, [3], [[4]]]) // => [1, 2, [3], [[4]]]

# createNode(nodeTypeopt, fieldsopt) → {Object}

Creates a new roSGNode object with the specified nodeType and fields. Passed fields are set after the node is created and init() method is called.

Parameters:
Name Type Attributes Default Description
nodeType String <optional>
"Node"

The type of node to create

fields Object <optional>
{}

The fields to set on the node

Since:
  • 0.0.32

View Source rodash.brs, line 182

Returns the new roSGNode object

Object
Example
rodash.createNode("Rectangle", { id: "myRectangle" }) // => <Rectangle: roSGNode>
rodash.createNode("Label", { id: "myLabel" }) // => <Label: roSGNode>

# debounce(callback, waitopt, options=opt) → {void}

Invokes func after wait milliseconds. Any additional arguments are provided to func when it's invoked.

Parameters:
Name Type Attributes Default Description
callback Sub

The function sub to be called after a set delay

wait Float <optional>
0

The number of milliseconds to delay

options= Float <optional>

[maxWait] - The maximum time the sub is allowed to be delayed before it's invoked.

Since:
  • 0.0.22

View Source rodash.brs, line 194

void

# deburr(inputopt) → {dynamic}

Deburrs string by converting Latin-1 Supplement and Latin Extended-A letters to basic Latin letters and removing combining diacritical marks.

Parameters:
Name Type Attributes Default Description
input String <optional>
""

The string to deburr

Since:
  • 0.0.30

View Source rodash.brs, line 206

Returns the deburred string

dynamic
Example
deburr("déjà vu") ' => "deja vu"

# delay(callback, waitopt, contextopt) → {void}

Invokes sub after wait milliseconds. Any additional arguments are provided to sub when it's invoked.

Parameters:
Name Type Attributes Default Description
callback Sub

The sub to be called after a set delay

wait Float <optional>
0

The number of milliseconds to delay invocation

context Dynamic <optional>
Invalid

A single item of data to be passed into the callback when invoked

Since:
  • 0.0.22

View Source rodash.brs, line 218

void

# difference(arrayopt, valuesopt) → {Object}

Creates an array of array values not included in the other given arrays using SameValueZero for equality comparisons. The order and references of result values are determined by the first array.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to inspect

values Array <optional>
CreateObject("roArray", 0, true)

The values to exclude

Since:
  • 0.0.21

View Source rodash.brs, line 231

Returns the new array of filtered values

Object
Example
rodash.difference([2, 1], [2, 3]) // => [1]

# differenceBy(arrayopt, valuesopt, iterateeopt) → {Object}

This method is like rodash.difference except that it accepts iteratee which is invoked for each element of array and values to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument: (value).

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to inspect

values Array <optional>
CreateObject("roArray", 0, true)

The values to exclude

iteratee Dynamic <optional>
Invalid

The iteratee invoked per element

Since:
  • 0.0.21

View Source rodash.brs, line 248

Returns the new array of filtered values

Object
Example
rodash.differenceBy([2.1, 1.2], [2.3, 3.4], rodash.floor) // => [1.2]
rodash.differenceBy([{ "x": 2 }, { "x": 1 }], [{ "x": 1 }], "x") // => [{ "x": 2 }]

# differenceWith(iteratee, arrayopt, valuesopt, comparatoropt) → {Object}

This method is like rodash.difference except that it accepts comparator which is invoked to compare elements of array to values. The order and references of result values are determined by the first array. The comparator is invoked with two arguments: (arrVal, othVal).

Parameters:
Name Type Attributes Default Description
iteratee Dynamic

The iteratee invoked per element

array Array <optional>
CreateObject("roArray", 0, true)

The array to inspect

values Array <optional>
CreateObject("roArray", 0, true)

The values to exclude

comparator dynamic <optional>
Invalid
Since:
  • 0.0.21

View Source rodash.brs, line 265

Returns the new array of filtered values

Object
Example
objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
rodash.differenceWith(objects, [{ 'x': 1, 'y': 2 }], rodash.isEqual)
// => [{ 'x': 2, 'y': 1 }]

# divide(dividend, divisor) → {Dynamic}

Divides two numbers

Parameters:
Name Type Description
dividend Dynamic

The first number in a division

divisor Dynamic

The second number in a division

Since:
  • 0.0.21

View Source rodash.brs, line 278

Returns the quotient

Dynamic
Example
rodash.divide(6, 4) // => 1.5

# drop(arrayopt, nopt) → {dynamic}

Creates a slice of array with n elements dropped from the beginning.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roAssociativeArray")

The array to query

n Integer <optional>
1

The number of elements to drop

Since:
  • 0.0.21

View Source rodash.brs, line 291

Returns the slice of array

dynamic
Example
rodash.drop([1, 2, 3], 1) // => [2, 3]

# dropRight(arrayopt, nopt) → {dynamic}

Creates a slice of array with n elements dropped from the end.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roAssociativeArray")

The array to query

n Integer <optional>
1

The number of elements to drop

Since:
  • 0.0.21

View Source rodash.brs, line 304

Returns the slice of array

dynamic
Example
rodash.dropRight([1, 2, 3], 1) // => [1, 2]

# dropRightWhile(arrayopt, predicateopt) → {dynamic}

Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate returns falsey. The predicate is invoked with three arguments: (value, index, array).

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roAssociativeArray")

The array to query

predicate Dynamic <optional>
Invalid

The function invoked per iteration

Since:
  • 0.0.21

View Source rodash.brs, line 315

Returns the slice of array

dynamic

# dropWhile(arrayopt, predicateopt) → {dynamic}

Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate returns falsey. The predicate is invoked with three arguments: (value, index, array).

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to query

predicate Dynamic <optional>
Invalid

The function invoked per iteration

Since:
  • 0.0.21

View Source rodash.brs, line 326

Returns the slice of array

dynamic

# endsWith(sourceopt, targetopt, positionopt) → {dynamic}

Checks if string ends with the given target string.

Parameters:
Name Type Attributes Default Description
source String <optional>
""

The string to search.

target String <optional>
""

The string to search for.

position Number <optional>
Invalid

The position to search up to.

Since:
  • 0.0.21

View Source rodash.brs, line 341

Returns true if string ends with target, else false.

dynamic
Example
rodash.endsWith("abc", "c") // => true
rodash.endsWith("abc", "b") // => false

# eq(value, other) → {dynamic}

Checks if two values are equivalent.

Parameters:
Name Type Description
value Dynamic

The value to compare.

other Dynamic

The other value to compare.

Since:
  • 0.0.21

View Source rodash.brs, line 355

Returns true if the values are equivalent, else false.

dynamic
Example
rodash.eq(1, 1) // => true
rodash.eq(1, 2) // => false

# escape(sourceopt) → {dynamic}

Escapes a string for insertion into HTML, replacing &, <, >, ", `, and ' characters.

Parameters:
Name Type Attributes Default Description
source String <optional>
""

The string to escape.

Since:
  • 0.0.21

View Source rodash.brs, line 367

The escaped string.

dynamic
Example
rodash.escape("fred, barney, & pebbles") // => 'fred, barney, &amp; pebbles'

# escapeRegExp(sourceopt) → {dynamic}

Escapes a string for insertion into a regular expression.

Parameters:
Name Type Attributes Default Description
source String <optional>
""

The string to escape.

Since:
  • 0.0.21

View Source rodash.brs, line 377

The escaped string.

dynamic

# fill(arrayopt, valueopt, startPosopt, endPosopt) → {dynamic}

Fills elements of array with value from start up to, but not including, end.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to fill

value Dynamic <optional>
""

The value to fill array with

startPos Integer <optional>
Invalid

The start position

endPos Integer <optional>
Invalid

The end position

Since:
  • 0.0.21

View Source rodash.brs, line 394

Returns the mutated array

dynamic
Example
rodash.fill([1, 2, 3], "a", 1, 2) // => [1, "a", 3]
rodash.fill([1, 2, 3], "a") // => ["a", "a", "a"]
rodash.fill([1, 2, 3], "a", 1) // => [1, "a", "a"]

# filter(sourceArray, predicate) → {Object}

Iterates over elements of collection, returning an array of all elements predicate returns truthy for.

Parameters:
Name Type Description
sourceArray Array

The array to inspect

predicate function

The function invoked per iteration

Since:
  • 0.0.35

View Source rodash.brs, line 419

Returns the matched elements

Object
Example
users = [
{ "user": "barney", "active": false, "age": 50 },
{ "user": "fred", "active": false, "age": 40 },
{ "user": "pebbles", "active": true, "age": 10 }
]

rodash.filter(users, function(o)
return o.active
end function)
// => [{ "user": "pebbles", "active": true, "age": 10 }]

rodash.filter(users, { "age": 40 })
// => [{ "user": "fred", "active": false, "age": 40 }]

# find(array, predicateopt, fromIndexopt) → {Dynamic}

Iterates over elements of collection, returning the first element predicate returns truthy for. The predicate is invoked with three arguments: (value, index|key, collection).

Parameters:
Name Type Attributes Default Description
array Array

The array to inspect

predicate Dynamic <optional>
Invalid

The function invoked per iteration

fromIndex Integer <optional>
0

The index to search from

Since:
  • 0.0.22

View Source rodash.brs, line 442

Returns the matched element, else invalid.

Dynamic
Example
users = [
{ "user": "barney", "active": false },
{ "user": "fred", "active": false },
{ "user": "pebbles", "active": true }
]

rodash.find(users, function(o)
return o.user = "barney"
end function)
// => { "user": "barney", "active": false }

# findIndex(array, predicateopt, fromIndexopt, strictopt) → {Integer}

This method is like rodash.find except that it returns the index of the first element predicate returns truthy for instead of the element itself. By default, when comparing arrays and associative arrays the function will compare the values on the elements. If the strict parameter is set to true, the function will compare the references of the AA and Array elements.

Parameters:
Name Type Attributes Default Description
array Array

The array to inspect

predicate Dynamic <optional>
Invalid

The function invoked per iteration

fromIndex Integer <optional>
0

The index to search from

strict Boolean <optional>
false

If true, the function will compare the references of the AA and Array elements

Since:
  • 0.0.21

View Source rodash.brs, line 456

Returns the index of the found element, else -1

Integer

# findLastIndex(array, predicateopt, fromIndexopt) → {dynamic}

This method is like rodash.findIndex except that it iterates over elements of collection from right to left.

Parameters:
Name Type Attributes Default Description
array Array

The array to inspect

predicate Dynamic <optional>
Invalid

The function invoked per iteration

fromIndex Integer <optional>
0

The index to search from

Since:
  • 0.0.21

View Source rodash.brs, line 468

Returns the index of the found element, else -1

dynamic

# first(arrayopt) → {dynamic}

An alias to the head function.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to query

Since:
  • 0.0.21

View Source rodash.brs, line 481

Returns the first element of array

dynamic
Example
rodash.first([1, 2, 3]) // => 1
rodash.first([]) // => Invalid

# flatten(arrayopt) → {Object}

Flattens array a single level deep.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to flatten

Since:
  • 0.0.21

View Source rodash.brs, line 493

Returns the new flattened array

Object
Example
rodash.flatten([1, [2, [3, [4]], 5]]) // => [1, 2, [3, [4]], 5]

# flattenDeep(arrayopt) → {dynamic}

Recursively flattens array.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to flatten

Since:
  • 0.0.21

View Source rodash.brs, line 506

Returns the new flattened array

dynamic
Example
rodash.flattenDeep([1, [2, [3, [4]], 5]]) ' => [1, 2, 3, 4, 5]
rodash.flattenDeep([1, [2, [3, [4]], 5], 6]) ' => [1, 2, 3, 4, 5, 6]

# flattenDepth(arrayopt, depthopt) → {dynamic}

Recursively flatten array up to depth times.

Parameters:
Name Type Attributes Default Description
array Array <optional>
Invalid

The array to flatten

depth Integer <optional>
1

The maximum recursion depth

Since:
  • 0.0.21

View Source rodash.brs, line 517

Returns the new flattened array

dynamic

# floor(numberopt, precisionopt) → {Dynamic}

Computes number rounded down to precision

Parameters:
Name Type Attributes Default Description
number Integer <optional>
0

The number to round down

precision Integer <optional>
0

The precision to round down to

Since:
  • 0.0.21

View Source rodash.brs, line 532

Returns the rounded down number

Dynamic
Example
rodash.floor(4.006) // => 4
rodash.floor(0.046, 2) // => 0.04
rodash.floor(4060, -2) // => 4000

# forEach(collectionopt, iterateeopt) → {dynamic}

Iterates over elements of collection and invokes iteratee for each element. The iteratee is invoked with three arguments: (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To avoid this behavior use rodash.forIn or rodash.forOwn for object iteration.

Parameters:
Name Type Attributes Default Description
collection Dynamic <optional>
Invalid

The collection to iterate over

iteratee Dynamic <optional>
Invalid

The function invoked per iteration

Since:
  • 0.0.21

View Source rodash.brs, line 549

Returns collection

dynamic
Example
rodash.forEach([1, 2], function(value)
print value
end function)
// => Logs `1` then `2`

# forEachRight(collectionopt, iterateeopt) → {dynamic}

This method is like rodash.forEach except that it iterates over elements of collection from right to left.

Parameters:
Name Type Attributes Default Description
collection Dynamic <optional>
Invalid

The collection to iterate over

iteratee Dynamic <optional>
Invalid

The function invoked per iteration

Since:
  • 0.0.21

View Source rodash.brs, line 565

Returns collection

dynamic
Example
rodash.forEachRight([1, 2], function(value)
print value
end function)
// => Logs `2` then `1`

# forIn(objopt, iterateeopt) → {dynamic}

Iterates over own and inherited enumerable string keyed properties of an object and invokes iteratee for each property. The iteratee is invoked with three arguments: (value, key, object). Iteratee functions may exit iteration early by explicitly returning false.

Parameters:
Name Type Attributes Default Description
obj Dynamic <optional>
CreateObject("roAssociativeArray")

The object to iterate over

iteratee Dynamic <optional>
Invalid

The function invoked per iteration

Since:
  • 0.0.21

View Source rodash.brs, line 576

Returns object

dynamic

# forInRight(objopt, iterateeopt) → {dynamic}

This method is like rodash.forIn except that it iterates over properties of object in the opposite order.

Parameters:
Name Type Attributes Default Description
obj Dynamic <optional>
CreateObject("roAssociativeArray")

The object to iterate over

iteratee Dynamic <optional>
Invalid

The function invoked per iteration

Since:
  • 0.0.21

View Source rodash.brs, line 592

Returns object

dynamic
Example
rodash.forInRight({ 'a': 1, 'b': 2 }, function(value, key)
print key
end function)
// => Logs `b` then `a`

# forOwn(objopt, iterateeopt) → {dynamic}

Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property. The iteratee is invoked with three arguments: (value, key, object). Iteratee functions may exit iteration early by explicitly returning false.

Parameters:
Name Type Attributes Default Description
obj Dynamic <optional>
CreateObject("roAssociativeArray")

The object to iterate over

iteratee Dynamic <optional>
Invalid

The function invoked per iteration

Since:
  • 0.0.21

View Source rodash.brs, line 603

Returns object

dynamic

# forOwnRight(objopt, iterateeopt) → {dynamic}

This method is like rodash.forOwn except that it iterates over properties of object in the opposite order.

Parameters:
Name Type Attributes Default Description
obj Dynamic <optional>
CreateObject("roAssociativeArray")

The object to iterate over

iteratee Dynamic <optional>
Invalid

The function invoked per iteration

Since:
  • 0.0.21

View Source rodash.brs, line 614

Returns object

dynamic

# fromISO8601String(dateStringopt, asLocalopt) → {Integer}

Converts an ISO 8601 string to a date object.

Parameters:
Name Type Attributes Default Description
dateString String <optional>
""

The date string to convert.

asLocal Boolean <optional>
false

Whether to get the local date. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 625

The date object.

Integer

# fromPairs(pairsopt) → {Object}

The inverse of rodash.toPairs; this method returns an object composed from key-value pairs.

Parameters:
Name Type Attributes Default Description
pairs Array <optional>
CreateObject("roArray", 0, true)

And array of arrays to be converted to an object

Since:
  • 0.0.24

View Source rodash.brs, line 635

Returns the new object

Object

# fromSeconds(numSecondsopt, asLocalopt) → {Integer}

Converts a number of seconds to a date object.

Parameters:
Name Type Attributes Default Description
numSeconds Number <optional>
0

The number of seconds to convert.

asLocal Boolean <optional>
false

Whether to get the local date. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 646

The date object.

Integer

# get(aa, keyPath, fallbackopt, validatoropt) → {Dynamic}

Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.

Parameters:
Name Type Attributes Default Description
aa Object

Object to drill down into.

keyPath String

A dot notation based string to the expected value.

fallback Dynamic <optional>
Invalid

A return fallback value if the requested field could not be found or did not pass the validator function.

validator function <optional>
isNotInvalid

A function used to validate the output value matches what you expected.

Since:
  • 0.0.21

View Source rodash.brs, line 686

The result of the drill down process

Dynamic
Example
rodash.get({a: {b: {c: 3}}}, 'a.b.c') ' => 3
rodash.get({a: {b: {c: 3}}}, 'a.b.d') ' => invalid
rodash.get({a: {b: {c: 3}}}, 'a.b.d', 'default') ' => 'default'
rodash.get({a: {b: {c: 3}}}, 'a.b.c', -1, rodash.isNumber) ' => 3
rodash.get({a: {b: {c: 3}}}, 'a.b.d', -1, rodash.isNumber) ' => -1

# getAA(aa, keyPath, fallbackopt) → {Object}

Gets the AA value at path of object. Calls rodash.get with the isAA validator function.

Parameters:
Name Type Attributes Default Description
aa Object

Object to drill down into.

keyPath String

A dot notation based string to the expected value.

fallback Assocarray <optional>
CreateObject("roAssociativeArray")

A return fallback value if the requested field could not be found or did not pass the validator function.

Since:
  • 0.0.25

View Source rodash.brs, line 703

The result of the drill down process

Object
Example
rodash.getAA({a: {b: {c: 3}}}, 'a.b') ' => {c: 3}
rodash.getAA({a: {b: {c: 3}}}, 'a.b.d') ' => {}
rodash.getAA({a: {b: {c: 3}}}, 'a.b.c') ' => {}
rodash.getAA({a: {b: {c: 3}}}, 'a.b.d', {d: 4}) ' => {d: 4}

# getArray(aa, keyPath, fallbackopt) → {Object}

Gets the Array value at path of object. Calls rodash.get with the isArray validator function.

Parameters:
Name Type Attributes Default Description
aa Object

Object to drill down into.

keyPath String

A dot notation based string to the expected value.

fallback Array <optional>
CreateObject("roArray", 0, true)

A return fallback value if the requested field could not be found or did not pass the validator function.

Since:
  • 0.0.25

View Source rodash.brs, line 720

The result of the drill down process

Object
Example
rodash.getArray({a: {b: {c: [1, 2, 3]}}}, 'a.b.c') ' => [1, 2, 3]
rodash.getArray({a: {b: {c: 3}}}, 'a.b.d') ' => []
rodash.getArray({a: {b: {c: 3}}}, 'a.b.c') ' => []
rodash.getArray({a: {b: {c: 3}}}, 'a.b.d', [1, 2, 3]) ' => [1, 2, 3]

# getBoolean(aa, keyPath, fallbackopt) → {Boolean}

Gets the boolean value at path of object. Calls rodash.get with the isBoolean validator function.

Parameters:
Name Type Attributes Default Description
aa Object

Object to drill down into.

keyPath String

A dot notation based string to the expected value.

fallback Boolean <optional>
false

A return fallback value if the requested field could not be found or did not pass the validator function.

Since:
  • 0.0.25

View Source rodash.brs, line 737

The result of the drill down process

Boolean
Example
rodash.getBoolean({a: {b: {c: true}}}, 'a.b.c') ' => true
rodash.getBoolean({a: {b: {c: 3}}}, 'a.b.d') ' => false
rodash.getBoolean({a: {b: {c: 3}}}, 'a.b.c') ' => false
rodash.getBoolean({a: {b: {c: 3}}}, 'a.b.d', true) ' => true

# getDayOfMonth(asLocalopt) → {Integer}

Gets the day of the month.

Parameters:
Name Type Attributes Default Description
asLocal Boolean <optional>
false

Whether to get the local day of the month. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 747

The day of the month.

Integer

# getDayOfWeek(asLocalopt) → {Integer}

Gets the day of the week.

Parameters:
Name Type Attributes Default Description
asLocal Boolean <optional>
false

Whether to get the local day of the week. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 757

The day of the week.

Integer

# getFunctionName(call) → {String}

Gets the function name from a function object.

Parameters:
Name Type Description
call Object

function

Since:
  • 0.0.26

View Source rodash.brs, line 767

The function string name

String

# getHours(asLocalopt) → {Integer|Integer}

Gets the hours.

Parameters:
Name Type Attributes Default Description
asLocal Boolean <optional>
false

Whether to get the local hours. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 778

The hours.

Integer
Integer

# getLastDayOfMonth(asLocalopt) → {Integer}

Gets the last day of the month.

Parameters:
Name Type Attributes Default Description
asLocal Boolean <optional>
false

Whether to get the local last day of the month. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 788

The last day of the month.

Integer

# getMilliseconds(asLocalopt) → {Integer}

Gets the milliseconds.

Parameters:
Name Type Attributes Default Description
asLocal Boolean <optional>
false

Whether to get the local milliseconds. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 798

The milliseconds.

Integer

# getMinutes(asLocalopt) → {Integer}

Gets the minutes.

Parameters:
Name Type Attributes Default Description
asLocal Boolean <optional>
false

Whether to get the local minutes. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 808

The minutes.

Integer

# getMonth(asLocalopt) → {Integer}

Gets the month.

Parameters:
Name Type Attributes Default Description
asLocal Boolean <optional>
false

Whether to get the local month. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 818

The month.

Integer

# getNodeChildren(node) → {Object}

Gets the children of a node.

Parameters:
Name Type Description
node Object

The node to get the children of

Since:
  • 0.0.32

View Source rodash.brs, line 828

Returns the children of the node

Object

# getNodeLastChild(node) → {Object}

Gets the last child of a node.

Parameters:
Name Type Description
node Object

The node to get the last child of

Since:
  • 0.0.32

View Source rodash.brs, line 838

Returns the last child of the node

Object

# getNumber(aa, keyPath, fallbackopt) → {Dynamic}

Gets the number value at path of object. Calls rodash.get with the isNumber validator function.

Parameters:
Name Type Attributes Default Description
aa Object

Object to drill down into.

keyPath String

A dot notation based string to the expected value.

fallback Number <optional>
0

A return fallback value if the requested field could not be found or did not pass the validator function.

Since:
  • 0.0.25

View Source rodash.brs, line 855

The result of the drill down process

Dynamic
Example
rodash.getNumber({a: {b: {c: 3}}}, 'a.b.c') ' => 3
rodash.getNumber({a: {b: {c: 3}}}, 'a.b.d') ' => 0
rodash.getNumber({a: {b: {c: 3}}}, 'a.b.c') ' => 3
rodash.getNumber({a: {b: {c: 3}}}, 'a.b.d', 25) ' => 25

# getSeconds(asLocalopt) → {Integer}

Gets the seconds.

Parameters:
Name Type Attributes Default Description
asLocal Boolean <optional>
false

Whether to get the local seconds. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 865

The seconds.

Integer

# getString(aa, keyPath, fallbackopt) → {String}

Gets the String value at path of object. Calls rodash.get with the isString validator function.

Parameters:
Name Type Attributes Default Description
aa Object

Object to drill down into.

keyPath String

A dot notation based string to the expected value.

fallback String <optional>
""

A return fallback value if the requested field could not be found or did not pass the validator function.

Since:
  • 0.0.25

View Source rodash.brs, line 882

The result of the drill down process

String
Example
rodash.getString({a: {b: {c: 'hello'}}}, 'a.b.c') ' => 'hello'
rodash.getString({a: {b: {c: 3}}}, 'a.b.d') ' => ''
rodash.getString({a: {b: {c: 3}}}, 'a.b.c') ' => ''
rodash.getString({a: {b: {c: 3}}}, 'a.b.d', 'fallback') ' => 'fallback'

# getYear(asLocalopt) → {Integer}

Gets the year.

Parameters:
Name Type Attributes Default Description
asLocal Boolean <optional>
false

Whether to get the local year. Default is false.

Since:
  • 0.0.21

View Source rodash.brs, line 892

The year.

Integer

# groupBy(collection, iterateeopt) → {Object}

Creates an object composed of keys generated from the results of running each element of collection thru iteratee. The order of grouped values is determined by the order they occur in collection. The corresponding value of each key is an array of elements responsible for generating the key. The iteratee is invoked with one argument: (value).

Parameters:
Name Type Attributes Default Description
collection Object

The collection to iterate over.

iteratee function | String <optional>
Invalid

The iteratee to transform keys.

Since:
  • 0.0.23

View Source rodash.brs, line 903

Returns the composed aggregate object.

Object

# gt(value, other) → {dynamic}

Checks if value is greater than other.

Parameters:
Name Type Description
value Dynamic

The value to compare.

other Dynamic

The other value to compare.

Since:
  • 0.0.21

View Source rodash.brs, line 918

  • Returns true if value is greater than other, else false.
dynamic
Example
rodash.gt(3, 1) ' => true
rodash.gt(3, 3) ' => false
rodash.gt(1, 3) ' => false

# gte(value, other) → {dynamic}

Checks if value is greater than or equal to other.

Parameters:
Name Type Description
value Dynamic

The value to compare.

other Dynamic

The other value to compare.

Since:
  • 0.0.21

View Source rodash.brs, line 933

  • Returns true if value is greater than or equal to other, else false.
dynamic
Example
rodash.gte(3, 1) ' => true
rodash.gte(3, 3) ' => true
rodash.gte(1, 3) ' => false

# hasKeys(aaValue, keys) → {Boolean}

Checks if first level of the supplied AssociativeArray contains the Array of key strings.

Parameters:
Name Type Description
aaValue Dynamic

AssociativeArray to be checked

keys Array

Array of key strings

Since:
  • 0.0.21

View Source rodash.brs, line 949

  • Returns true if first level of the supplied AssociativeArray contains the Array of key strings, else false.
Boolean
Example
rodash.hasKeys({a: 1, b: 2, c: 3}, ["a", "b"]) ' => true
rodash.hasKeys({a: 1, b: 2, c: 3}, ["a", "d"]) ' => false
rodash.hasKeys({a: 1, b: 2, c: 3}, ["a", "b", "c"]) ' => true
rodash.hasKeys([1,2,3], ["a", "b", "d"]) ' => false

Gets the first element of array.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to query

Since:
  • 0.0.21

View Source rodash.brs, line 961

Returns the first element of array

Dynamic
Example
rodash.head([1, 2, 3]) // => 1

# inRange(number, startPosopt, endPosopt) → {dynamic}

Checks if number is between start and up to, but not including, end. If end is not specified, it's set to start with start then set to 0.

Parameters:
Name Type Attributes Default Description
number Number

The number to check.

startPos Number <optional>
0

The start of the range.

endPos Number <optional>
invalid

The end of the range.

Since:
  • 0.0.21

View Source rodash.brs, line 973

  • Returns true if number is in the range, else false.
dynamic

# indexOf(arrayopt, valueopt, fromIndexopt) → {dynamic}

Gets the index at which the first occurrence of value is found in array using SameValueZero for equality comparisons. If fromIndex is negative, it's used as the offset from the end of array.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to inspect

value Dynamic <optional>
Invalid

The value to search for

fromIndex Integer <optional>
Invalid

The index to search from

Since:
  • 0.0.21

View Source rodash.brs, line 985

Returns the index of the matched value, else -1

dynamic

# initial(arrayopt) → {dynamic}

Gets all but the last element of array.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to query

Since:
  • 0.0.21

View Source rodash.brs, line 995

Returns the slice of array

dynamic

# intersection(inspect, mainArrayopt, inspectArrayopt) → {Object}

Creates an array of unique values that are included in all given arrays using SameValueZero for equality comparisons. The order and references of result values are determined by the first array.

Parameters:
Name Type Attributes Default Description
inspect Array

The array to find matches

mainArray Array <optional>
CreateObject("roArray", 0, true)

The main array to inspect

inspectArray Object <optional>
CreateObject("roArray", 0, true)
Since:
  • 0.0.21

View Source rodash.brs, line 1149

Returns the new array of intersecting values

Object

# intersectionBy(inspect, mainArrayopt, inspectArrayopt, iterateeopt) → {Object}

This method is like rodash.intersection except that it accepts iteratee which is invoked for each element of each arrays to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument:(value).

Parameters:
Name Type Attributes Default Description
inspect Array

The array to find matches

mainArray Array <optional>
CreateObject("roArray", 0, true)

The main array to inspect

inspectArray Object <optional>
CreateObject("roArray", 0, true)
iteratee Dynamic <optional>
Invalid

The iteratee invoked per element

Since:
  • 0.0.21

View Source rodash.brs, line 1162

Returns the new array of intersecting values

Object

# intersectionWith(inspect, mainArrayopt, inspectArrayopt, comparatoropt) → {Object}

This method is like rodash.intersection except that it accepts comparator which is invoked to compare elements of arrays. The order and references of result values are determined by the first array. The comparator is invoked with two arguments: (arrVal, othVal).

Parameters:
Name Type Attributes Default Description
inspect Array

The array to find matches

mainArray Array <optional>
CreateObject("roArray", 0, true)

The main array to inspect

inspectArray Object <optional>
CreateObject("roArray", 0, true)
comparator Dynamic <optional>
Invalid

The comparator invoked per element

Since:
  • 0.0.21

View Source rodash.brs, line 1175

Returns the new array of intersecting values

Object

# invert(object, originalAA) → {Dynamic}

Creates an object composed of the inverted keys and values of object. If object contains duplicate values, subsequent values overwrite property assignments of previous values. As AssocArrays are sorted, the order of the aa keys is not preserved.

Parameters:
Name Type Description
object Object

The object to invert.

originalAA Object
Since:
  • 0.0.22

View Source rodash.brs, line 1193

Returns the new inverted object.

Dynamic
Example
const object = { 'a': 1, 'b': 2, 'c': 1 }
rodash.invert(object)
// { '1': 'c', '2': 'b' }

# isAA(value) → {Boolean}

Checks if the supplied value is a valid AssociativeArray type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1206

Results of the check

Boolean
Example
rodash.isAA({}) // => true
rodash.isAA([]) // => false

# isAppMemoryMonitorEvent(value) → {Boolean}

Checks if the supplied value is a roAppMemoryMonitorEvent type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.26

View Source rodash.brs, line 1216

Results of the check

Boolean

# isArray(value) → {Boolean}

Checks if the supplied value is a valid Array type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1230

Results of the check

Boolean
Example
rodash.isArray([]) // => true
rodash.isArray({}) // => false
rodash.isArray("") // => false

# isArrayLike(value) → {Boolean}

Checks if value is array-like. A value is considered array-like if it is an array, roList, roByteArray, or roXMLList

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1247

Results of the check

Boolean
Example
rodash.isArrayLike([]) // => true
rodash.isArrayLike(CreateObject("roList")) // => true
rodash.isArrayLike(CreateObject("roByteArray")) // => true
rodash.isArrayLike(CreateObject("roXMLList")) // => true
rodash.isArrayLike({}) // => false
rodash.isArrayLike("example string") // => false

# isBoolean(value) → {Boolean}

Checks if the supplied value is a valid Boolean type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1262

Results of the check

Boolean
Example
rodash.isBoolean(true) // => true
rodash.isBoolean(false) // => true
rodash.isBoolean(1) // => false
rodash.isBoolean("true") // => false

# isByteArray(value) → {dynamic}

Checks if the supplied value is a valid ByteArray type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1272

Results of the check

dynamic

# isDate(value) → {Boolean}

Alias to isDate function

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1282

Results of the check

Boolean

# isDateTime(value) → {Boolean}

Checks if the supplied value is a valid date time type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1292

Results of the check

Boolean

# isDeviceInfoEvent(value) → {Boolean}

Checks if the supplied value is a roDeviceInfo type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.26

View Source rodash.brs, line 1302

Results of the check

Boolean

# isDouble(value) → {Boolean}

Checks if the supplied value is a valid Double type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1316

Results of the check

Boolean
Example
rodash.isDouble(1) // => false
rodash.isDouble(1.0#) // => true
rodash.isDouble(1.0!) // => false

# isElement(value, subTypeopt) → {Boolean}

Alias to isNode function

Parameters:
Name Type Attributes Default Description
value Dynamic

The variable to be checked

subType String <optional>
""

An optional subType parameter to further refine the check

Since:
  • 0.0.21

View Source rodash.brs, line 1327

Results of the check

Boolean

# isEmpty(value) → {dynamic}

Checks if a value is empty.

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1345

Results of the check

dynamic
Example
rodash.isEmpty("") // => true
rodash.isEmpty([]) // => true
rodash.isEmpty({}) // => true
rodash.isEmpty(0) // => true
rodash.isEmpty(false) // => true
rodash.isEmpty(invalid) // => true
rodash.isEmpty("Hello") // => false

# isEmptyString(value) → {Boolean}

Checks if the supplied value is a valid String type and is not empty

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1359

Results of the check

Boolean
Example
rodash.isEmptyString("") // => true
rodash.isEmptyString(" ") // => false
rodash.isEmptyString("Hello") // => false

# isEqual(valueOne, valueTwo, strictopt) → {Boolean}

Checks if the supplied values are the same. By default, when comparing arrays and associative arrays the function will compare the values on the elements. If the strict parameter is set to true, the function will compare the references of the elements.

Parameters:
Name Type Attributes Default Description
valueOne Dynamic

First value.

valueTwo Dynamic

Second value.

strict Boolean <optional>
false
Since:
  • 0.0.21

View Source rodash.brs, line 1381

True if the values are the same and false if not or if any of the values are a type that could not be compared.

Boolean
Example
rodash.isEqual(1, 1) // => true
rodash.isEqual(1, 2) // => false
rodash.isEqual([], []) // => true
rodash.isEqual({}, {}) // => true
rodash.isEqual({a: 1}, {a: 1}) // => true
rodash.isEqual({a: 1}, {a: 2}) // => false
rodash.isEqual("Hello", "Hello") // => true
rodash.isEqual("Hello", "World") // => false

# isEqualWith(valueOne, valueTwo, customizeropt) → {Boolean}

Checks if the supplied values are the same.

Parameters:
Name Type Attributes Default Description
valueOne Dynamic

First value.

valueTwo Dynamic

Second value.

customizer dynamic <optional>
Invalid
Since:
  • 0.0.21

View Source rodash.brs, line 1393

True if the values are the same and false if not or if any of the values are a type that could not be compared.

Boolean

# isError(value) → {Boolean}

Assesses the passed object to determine if it is an Error Object. TODO: MORE SUPPORT - TRY/CATCH?

Parameters:
Name Type Description
value Dynamic

the object to assess

Since:
  • 0.0.21

View Source rodash.brs, line 1404

True if the object represents and error.

Boolean

# isFinite(value) → {boolean}

Checks if value is a finite primitive number.

Parameters:
Name Type Description
value dynamic
Since:
  • 0.0.21

View Source rodash.brs, line 1414

boolean

# isFloat(value) → {Boolean}

Checks if the supplied value is a valid Float type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1428

Results of the check

Boolean
Example
rodash.isFloat(1) // => false
rodash.isFloat(1.0!) // => true
rodash.isFloat(1.0#) // => false

# isFunction(value) → {Boolean}

Checks if the supplied value is a valid Function type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1438

Results of the check

Boolean

# isInputEvent(value) → {Boolean}

Checks if the supplied value is a roInputEvent type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.26

View Source rodash.brs, line 1448

Results of the check

Boolean

# isInteger(value) → {Boolean}

Checks if the supplied value is a valid Integer type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1458

Results of the check

Boolean

# isInvalid(value) → {Boolean}

Checks if the supplied value is Invalid

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1472

Results of the check

Boolean
Example
rodash.isInvalid(Invalid) // => true
rodash.isInvalid(undefined) // => true
rodash.isInvalid("") // => false

# isLength(value) → {Boolean}

Checks if value is a valid array-like length

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1482

Results of the check

Boolean

# isList(value) → {Boolean}

Checks if the supplied value is a valid roList type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.36

View Source rodash.brs, line 1497

Results of the check

Boolean
Example
rodash.isList(CreateObject("roList")) // => true
rodash.isList([]) // => false
rodash.isList({}) // => false
rodash.isList("") // => false

# isMap(value) → {Boolean}

Alias to isArray function

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1510

Results of the check

Boolean
Example
rodash.isMap([]) // => true
rodash.isMap({}) // => false

# isMessagePort(value) → {Boolean}

Checks if the supplied value is a roMessagePort type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.26

View Source rodash.brs, line 1520

Results of the check

Boolean

# isNaN(value) → {Boolean}

Method determines whether the passed value is NaN and its type is a valid number

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1530

Results of the check

Boolean

# isNode(value, subTypeopt) → {Boolean}

Checks if the supplied value is a valid Node type

Parameters:
Name Type Attributes Default Description
value Dynamic

The variable to be checked

subType String <optional>
""

An optional subType parameter to further refine the check

Since:
  • 0.0.21

View Source rodash.brs, line 1541

Results of the check

Boolean

# isNodeEvent(value) → {Boolean}

Checks if the supplied value is a valid roSGNodeEvent type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.26

View Source rodash.brs, line 1551

Results of the check

Boolean

# isNodeWithChildren(value, subTypeopt) → {Boolean}

Checks if the supplied value is a valid roUrlEvent type

Parameters:
Name Type Attributes Default Description
value Dynamic

The variable to be checked

subType String <optional>
""

An optional subType parameter to further refine the check

Since:
  • 0.0.26

View Source rodash.brs, line 1562

Results of the check

Boolean

# isNonEmptyAA(value) → {dynamic}

Checks if the supplied value is a valid and populated AssociativeArray type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1572

Results of the check

dynamic

# isNonEmptyArray(value) → {Boolean}

Checks if the supplied value is a valid Array type and not empty

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1582

Results of the check

Boolean

# isNonEmptyString(value) → {Boolean}

Checks if the supplied value is a valid String type and is not empty

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1592

Results of the check

Boolean

# isNotInvalid(value) → {Boolean}

Checks if the supplied value is not Invalid or uninitialized

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1602

Results of the check

Boolean

# isNull(value) → {Boolean}

Alias to isInvalid function

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1612

Results of the check

Boolean

# isNumber(value) → {Boolean}

Checks if the supplied value is a valid number type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1622

Results of the check

Boolean

# isString(value) → {dynamic}

Checks if the supplied value is a valid String type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.21

View Source rodash.brs, line 1632

Results of the check

dynamic

# isUrlEvent(value) → {Boolean}

Checks if the supplied value is a valid roUrlEvent type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.26

View Source rodash.brs, line 1642

Results of the check

Boolean

# isUrlTransfer(value) → {Boolean}

Checks if the supplied value is a valid url transfer type

Parameters:
Name Type Description
value Dynamic

The variable to be checked

Since:
  • 0.0.26

View Source rodash.brs, line 1652

Results of the check

Boolean

# join(arrayopt, separatoropt) → {dynamic}

Converts all elements in array into a string separated by separator.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to convert

separator String <optional>
""

The element separator

Since:
  • 0.0.21

View Source rodash.brs, line 1663

Returns the joined string

dynamic

# kebabCase(valueopt) → {dynamic}

Converts a string to kebab case.

Parameters:
Name Type Attributes Default Description
value string <optional>
""
Since:
  • 0.0.21

View Source rodash.brs, line 1673

dynamic

# keyBy(collectionopt, keyopt) → {object}

Creates an object composed of keys generated from the results of running each element of collection thru iteratee. The corresponding value of each key is the last element responsible for generating the key. The iteratee is invoked with one argument: (value).

Parameters:
Name Type Attributes Default Description
collection Dynamic <optional>
invalid

The collection to sample

key String <optional>
""

The iteratee to transform keys.

Since:
  • 0.0.24

View Source rodash.brs, line 1684

  • Returns the composed aggregate object.
object

# last(arrayopt) → {Dynamic}

Gets the last element of array.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to query

Since:
  • 0.0.21

View Source rodash.brs, line 1694

Returns the last element of array

Dynamic

# lastIndexOf(arrayopt, valueopt, fromIndexopt) → {Dynamic}

This method is like rodash.indexOf except that it iterates over elements of array from right to left.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to query

value Dynamic <optional>
Invalid

The value to search for

fromIndex Integer <optional>
Invalid

The index to search from

Since:
  • 0.0.23

View Source rodash.brs, line 1706

Returns the index of the matched value, else -1

Dynamic

# lowerCase(valueopt) → {dynamic}

Converts a string to lower case.

Parameters:
Name Type Attributes Default Description
value string <optional>
""
Since:
  • 0.0.21

View Source rodash.brs, line 1716

dynamic

# lowerFirst(valueopt) → {dynamic}

Converts the first character of string to lower case.

Parameters:
Name Type Attributes Default Description
value string <optional>
""
Since:
  • 0.0.21

View Source rodash.brs, line 1726

dynamic

# lt(value, other) → {dynamic}

Checks if value is less than other.

Parameters:
Name Type Description
value Dynamic

The value to compare.

other Dynamic

The other value to compare.

Since:
  • 0.0.21

View Source rodash.brs, line 1737

  • Returns true if the value is less than other, else false.
dynamic

# lte(value, other) → {dynamic}

Checks if value is less than or equal to other.

Parameters:
Name Type Description
value Dynamic

The value to compare.

other Dynamic

The other value to compare.

Since:
  • 0.0.21

View Source rodash.brs, line 1748

  • Returns true if the value is less than or equal to other, else false.
dynamic

# map(collectionopt, iterateeopt) → {dynamic}

Creates an array of values by running each element in collection thru iteratee. The iteratee is invoked with three arguments:(value, index|key, collection)

Parameters:
Name Type Attributes Default Description
collection Dynamic <optional>
CreateObject("roAssociativeArray")

The collection to iterate over

iteratee Dynamic <optional>
Invalid

The function invoked per iteration

Since:
  • 0.0.21

View Source rodash.brs, line 1761

Returns the new mapped array

dynamic
Example
rodash.map([4, 8], rodash.square) // => [16, 64]

# max(arrayopt) → {Dynamic}

Computes the maximum value of array. If array is empty or falsey, invalid is returned.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to iterate over

Since:
  • 0.0.21

View Source rodash.brs, line 1773

Returns the maximum value

Dynamic
Example
rodash.max([4, 2, 8, 6]) // => 8

# maxBy(arrayopt, iterateeopt) → {Dynamic}

Computes the maximum value of array. If array is empty or falsey, invalid is returned.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to iterate over

iteratee dynamic <optional>
Invalid
Since:
  • 0.0.21

View Source rodash.brs, line 1784

Returns the maximum value

Dynamic

# mean(array) → {dynamic}

Computes the mean of the values in array.

Parameters:
Name Type Description
array Array

The array to iterate over

Since:
  • 0.0.21

View Source rodash.brs, line 1796

Returns the mean value

dynamic
Example
rodash.mean([4, 2, 8, 6]) // => 5

# meanBy(array, iterateeopt) → {dynamic}

This method is like rodash.mean except that it accepts iteratee which is invoked for each element in array to generate the value to be averaged. The iteratee is invoked with one argument: (value).

Parameters:
Name Type Attributes Default Description
array Array

The array to iterate over

iteratee function <optional>
Invalid

The iteratee invoked per element

Since:
  • 0.0.21

View Source rodash.brs, line 1807

Returns the mean value

dynamic

# merge(source, target, sources) → {Object}

This method is like rodash.assign except that it recursively merges own and inherited enumerable string keyed properties of source objects into the destination object. Source properties that resolve to undefined are skipped if a destination value exists. Array and plain object properties are merged recursively. Other objects and value types are overridden by assignment. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.

Parameters:
Name Type Description
source Dynamic

The source object to merge from

target Dynamic

The target object to merge into

sources Object
Since:
  • 0.0.33

View Source rodash.brs, line 1825

Returns the merged object

Object
Example
rodash.merge({a:1}, {b:2}) // => {a:1, b:2}
rodash.merge({a:1}, {a:2}) // => {a:2}
rodash.merge({a:1}, {a:{b:2}}) // => {a:{b:2}}
rodash.merge({a:{b:1}}, {a:{c:2}}) // => {a:{b:1, c:2}}
rodash.merge({a:{b:1}}, [{a:{b:2}}, {a:{c:3}}]) // => {a:{b:2, c:3}}

# min(arrayopt) → {Dynamic}

Computes the minimum value of array. If array is empty or falsey, invalid is returned.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to iterate over

Since:
  • 0.0.21

View Source rodash.brs, line 1835

Returns the minumum value

Dynamic

# minBy(arrayopt, iterateeopt) → {Dynamic}

Computes the minimum value of array. If array is empty or falsey, invalid is returned.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to iterate over

iteratee dynamic <optional>
Invalid
Since:
  • 0.0.21

View Source rodash.brs, line 1846

Returns the maximum value

Dynamic

# multiply(multiplier, multiplicand) → {dynamic}

Multiplies two numbers.

Parameters:
Name Type Description
multiplier Dynamic

The first number in a multiplication.

multiplicand Dynamic

The second number in a multiplication.

Since:
  • 0.0.21

View Source rodash.brs, line 1857

  • Returns the product of the two numbers.
dynamic

# now() → {Integer}

Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC).

Since:
  • 0.0.21

View Source rodash.brs, line 1866

The number of milliseconds that have elapsed since the Unix epoch.

Integer

# omit(object, pathsopt) → {Dynamic}

The opposite of rodash.pick; this method creates an object composed of the own and inherited enumerable property paths of object that are not omitted.

Parameters:
Name Type Attributes Default Description
object Object

The source object.

paths Array <optional>
CreateObject("roArray", 0, true)

The property paths to omit.

Since:
  • 0.0.23

View Source rodash.brs, line 1877

  • Returns the new object.
Dynamic

# orderBy(iterateeopt, collection, iteratees, orders) → {Object}

This method is like sortBy except that it allows specifying the sort orders of the iteratees to sort by. If orders is unspecified, all values are sorted in ascending order. Otherwise, specify an order of "desc" for descending or "asc" for ascending sort order of corresponding values. You may also specify a compare function for an order.

Parameters:
Name Type Attributes Description
iteratee Dynamic <optional>

The iteratees to sort by

collection Dynamic

The collection to shuffle

iteratees dynamic
orders Dynamic

The sort orders of iteratees.

Since:
  • 0.0.21

View Source rodash.brs, line 1894

Returns the new ordered array

Object

# padString(value, padLengthopt, paddingCharacteropt) → {String}

Add padding to the supplied value after converting to a string. For example "1" to "01".

Parameters:
Name Type Attributes Default Description
value String

The value to add padding to.

padLength Integer <optional>
2

The minimum output string length.

paddingCharacter String <optional>
"0"

The string to use as padding.

Since:
  • 0.0.22

View Source rodash.brs, line 1906

Resulting padded string.

String

# paddString(value, padLengthopt, paddingCharacteropt) → {String}

Alias to rodsah.padString

Parameters:
Name Type Attributes Default Description
value Dynamic
padLength Integer <optional>
2
paddingCharacter Dynamic <optional>
"0"
Since:
  • 0.0.21

View Source rodash.brs, line 1918

String

# pick(object, pathsopt) → {Dynamic}

Creates an object composed of the picked object properties.

Parameters:
Name Type Attributes Default Description
object Object

The object to pick from.

paths Array <optional>
CreateObject("roArray", 0, true)

The property paths to pick.

Since:
  • 0.0.23

View Source rodash.brs, line 1929

  • Returns the picked value.
Dynamic

# random(loweropt, upperopt, floatingopt) → {dynamic}

Generates a random number between the lower and upper bounds.

Parameters:
Name Type Attributes Default Description
lower dynamic <optional>
0
upper dynamic <optional>
1
floating boolean <optional>
false
Since:
  • 0.0.21

View Source rodash.brs, line 1941

dynamic

# reduce(collectionopt, iterateeopt, accumulatoropt) → {dynamic}

Reduces collection to a value which is the accumulated result of running each element in collection thru iteratee, where each successive invocation is supplied the return value of the previous. If accumulator is not given, the first element of collection is used as the initial value. The iteratee is invoked with four arguments:(accumulator, value, index|key, collection).

Parameters:
Name Type Attributes Default Description
collection Dynamic <optional>
Invalid

The collection to iterate over

iteratee Dynamic <optional>
Invalid

The function invoked per iteration

accumulator Integer <optional>
Invalid

The initial value

Since:
  • 0.0.21

View Source rodash.brs, line 1953

Returns the accumulated value

dynamic

# removeNode(nodeOrEvent) → {void}

Removes the supplied node from it's parent. Can be set as an observer callback.

Parameters:
Name Type Description
nodeOrEvent roSGNode | roSGNodeEvent

The node or node event to be removed.

Since:
  • 0.0.32

View Source rodash.brs, line 1963

void

# removeNodeChildren(node) → {void}

Removes all children of a node.

Parameters:
Name Type Description
node Object

The node to remove the children of

Since:
  • 0.0.32

View Source rodash.brs, line 1973

void

# round(num, precisionopt) → {Float}

Computes number rounded up to precision.

Parameters:
Name Type Attributes Default Description
num Float

The number to round.

precision Dynamic <optional>
0

The precision to round to.

Since:
  • 0.0.21

View Source rodash.brs, line 1984

  • Returns the rounded number.
Float

# sample(collectionopt) → {dynamic}

Gets a random element from collection.

Parameters:
Name Type Attributes Default Description
collection Dynamic <optional>
invalid

The collection to sample

Since:
  • 0.0.23

View Source rodash.brs, line 1994

  • Returns the random element
dynamic

# sampleSize(collection, n) → {Object}

Gets n random elements at unique keys from collection up to the size of collection.

Parameters:
Name Type Description
collection Dynamic

The collection to sample

n Integer

The number of elements to sample

Since:
  • 0.0.23

View Source rodash.brs, line 2005

  • Returns the random elements.
Object

# set(aa, keyPath, value) → {Boolean}

Used to set a nested String value in the supplied object

Parameters:
Name Type Description
aa Object

Object to drill down into.

keyPath String

A dot notation based string to the expected value.

value Dynamic

The value to be set.

Since:
  • 0.0.21

View Source rodash.brs, line 2017

True if set successfully.

Boolean

# shuffle(collectionopt) → {dynamic}

Creates an array of shuffled values, using a version of the Fisher-Yates shuffle.

Parameters:
Name Type Attributes Default Description
collection Dynamic <optional>
CreateObject("roArray", 0, true)

The collection to shuffle

Since:
  • 0.0.21

View Source rodash.brs, line 2027

Returns the new shuffled array

dynamic

# size(collectionopt) → {dynamic}

Gets the size of collection by returning its length for array-like values or the number of own enumerable string keyed properties for objects.

Parameters:
Name Type Attributes Default Description
collection Dynamic <optional>
Invalid

The collection to inspect

Since:
  • 0.0.21

View Source rodash.brs, line 2037

Returns the collection size.

dynamic

# slice(arrayopt, startPosopt, endPosopt) → {Object}

Creates a slice of array from start up to, but not including, end.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to slice

startPos Integer <optional>
0

The start position

endPos Integer <optional>
-1

The end position

Since:
  • 0.0.21

View Source rodash.brs, line 2049

Returns the slice of array

Object

# sortBy(collectionopt, iterateeopt) → {dynamic}

Creates an array of elements, sorted in ascending order by the results of running each element in a collection thru each iteratee. This method performs a stable sort, that is, it preserves the original sort order of equal elements. The iteratees are invoked with one argument: (value).

Parameters:
Name Type Attributes Default Description
collection Dynamic <optional>
Invalid

The collection to sort

iteratee Dynamic <optional>
Invalid

The iteratees to sort by

Since:
  • 0.0.21

View Source rodash.brs, line 2060

Returns the new sorted array

dynamic

# sortedIndex(arrayopt, valueopt) → {dynamic}

Uses a binary search to determine the lowest index at which value should be inserted into array in order to maintain its sort order.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The sorted array to inspect

value Integer <optional>
0
Since:
  • 0.0.21

View Source rodash.brs, line 2071

Returns the index at which value should be inserted into array

dynamic

# square(value) → {Dynamic}

Computes the square of the value.

Parameters:
Name Type Description
value Integer

The value to multiple by itself

Since:
  • 0.0.30

View Source rodash.brs, line 2081

Returns the square of the value

Dynamic

# stringIncludes(value, subString) → {Boolean}

Check for the existence of a given sub string

Parameters:
Name Type Description
value String

The string to search

subString String

The sub string to search for

Since:
  • 0.0.21

View Source rodash.brs, line 2092

Results of the search

Boolean

# stringIndexOf(value, subString) → {Integer}

Finds the sub string index position

Parameters:
Name Type Description
value String

The string to search

subString String

The sub string to search for

Since:
  • 0.0.21

View Source rodash.brs, line 2103

Results of the search

Integer

# subtract(minuend, subtrahend) → {Dynamic}

Subtract two numbers.

Parameters:
Name Type Description
minuend Integer

The first number in a subtraction

subtrahend Integer

The second number in a subtraction

Since:
  • 0.0.21

View Source rodash.brs, line 2114

Returns the difference.

Dynamic

# sum(array) → {dynamic}

Computes the sum of the values in an array.

Parameters:
Name Type Description
array Array

The array to sum

Since:
  • 0.0.21

View Source rodash.brs, line 2124

Returns the sum of the values in the array

dynamic

# sumBy(arrayopt, iterateeopt) → {Dynamic}

This method is like sum except that it accepts iteratee which is invoked for each element in array to generate the value to be summed. The iteratee is invoked with one argument: (value).

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to iterate over

iteratee function <optional>
Invalid

The iteratee invoked per element

Since:
  • 0.0.21

View Source rodash.brs, line 2136

Returns the sum

Dynamic

# take(arrayopt, nopt) → {Object}

Creates a slice of array with n elements taken from the beginning

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The sorted array to query

n Integer <optional>
Invalid

The number of elements to take

Since:
  • 0.0.21

View Source rodash.brs, line 2147

Returns the slice of array

Object

# takeRight(arrayopt, nopt) → {Object}

Creates a slice of array with n elements taken from the end

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The sorted array to query

n Integer <optional>
Invalid

The number of elements to take

Since:
  • 0.0.21

View Source rodash.brs, line 2158

Returns the slice of array

Object

# times(nopt, iterateeopt) → {Object}

Invokes the iteratee n times, returning an array of the results of each invocation. The iteratee is invoked with one argument; (index).

Parameters:
Name Type Attributes Default Description
n Integer <optional>
0

The number of times to invoke iteratee.

iteratee function <optional>
Invalid

The function invoked per iteration.

Since:
  • 0.0.24

View Source rodash.brs, line 2173

Returns the array of results.

Object
Example
rodash.times(3, rodash.toString) ' => ["0", "1", "2"]
rodash.times(4, rodash.isNumber) ' => [true, true, true, true]
rodash.times(4, rodash.isString) ' => [false, false, false, false]

# toArray(value, input) → {Object}

Attempts to convert the supplied value to a array.

Parameters:
Name Type Description
value Dynamic

The value to convert.

input Dynamic
Since:
  • 0.0.21
To Do:
  • Add more support for other types.

View Source rodash.brs, line 2185

Results of the conversion.

Object

# toISOString(dateObjopt) → {String}

Converts a date object to an ISO string

Parameters:
Name Type Attributes Default Description
dateObj Dynamic <optional>
Invalid
Since:
  • 0.0.21

View Source rodash.brs, line 2195

Returns the date object as an ISO string

String

# toNumber(value) → {Dynamic}

Attempts to convert the supplied value into a valid number

Parameters:
Name Type Description
value Dynamic

The variable to be converted

Since:
  • 0.0.21

View Source rodash.brs, line 2212

Results of the conversion

Dynamic
Example
rodash.toNumber("1") // => 1
rodash.toNumber("1.0") // => 1.0
rodash.toNumber(1) // => 1
rodash.toNumber(1.0#) // => 1.0
rodash.toNumber(true) // => 1
rodash.toNumber(false) // => 0

# toPairs(objopt) → {Object}

Creates an array of own enumerable string keyed-value pairs for object which can be consumed by rodash.fromPairs. If object is a map or set, its entries are returned.

Parameters:
Name Type Attributes Default Description
obj Object <optional>
CreateObject("roAssociativeArray")

The object to query.

Since:
  • 0.0.24

View Source rodash.brs, line 2225

Returns the key-value pairs.

Object
Example
rodash.toPairs({ 'a': 1, 'b': 2 }) // => [['a', 1], ['b', 2]]
rodash.toPairs({ 'a': 1, 'b': 2, 'c': 3 }) // => [['a', 1], ['b', 2], ['c', 3]]

# toString(value) → {String}

Attempts to convert the supplied value to a string.

Parameters:
Name Type Description
value Dynamic

The value to convert.

Since:
  • 0.0.21

View Source rodash.brs, line 2240

Results of the conversion.

String
Example
rodash.toString(1) // => "1"
rodash.toString(1.0#) // => "1.0"
rodash.toString(true) // => "true"
rodash.toString(false) // => "false"

# union(arraysopt) → {Object}

Creates an array of unique values, in order, from all given arrays using SameValueZero for equality comparisons.

Parameters:
Name Type Attributes Default Description
arrays Array <optional>
CreateObject("roArray", 0, true)

The arrays to inspect

Since:
  • 0.0.21

View Source rodash.brs, line 2253

Returns the new array of combined values

Object
Example
rodash.union([[2], [1, 2]]) // => [2, 1]
rodash.union([[2], [1, 2], [2, 3]]) // => [2, 1, 3]

# uniq(arrayopt) → {Object}

Creates a duplicate-free version of an array, using SameValueZero for equality comparisons, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the array.

Parameters:
Name Type Attributes Default Description
array Array <optional>
CreateObject("roArray", 0, true)

The array to inspect

Since:
  • 0.0.21

View Source rodash.brs, line 2263

Returns the new duplicate free array

Object

# xor(array, arrays, strictopt) → {Object}

Creates a duplicate-free version of an array, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the array. By default, when comparing arrays and associative arrays the function will compare the values on the elements. If the strict parameter is set to true, the function will compare the references of the AA and Array elements.

Parameters:
Name Type Attributes Default Description
array Array.<Array>

The arrays to inspect

arrays Object
strict Boolean <optional>
false

If true, the function will compare the references of the AA and Array elements

Since:
  • 0.0.29

View Source rodash.brs, line 2279

Returns the new array of filtered values.

Object
Example
rodash.xor([[2, 1], [2, 3]]) // => [1, 3]
rodash.xor([[2, 1], [2, 3], [2, 3]]) // => [1]

# zip(arraysopt) → {Object}

Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.

Parameters:
Name Type Attributes Default Description
arrays Array <optional>
CreateObject("roArray", 0, true)

The property identifiers

Since:
  • 0.0.21

View Source rodash.brs, line 2289

Returns the new array of grouped elements

Object

# zipObject(array, propsopt, valuesopt) → {Object}

This method is like rodash.fromPairs except that it accepts two arrays, one of property identifiers and one of corresponding values.

Parameters:
Name Type Attributes Default Description
array Array

The property identifiers

props Object <optional>
CreateObject("roArray", 0, true)
values Array <optional>
CreateObject("roArray", 0, true)

The property values

Since:
  • 0.0.21

View Source rodash.brs, line 2301

Returns the new object

Object