@ui5/fs/readers/Link

@ui5/fs/readers/Link

A reader that allows for rewriting paths segments of all resources passed through it.

Constructor

Description:
  • Constructor
Source:
Example
import Link from "@ui5/fs/readers/Link";
const linkedReader = new Link({
    reader: sourceReader,
    pathMapping: {
         linkPath: `/app`,
         targetPath: `/resources/my-app-name/`
     }
});

// The following resolves with a @ui5/fs/ResourceFacade of the resource
// located at "/resources/my-app-name/Component.js" in the sourceReader
const resource = await linkedReader.byPath("/app/Component.js");
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
reader @ui5/fs/AbstractReader The resource reader or collection to wrap
pathMapping @ui5/fs/readers/Link/PathMapping

Extends

Methods

byGlob(virPattern, optionsopt) → {Promise.<Array.<@ui5/fs/Resource>>}

Description:
  • Locates resources by matching glob patterns.
Source:
Overrides:
Example
byGlob("**‏/*.{html,htm}");
byGlob("**‏/.library");
byGlob("/pony/*");
Parameters:
Name Type Attributes Description
virPattern string | Array.<string> glob pattern as string or array of glob patterns for virtual directory structure
options object <optional>
glob options
Properties
Name Type Attributes Default Description
nodir boolean <optional>
true Do not match directories
Returns:
Promise resolving to list of resources
Type
Promise.<Array.<@ui5/fs/Resource>>

byPath(virPath, optionsopt) → {Promise.<@ui5/fs/Resource>}

Description:
  • Locates resources by matching a given path.
Source:
Overrides:
Parameters:
Name Type Attributes Description
virPath string Virtual path
options object <optional>
Options
Properties
Name Type Attributes Default Description
nodir boolean <optional>
true Do not match directories
Returns:
Promise resolving to a single resource
Type
Promise.<@ui5/fs/Resource>