File tree Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,21 @@ import logger from "@ui5/logger";
5
5
const log = logger . getLogger ( "resources:readers:Link" ) ;
6
6
7
7
/**
8
- * A reader that allows removing paths segments from all resources passed through it.
8
+ * A reader that allows for rewriting paths segments of all resources passed through it.
9
+ *
10
+ * @example
11
+ * import Link from "@ui5/fs/readers/Link";
12
+ * const linkedReader = new Link({
13
+ * reader: sourceReader,
14
+ * pathMapping: {
15
+ * linkPath: `/app`,
16
+ * targetPath: `/resources/my-app-name/`
17
+ * }
18
+ * });
19
+ *
20
+ * // The following resolves with a @ui 5/fs/ResourceFacade of the resource
21
+ * // located at "/resources/my-app-name/Component.js" in the sourceReader
22
+ * const resource = await linkedReader.byPath("/app/Component.js");
9
23
*
10
24
* @public
11
25
* @class
Original file line number Diff line number Diff line change @@ -122,7 +122,8 @@ export function createWriterCollection({name, writerMapping}) {
122
122
}
123
123
124
124
/**
125
- * Creates a <code>Resource</code>. Accepts the same parameters as the Resource constructor.
125
+ * Creates a [Resource]{@link @ui5/fs/Resource }.
126
+ * Accepts the same parameters as the [Resource]{@link @ui5/fs/Resource } constructor.
126
127
*
127
128
* @public
128
129
* @param {object } parameters Parameters to be passed to the resource constructor
@@ -180,7 +181,21 @@ export function createFilterReader(parameters) {
180
181
181
182
/**
182
183
* Create a [Link-Reader]{@link @ui5/fs/readers/Filter } with the given reader.
183
- * The provided path mapping allows
184
+ * The provided path mapping allows for rewriting paths segments of all resources passed through it.
185
+ *
186
+ * @example
187
+ * import {createLinkReader} from "@ui5/fs/resourceFactory";
188
+ * const linkedReader = createLinkReader({
189
+ * reader: sourceReader,
190
+ * pathMapping: {
191
+ * linkPath: `/app`,
192
+ * targetPath: `/resources/my-app-name/`
193
+ * }
194
+ * });
195
+ *
196
+ * // The following resolves with a @ui 5/fs/ResourceFacade of the resource
197
+ * // located at "/resources/my-app-name/Component.js" in the sourceReader
198
+ * const resource = await linkedReader.byPath("/app/Component.js");
184
199
*
185
200
* @public
186
201
* @param {object } parameters
You can’t perform that action at this time.
0 commit comments