(value: any)
| 193 | } |
| 194 | |
| 195 | static string(value: any): string | undefined { |
| 196 | switch (typeof value) { |
| 197 | case 'object': |
| 198 | return undefined; |
| 199 | |
| 200 | case 'string': |
| 201 | return value; |
| 202 | |
| 203 | case 'number': |
| 204 | case 'boolean': |
| 205 | return isFinite(value as any) ? value.toString() : undefined; |
| 206 | |
| 207 | default: |
| 208 | return undefined; |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | static js(value: any): Primitive | undefined { |
| 213 | return JSON.stringify(as.primitive(value)); |
no test coverage detected