@orbit/utils
Interfaces​
Type aliases​
RequireProperty​
Ƭ RequireProperty<T, K>: Required<Pick<T, K>> & Omit<T, K>
A type to narrow an interface by requiring a specific property or properties that are optional in the base interface.
Type parameters​
| Name | Type |
|---|---|
T | T |
K | extends keyof T |
Defined in​
Functions​
camelize​
â–¸ camelize(str): string
Convert underscored, dasherized, or space-delimited words into lowerCamelCase.
deprecated since v0.17
Parameters​
| Name | Type |
|---|---|
str | string |
Returns​
string
Defined in​
capitalize​
â–¸ capitalize(str): string
Uppercase the first letter of a string, but don't change the remainder.
deprecated since v0.17
Parameters​
| Name | Type |
|---|---|
str | string |
Returns​
string
Defined in​
clone​
â–¸ clone(obj): any
Clones a value. If the value is an object, a deeply nested clone will be created.
Traverses all object properties (but not prototype properties).
Parameters​
| Name | Type |
|---|---|
obj | any |
Returns​
any
Defined in​
dasherize​
â–¸ dasherize(str): string
Dasherize words that are underscored, space-delimited, or camelCased.
deprecated since v0.17
Parameters​
| Name | Type |
|---|---|
str | string |
Returns​
string
Defined in​
decamelize​
â–¸ decamelize(str): string
Converts a camelized string into all lowercase separated by underscores.
deprecated since v0.17
Parameters​
| Name | Type |
|---|---|
str | string |
Returns​
string
Defined in​
deepGet​
â–¸ deepGet(obj, path): any
Retrieves a value from a nested path on an object.
Returns any falsy value encountered while traversing the path.
Parameters​
| Name | Type |
|---|---|
obj | any |
path | string[] |
Returns​
any
Defined in​
deepMerge​
â–¸ deepMerge(object, ...sources): any
Merges properties from other objects into a base object, traversing and merging any objects that are encountered.
Properties that resolve to undefined will not overwrite properties on the
base object that already exist.
Parameters​
| Name | Type |
|---|---|
object | any |
...sources | any[] |
Returns​
any
Defined in​
deepSet​
â–¸ deepSet(obj, path, value): boolean
Sets a value on an object at a nested path.
This function will create objects along the path if necessary to allow setting a deeply nested value.
Returns false only if the current value is already strictly equal to the
requested value argument. Otherwise returns true.
Parameters​
| Name | Type |
|---|---|
obj | any |
path | string[] |
value | any |
Returns​
boolean
Defined in​
eq​
â–¸ eq(a, b): boolean
eq checks the equality of two objects.
The properties belonging to objects (but not their prototypes) will be traversed deeply and compared.
Includes special handling for strings, numbers, dates, booleans, regexes, and arrays
Parameters​
| Name | Type |
|---|---|
a | any |
b | any |
Returns​
boolean
Defined in​
every​
â–¸ every(array, predicate): boolean
Like the Lodash _.every function, this function takes an array and a predicate function and returns true or false depending on whether the predicate is true for every item in the array.
Parameters​
| Name | Type |
|---|---|
array | any[] |
predicate | (member: any, index: number) => boolean |
Returns​
boolean
Defined in​
expose​
â–¸ expose(destination, source): void
Expose properties and methods from one object on another.
Methods will be called on source and will maintain source as the context.
deprecated since v0.17
Parameters​
| Name | Type |
|---|