[react] feat: Added docs for components/Editor
This commit is contained in:
parent
7058843534
commit
f8a987e3d5
6 changed files with 27 additions and 34 deletions
|
@ -320,7 +320,7 @@ export function initialEditorState(preload = {}, config) {
|
|||
return initial
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* round a value to the correct number of decimal places to display all supplied digits after multiplication
|
||||
* this is a workaround for floating point errors
|
||||
* examples:
|
||||
|
@ -746,25 +746,6 @@ export function noop() {
|
|||
export function notEmpty(value) {
|
||||
return String(value).length > 0
|
||||
}
|
||||
/**
|
||||
* Helper method to merge arrays of translation namespaces
|
||||
*
|
||||
* Note that this method is variadic
|
||||
*
|
||||
* @param {[string]} namespaces - A string or array of strings of namespaces
|
||||
* @return {[string]} namespaces - A merged array of all namespaces
|
||||
*/
|
||||
export function nsMerge(...args) {
|
||||
const ns = new Set()
|
||||
for (const arg of args) {
|
||||
if (typeof arg === 'string') ns.add(arg)
|
||||
else if (Array.isArray(arg)) {
|
||||
for (const el of nsMerge(...arg)) ns.add(el)
|
||||
}
|
||||
}
|
||||
|
||||
return [...ns]
|
||||
}
|
||||
|
||||
/*
|
||||
* A translation fallback method in case none is passed in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue