editMetadata function & some jsdoc
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import { organizeWaitOperations } from "./organizeWaitOperations.js";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} operations
|
||||
* @param {*} input
|
||||
* @param {import('./functions.js')} Functions
|
||||
* @returns
|
||||
*/
|
||||
export async function * traverseOperations(operations, input, Functions) {
|
||||
const waitOperations = organizeWaitOperations(operations);
|
||||
let results = [];
|
||||
@@ -90,6 +97,12 @@ export async function * traverseOperations(operations, input, Functions) {
|
||||
input = splits;
|
||||
});
|
||||
break;
|
||||
case "editMetadata":
|
||||
yield* nToN(input, operation, async (input) => {
|
||||
input.fileName += "_metadataEdited";
|
||||
input.buffer = await Functions.editMetadata(input.buffer, operation.values["metadata"]);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
throw new Error(`${operation.type} not implemented yet.`);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user