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
Inspect the jsdocs for all functions in packages/common and make sure they align with what the function is suppose to do.
Add examples with captions for functions that returns {Operation}
Suggestions
Improvements suggestion for each() function
/**
* Scopes an array of data based on a JSONPath, a function, or an object.
* Useful when the source data has `n` items you would like to map to
* an operation.
* The operation will receive a slice of the data based on each item
* of the JSONPath, function result, or the provided object.
*
* Note: It's the responsibility of the provided operation to ensure that
* the results make their way back into the state's references.
*
* It should be designed to handle each item in the scoped data.
* The Promise resolves after applying the operation on each item in the scoped data.
* @public
* @example <caption>Using JSONPath referencing a point in `state`</caption>
* each("$.data.users[*]",
* create("SObject",
* field("FirstName", sourceValue("$.firstName"))
* )
* )
*
* @example <caption>Using a function to be called with `state`</caption>
* each(state=> state.data.users,
* create("SObject",
* field("FirstName", sourceValue("$.firstName"))
* )
* )
* @example <caption>Using an Object Literal of the data itself.</caption>
* each(dataValue('users'),
* create("SObject",
* field("FirstName", sourceValue("$.firstName"))
* )
* )
*
* @function
*
* @param {String|Function|Object} dataSource - JSONPath referencing a point in `state`, a function that takes state and returns an array of data, or an object representing data itself.
* - If a string, it represents a JSONPath pointing to a location in the `state` object.
* - If a function, it should take the `state` as an argument and return an array of data.
* - If an object, it returns an Object Literal of the data itself.
*
* @param {Function} operation - The operation that takes `state` and returns a modified `state`.
*
* @returns {Operation}
*/
export function each(dataSource, operation) {// Implementation of the function goes here }
The text was updated successfully, but these errors were encountered:
Description
Inspect the jsdocs for all functions in
packages/common
and make sure they align with what the function is suppose to do.Add examples with captions for functions that
returns {Operation}
Suggestions
Improvements suggestion for each() function
The text was updated successfully, but these errors were encountered: