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

Function normalizeSuffix

packages/core/src/render3/instructions/styling.ts:1024–1039  ·  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

1022 * @param suffix
1023 */
1024function normalizeSuffix(
1025 value: any,
1026 suffix: string | undefined | null,
1027): string | null | undefined | boolean {
1028 if (value == null || value === '') {
1029 // do nothing
1030 // Do not add the suffix if the value is going to be empty.
1031 // As it produce invalid CSS, which the browsers will automatically omit but Domino will not.
1032 // Example: `"left": "px;"` instead of `"left": ""`.
1033 } else if (typeof suffix === 'string') {
1034 value = unwrapSafeValue(value) + suffix;
1035 } else if (typeof value === 'object') {
1036 value = stringify(unwrapSafeValue(value));
1037 }
1038 return value;
1039}
1040
1041/**
1042 * Tests if the `TNode` has input shadow.

Callers 1

checkStylingPropertyFunction · 0.85

Calls 2

unwrapSafeValueFunction · 0.90
stringifyFunction · 0.90

Tested by

no test coverage detected