mirror of
https://github.com/status-im/consul.git
synced 2025-02-13 22:26:35 +00:00
* ui: Correct some meta info * Encoder doesn't take an argument whereas decoder does * Math.trunc looks like the closest to parseInt but using the correct type * use a dynamic string when setting things on window
13 lines
423 B
JavaScript
13 lines
423 B
JavaScript
/**
|
|
* Turns a separated path or 'key name' in this case to
|
|
* an array. If the key name is simply the separator (for example '/')
|
|
* then the array should contain a single empty string value
|
|
*
|
|
* @param {String} key - The separated path/key
|
|
* @param {String} separator - The separator
|
|
* @returns {String[]}
|
|
*/
|
|
export default function(key, separator = '/') {
|
|
return (key === separator ? '' : key).split(separator);
|
|
}
|