Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
persist: function(item) {
// workaround for saving changesets that contain fragments
// firstly commit the changes down onto the object if
// its a changeset, then save as a normal object
if (isChangeset(item)) {
item.execute();
item = item.data;
}
return item.save();
},
remove: function(obj) {
persist(item) {
// workaround for saving changesets that contain fragments
// firstly commit the changes down onto the object if
// its a changeset, then save as a normal object
if (isChangeset(item)) {
item.execute();
item = item.data;
}
return item.save();
}
export function changesetSet([obj, path]) {
if (isChangeset(obj)) {
return value => {
return obj.set(path, value);
}
}
}