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

Method appendText

packages/core/file-system/index.ts:410–435  ·  view source on GitHub ↗
(content: string, encoding?: string)

Source from the content-addressed store, hash-verified

408 }
409
410 public appendText(content: string, encoding?: string): Promise<any> {
411 return new Promise((resolve, reject) => {
412 try {
413 this._checkAccess();
414 } catch (ex) {
415 reject(ex);
416
417 return;
418 }
419
420 this._locked = true;
421
422 getFileAccess()
423 .appendTextAsync(this.path, content, encoding)
424 .then(
425 () => {
426 resolve(true);
427 this._locked = false;
428 },
429 (error) => {
430 reject(error);
431 this._locked = false;
432 },
433 );
434 });
435 }
436
437 public appendTextSync(content: string, onError?: (error: any) => any, encoding?: string): void {
438 this._checkAccess();

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected