Various set operations in the CommonJS model
transform(oldToNewMap, toChange [, generateNext])
setops with an array of existing values.
oldToNewMapis an object where the keys exist in the 'existing values' data set.
toChangeis a function that will be called with the old value and the new value.
generateNextis an optional function that will be called in the event of a circular reference:
2is already in the existing data set. The
generateNextfunction will be called to change the
2value to something not in the existing data set so that the
2conversion can happen. By default, it will add 1 to the max value in the existing (or target) data set.
diff(targetData [, cbs])
setops with an array of existing values
targetDatais an array of new values
cbsis an optional parameter: it is an object with three function/callback properties that will be executed for every operation that needs to be performed:
toLeave. If not provided, the functions defined in this object will just return the values passed in.
toLeave. Each item in these arrays is the returned value of the callback functions. For example, if the operations necessary to convert the existing data set into the target data set were to add the values
cbs.toAddcallback function will be called with each of those values, and those outputs will be the resulting