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

Method readTextSync

packages/core/file-system/index.ts:625–642  ·  view source on GitHub ↗
(onError?: (error: any) => any, encoding?: string)

Source from the content-addressed store, hash-verified

623 }
624
625 public readTextSync(onError?: (error: any) => any, encoding?: string): string {
626 this._checkAccess();
627
628 this._locked = true;
629
630 const that = this;
631 const localError = (error) => {
632 that._locked = false;
633 if (onError) {
634 onError(error);
635 }
636 };
637
638 const content = getFileAccess().readTextSync(this.path, localError, encoding);
639 this._locked = false;
640
641 return content;
642 }
643
644 public writeText(content: string, encoding?: string): Promise<any> {
645 return new Promise((resolve, reject) => {

Callers

nothing calls this directly

Calls 3

_checkAccessMethod · 0.95
getFileAccessFunction · 0.85
readTextSyncMethod · 0.65

Tested by

no test coverage detected