MCPcopy Create free account
hub / github.com/SAP/ui5-project / getReader

Method getReader

lib/specifications/types/Module.js:68–92  ·  view source on GitHub ↗

* Get a [ReaderCollection]@ui5/fs/ReaderCollection for accessing all resources of the * project in the specified "style": * * * buildtime: Resource paths are always prefixed with /resources/ * or /test-resources/ followed by the project's

({style = "buildtime"} = {})

Source from the content-addressed store, hash-verified

66 * @returns {@ui5/fs/ReaderCollection} A reader collection instance
67 */
68 getReader({style = "buildtime"} = {}) {
69 // Apply builder excludes to all styles but "runtime"
70 const excludes = style === "runtime" ? [] : this.getBuilderResourcesExcludes();
71
72 const readers = this._paths.map(({name, virBasePath, fsBasePath}) => {
73 return resourceFactory.createReader({
74 name,
75 virBasePath,
76 fsBasePath,
77 project: this,
78 excludes
79 });
80 });
81 if (readers.length === 1) {
82 return readers[0];
83 }
84 const readerCollection = resourceFactory.createReaderCollection({
85 name: `Reader collection for module project ${this.getName()}`,
86 readers
87 });
88 return resourceFactory.createReaderCollectionPrioritized({
89 name: `Reader/Writer collection for project ${this.getName()}`,
90 readers: [this._getWriter(), readerCollection]
91 });
92 }
93
94 /**
95 * Get a resource reader/writer for accessing and modifying a project's resources

Callers 1

getWorkspaceMethod · 0.95

Calls 3

_getWriterMethod · 0.95
getNameMethod · 0.45

Tested by

no test coverage detected