本文整理匯總了TypeScript中webpack.InputFileSystem類的典型用法代碼示例。如果您正苦於以下問題:TypeScript InputFileSystem類的具體用法?TypeScript InputFileSystem怎麽用?TypeScript InputFileSystem使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了InputFileSystem類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: readFile
readFile(path: string, callback: (err: Error, contents: Buffer) => void): void {
const result = this._readFileSync(path);
if (result) {
// tslint:disable-next-line:no-any
callback(null as any, result);
} else {
this._inputFileSystem.readFile(path, callback);
}
}
示例2: stat
stat(path: string, callback: (err: Error, stats: Stats) => void): void {
const result = this._statSync(path);
if (result) {
// tslint:disable-next-line:no-any
callback(null as any, result);
} else {
this._inputFileSystem.stat(path, callback);
}
}
示例3: Observable
return new Observable(obs => {
// TODO: remove this try+catch when issue https://github.com/ReactiveX/rxjs/issues/3740 is
// fixed.
try {
const data = this.inputFileSystem.readFileSync(getSystemPath(path));
obs.next(new Uint8Array(data).buffer as ArrayBuffer);
obs.complete();
} catch (e) {
obs.error(e);
}
});
示例4: readlinkSync
readlinkSync(path: string): string {
return this._inputFileSystem.readlinkSync(path);
}
示例5: readFileSync
readFileSync(path: string): Buffer {
const result = this._readFileSync(path);
return result || this._inputFileSystem.readFileSync(path);
}
示例6: statSync
statSync(path: string): Stats {
const result = this._statSync(path);
return result || this._inputFileSystem.statSync(path);
}
示例7: readlink
readlink(path: string, callback: (err: Error, linkString: string) => void): void {
this._inputFileSystem.readlink(path, callback);
}