MCPcopy Index your code
hub / github.com/angular/angular / transform

Method transform

packages/common/src/pipes/slice_pipe.ts:79–93  ·  view source on GitHub ↗
(
    value: ReadonlyArray<T> | string | null | undefined,
    start: number,
    end?: number,
  )

Source from the content-addressed store, hash-verified

77 transform(value: string, start: number, end?: number): string;
78 transform(value: string | null | undefined, start: number, end?: number): string | null;
79 transform<T>(
80 value: ReadonlyArray<T> | string | null | undefined,
81 start: number,
82 end?: number,
83 ): Array<T> | string | null {
84 if (value == null) return null;
85
86 const supports = typeof value === 'string' || Array.isArray(value);
87
88 if (!supports) {
89 throw invalidPipeArgumentError(SlicePipe, value);
90 }
91
92 return value.slice(start, end);
93 }
94}

Callers

nothing calls this directly

Calls 2

invalidPipeArgumentErrorFunction · 0.90
isArrayMethod · 0.80

Tested by

no test coverage detected