MCPcopy Create free account
hub / github.com/angular/angular / createPipeDefinitionMap

Function createPipeDefinitionMap

packages/compiler/src/render3/partial/pipe.ts:40–63  ·  view source on GitHub ↗

* Gathers the declaration fields for a Pipe into a `DefinitionMap`.

(meta: R3PipeMetadata)

Source from the content-addressed store, hash-verified

38 * Gathers the declaration fields for a Pipe into a `DefinitionMap`.
39 */
40function createPipeDefinitionMap(meta: R3PipeMetadata): DefinitionMap<R3DeclarePipeMetadata> {
41 const definitionMap = new DefinitionMap<R3DeclarePipeMetadata>();
42
43 definitionMap.set('minVersion', o.literal(MINIMUM_PARTIAL_LINKER_VERSION));
44 definitionMap.set('version', o.literal('0.0.0-PLACEHOLDER'));
45 definitionMap.set('ngImport', o.importExpr(R3.core));
46
47 // e.g. `type: MyPipe`
48 definitionMap.set('type', meta.type.value);
49
50 if (meta.isStandalone !== undefined) {
51 definitionMap.set('isStandalone', o.literal(meta.isStandalone));
52 }
53
54 // e.g. `name: "myPipe"`
55 definitionMap.set('name', o.literal(meta.pipeName ?? meta.name));
56
57 if (meta.pure === false) {
58 // e.g. `pure: false`
59 definitionMap.set('pure', o.literal(meta.pure));
60 }
61
62 return definitionMap;
63}

Callers 1

Calls 1

setMethod · 0.95

Tested by

no test coverage detected