(param)
| 1230 | INCHES_PER_UNIT['yard'] = INCHES_PER_UNIT.yd; |
| 1231 | |
| 1232 | function paramToString(param) { |
| 1233 | if (param == undefined || param == null) { |
| 1234 | return ''; |
| 1235 | } |
| 1236 | if (param instanceof Date) { |
| 1237 | return param.toJSON(); |
| 1238 | } |
| 1239 | if (canBeJsonified(param)) { |
| 1240 | return JSON.stringify(param); |
| 1241 | } |
| 1242 | |
| 1243 | return param.toString(); |
| 1244 | } |
| 1245 | |
| 1246 | function canBeJsonified(str) { |
| 1247 | if (typeof str !== 'string' && typeof str !== 'object') { |
no test coverage detected