Options
All
  • Public
  • Public/Protected
  • All
Menu

This accepts a Promise, and delegates its methods to the resolved result of the Promise.

If the eventual result is null, the invoking the data access methods will return undefined.

Use AFileAwait.exists to throw an VirtualFileNotFound error if the file is not found.

const data = FS.find('/nofile').exists.json();

Hierarchy

  • AFileAwait

Implements

Index

Constructors

constructor

  • Parameters

    • target: Promise<null | VFile>

      The Promise of a result.

    • Optional name: string

      The name of the file, if available.

    Returns AFileAwait

Properties

Private #name

#name: undefined | string = '(unresolved)'

Private #target

#target: Promise<null | VFile>

[CACHED_METADATA]

[CACHED_METADATA]: undefined | Metadata

[METADATA]

[METADATA]: undefined | Metadata

[Symbol.toStringTag]

[Symbol.toStringTag]: "AFileAwait"

Preserve the class name across minification.

Accessors

exists

name

  • get name(): string
  • Returns string

    the name, if it was supplied on construction, or if the promise has resolved. Otherwise, returns '(unresolved)';

target

  • get target(): Promise<null | VFile>
  • Awaiting on this will yield the original result, including null if not found.

    Returns Promise<null | VFile>

Methods

arrayBuffer

  • arrayBuffer(): Promise<undefined | ArrayBuffer>

blob

  • blob(): Promise<undefined | Blob>

csv

  • csv(): Promise<undefined | string>

json

text

  • text(): Promise<undefined | string>

tsv

  • tsv(): Promise<undefined | string>

url

  • url(): Promise<undefined | string>

Generated using TypeDoc