(location, input)
| 1059 | } |
| 1060 | |
| 1061 | function buildConstSerializer (location, input) { |
| 1062 | const schema = location.schema |
| 1063 | const type = schema.type |
| 1064 | |
| 1065 | const hasNullType = Array.isArray(type) && type.includes('null') |
| 1066 | |
| 1067 | let code = '' |
| 1068 | |
| 1069 | if (hasNullType) { |
| 1070 | code += ` |
| 1071 | if (${input} === null) { |
| 1072 | json += JSON_STR_NULL |
| 1073 | } else { |
| 1074 | ` |
| 1075 | } |
| 1076 | |
| 1077 | code += `json += '${JSON.stringify(schema.const).replace(SINGLE_TICK, "\\'")}'` |
| 1078 | |
| 1079 | if (hasNullType) { |
| 1080 | code += ` |
| 1081 | } |
| 1082 | ` |
| 1083 | } |
| 1084 | |
| 1085 | return code |
| 1086 | } |
| 1087 | |
| 1088 | function buildAllOf (context, location, input) { |
| 1089 | const schema = location.schema |
no outgoing calls
no test coverage detected
searching dependent graphs…