mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Replace promisify-d node calls with native promises (no-changelog) (#8464)
This commit is contained in:
committed by
GitHub
parent
238b54c77b
commit
5cb55270b7
@@ -1,6 +1,5 @@
|
||||
import { parse as pathParse } from 'path';
|
||||
import { writeFile as fsWriteFile } from 'fs';
|
||||
import { promisify } from 'util';
|
||||
import { writeFile as fsWriteFile } from 'fs/promises';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
@@ -14,7 +13,6 @@ import type {
|
||||
import { deepCopy } from 'n8n-workflow';
|
||||
import gm from 'gm';
|
||||
import { file } from 'tmp-promise';
|
||||
const fsWriteFileAsync = promisify(fsWriteFile);
|
||||
import getSystemFonts from 'get-system-fonts';
|
||||
|
||||
const nodeOperations: INodePropertyOptions[] = [
|
||||
@@ -1117,9 +1115,9 @@ export class EditImage implements INodeType {
|
||||
binaryPropertyName,
|
||||
);
|
||||
|
||||
const { fd, path, cleanup } = await file();
|
||||
const { path, cleanup } = await file();
|
||||
cleanupFunctions.push(cleanup);
|
||||
await fsWriteFileAsync(fd, binaryDataBuffer);
|
||||
await fsWriteFile(path, binaryDataBuffer);
|
||||
|
||||
if (operations[0].operation === 'create') {
|
||||
// It seems like if the image gets created newly we have to create a new gm instance
|
||||
|
||||
Reference in New Issue
Block a user