You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This page documents the methods and functions available in this package, given that variable core refers to require('@grakkit/core').
core.array(object: any)
Returns: <any[]>
Converts Java Iterables, Java Iterators, and Java Spliterators into JavaScript Arrays. If a JavaScript array is passed, a clone is created and returned. If none of the above is passed, returns null.
base is any value. modifier is a function with 2 arguments -- input is a value, which refers to base the first time modifier is called, and callback is a function which takes a new value and passes it back through modifier as well as a new callback.
Example: Log all properties of an object recursively
// test variableconsttest={a: 'b',c: 'd',e: ['f','g',{h: 'i',j: 'k',l: 'm'}]};// top-level callcore.chain(test,(input,callback)=>{if(typeofinput==='object'){// pass properties back into modifierif(typeofinput[Symbol.iterator]==='function'){for(constvalueofinput)callback(value);}else{for(constvalueofObject.values(input))callback(value);}}else{// log non-object input to consoleconsole.log(input);}});
core.data(path: string, ...more: string[])
Returns: <any>
Does a very epic thing (need to write description)