-
Notifications
You must be signed in to change notification settings - Fork 1
vitals.until
Method | Section | Alias |
---|---|---|
until | base | |
until.object | base | until.obj |
until.array | base | until.arr |
until.cycle | base | until.time |
A shortcut for iterating over object maps, arrays, or cycles until an end value is returned.
Params
-
end
*
A value that ends the iteration if returned by the iteratee.
-
source
!(Object|function|Array|number|string)=
If the source is defined the iteration will also stop as follows (per source type):
- object source: Ends after all properties are visited.
- array source: Ends after all indexes are visited.
- number source: Ends after the count of cycles equals the source.
- string source: Converted to an array source using one of the following values as the separator (values listed in order of rank):
- `", "`
- `","`
- `"|"`
- `" "`
-
iteratee
function(*=, (string|number)=, (!Object|function)=)
It has the optional params - value, key/index, source. Note this method lazily clones the source based on the iteratee's [length property](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length) (i.e. if you alter the source object within the iteratee ensure to define the iteratee's third param so you can safely assume all references to the source are its original values).
-
thisArg
Object=
If defined the iteratee is bound to this value.
Returns boolean
This method will return true if the iteratee returns the end value or false if the iteratee does not.
A shortcut for iterating over object maps until an end value is returned or all properties are visited.
Params
-
end
*
A value that ends the iteration if returned by the iteratee.
-
obj
(!Object|function)
-
iteratee
function(*=, string=, (!Object|function)=)
The iteratee must be a function with the optional params - value, key, source. Note this method lazily clones the source based on the iteratee's [length property](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length) (i.e. if you alter the source object within the iteratee ensure to define the iteratee's third param so you can safely assume all references to the source are its original values).
-
thisArg
Object=
Returns boolean
If the iteration is terminated by the end value this method will return true. Otherwise if all the properties are visited this method will return false.
A shortcut for iterating over array-like objects until an end value is returned or all indexed values are visited.
Params
-
end
*
A value that ends the iteration if returned by the iteratee.
-
source
(!Object|function|string)
If source is a string it is converted to an array source using one of the following values as the separator (values listed in order of rank):
- `", "`
- `","`
- `"|"`
- `" "`
-
iteratee
function(*=, number=, !Array=)
The iteratee must be a function with the optional params - value, index, source. Note this method lazily slices (see [vitals.copy.array](https://github.com/imaginate/vitals/wiki/vitals.copy#copyarray)) the source based on the iteratee's [length property](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length) (i.e. if you alter the source object within the iteratee ensure to define the iteratee's third param so you can safely assume all references to the source are its original values).
-
thisArg
Object=
Returns boolean
If the iteration is terminated by the end value this method will return true. Otherwise if all the indexed values are visited this method will return false.
A shortcut for invoking an action until an end value is returned or the number of cycles is reached.
Params
-
end
*
A value that ends the iteration if returned by the iteratee.
-
count
number
The number of cycles.
-
action
function(number=)
-
thisArg
Object=
Returns boolean
If the iteration is terminated by the end value this method will return true. Otherwise if the number of cycles is reached this method will return false.
-- Happy Developing,