MCPcopy
hub / github.com/angular/angular / normalizeSuffix

Function normalizeSuffix

packages/core/src/render3/instructions/styling.ts:990–1005  ·  view source on GitHub ↗

* Normalizes and/or adds a suffix to the value. * * If value is `null`/`undefined` no suffix is added * @param value * @param suffix

(
  value: any,
  suffix: string | undefined | null,
)

Source from the content-addressed store, hash-verified

988 * @param suffix
989 */
990function normalizeSuffix(
991 value: any,
992 suffix: string | undefined | null,
993): string | null | undefined | boolean {
994 if (value == null || value === '') {
995 // do nothing
996 // Do not add the suffix if the value is going to be empty.
997 // As it produce invalid CSS, which the browsers will automatically omit but Domino will not.
998 // Example: `"left": "px;"` instead of `"left": ""`.
999 } else if (typeof suffix === 'string') {
1000 value = value + suffix;
1001 } else if (typeof value === 'object') {
1002 value = stringify(unwrapSafeValue(value));
1003 }
1004 return value;
1005}
1006
1007/**
1008 * Tests if the `TNode` has input shadow.

Callers 1

checkStylingPropertyFunction · 0.85

Calls 2

stringifyFunction · 0.90
unwrapSafeValueFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…