first commit

This commit is contained in:
2025-10-26 23:10:15 +08:00
commit 8f0345b7be
14961 changed files with 2356381 additions and 0 deletions

25
node_modules/n8n-workflow/dist/esm/result.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
import { ensureError } from './errors';
export const createResultOk = (data) => ({
ok: true,
result: data,
});
export const createResultError = (error) => ({
ok: false,
error,
});
/**
* Executes the given function and converts it to a Result object.
*
* @example
* const result = toResult(() => fs.writeFileSync('file.txt', 'Hello, World!'));
*/
export const toResult = (fn) => {
try {
return createResultOk(fn());
}
catch (e) {
const error = ensureError(e);
return createResultError(error);
}
};
//# sourceMappingURL=result.js.map