fix(core): update

This commit is contained in:
2022-07-24 23:04:51 +02:00
parent 4a11f50efe
commit 982387aaa3
4 changed files with 4062 additions and 247 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartfile',
version: '10.0.2',
version: '10.0.3',
description: 'offers smart ways to work with files in nodejs'
}

View File

@ -242,4 +242,9 @@ export class Smartfile extends plugins.smartjson.Smartjson {
const oldFileName = this.parsedPath.base;
this.path = this.path.replace(new RegExp(oldFileName + '$'), fileNameArg);
}
public async editContentAsString(editFuncArg: (fileStringArg: string) => Promise<string>) {
const newFileString = await editFuncArg(this.contentBuffer.toString());
this.contentBuffer = Buffer.from(newFileString);
}
}