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I,YAAY,WAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,WAAI,YAAE,GAAG,EAAE,IAAI,CAAC,GAAG,IAAK,IAAI,EAAE,CAAC;wBAClF,qBAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAA;;wBAAvC,SAAuC,CAAC;;;;;KACzC;IACH,WAAC;AAAD,CAAC,AA5BD,CAA0B,4BAAY,GA4BrC;AA5BY,oBAAI","sourcesContent":["import * as fs from 'fs-extra';\nimport {Path} from './path';\nimport {WritableFile} from './writable_file';\n\nexport class File extends WritableFile {\n constructor(public props?: ConstructorParameters[0] & {readonly?: boolean; forgive?: boolean}) {\n super(props);\n }\n get readonlyError(): void {\n if (this.props?.readonly) throw new Error('this file is readonly');\n return undefined;\n }\n async writeFromString(content: string) {\n this.readonlyError;\n return super.writeFromString(content);\n }\n async createFromString(content: string) {\n this.readonlyError;\n return super.createFromString(content);\n }\n async upsertFromString(content: string) {\n this.readonlyError;\n return super.upsertFromString(content);\n }\n async copy(dest: ConstructorParameters[0] | Path) {\n const destPath = dest instanceof Path ? dest : new Path({cwd: this.cwd, ...dest});\n await fs.copy(this.path, destPath.path);\n }\n async move(dest: ConstructorParameters[0] | Path) {\n const destPath = dest instanceof Path ? dest : new Path({cwd: this.cwd, ...dest});\n await fs.move(this.path, destPath.path);\n }\n}\n"]}