MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / read

Method read

packages/core/file-system/index.ts:504–529  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

502 }
503
504 public read(): Promise<any> {
505 return new Promise<any>((resolve, reject) => {
506 try {
507 this._checkAccess();
508 } catch (ex) {
509 reject(ex);
510
511 return;
512 }
513
514 this._locked = true;
515
516 getFileAccess()
517 .readAsync(this.path)
518 .then(
519 (result) => {
520 resolve(result);
521 this._locked = false;
522 },
523 (error) => {
524 reject(error);
525 this._locked = false;
526 },
527 );
528 });
529 }
530
531 public readSync(onError?: (error: any) => any): any {
532 this._checkAccess();

Callers

nothing calls this directly

Calls 4

_checkAccessMethod · 0.95
getFileAccessFunction · 0.85
readAsyncMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected