1 |
|
2 |
|
3 |
|
4 | import { RpcNullableString } from '@azure/functions-core';
|
5 |
|
6 | export function fromNullableMapping(
|
7 | nullableMapping: Record<string, RpcNullableString> | null | undefined,
|
8 | originalMapping?: Record<string, string> | null
|
9 | ): Record<string, string> {
|
10 | let converted = {};
|
11 | if (nullableMapping && Object.keys(nullableMapping).length > 0) {
|
12 | for (const key in nullableMapping) {
|
13 | converted[key] = nullableMapping[key].value || '';
|
14 | }
|
15 | } else if (originalMapping && Object.keys(originalMapping).length > 0) {
|
16 | converted = originalMapping;
|
17 | }
|
18 | return converted;
|
19 | }
|