fix(core): update
This commit is contained in:
@ -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'
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user