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

Method write

packages/core/file-system/index.ts:551–576  ·  view source on GitHub ↗
(content: any)

Source from the content-addressed store, hash-verified

549 }
550
551 public write(content: any): Promise<void> {
552 return new Promise<void>((resolve, reject) => {
553 try {
554 this._checkAccess();
555 } catch (ex) {
556 reject(ex);
557
558 return;
559 }
560
561 this._locked = true;
562
563 getFileAccess()
564 .writeAsync(this.path, content)
565 .then(
566 () => {
567 resolve();
568 this._locked = false;
569 },
570 (error) => {
571 reject(error);
572 this._locked = false;
573 },
574 );
575 });
576 }
577
578 public writeSync(content: any, onError?: (error: any) => any): void {
579 this._checkAccess();

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected