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

Function normalizeSuffix

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

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