mirror of
https://github.com/typicode/json-server.git
synced 2025-07-28 04:32:24 +08:00
11 lines
217 B
JavaScript
11 lines
217 B
JavaScript
function toNative(value) {
|
|
if (value === 'true' || value === 'false') {
|
|
return value === 'true';
|
|
} else if (!isNaN(+value)) {
|
|
return +value;
|
|
} else {
|
|
return value;
|
|
}
|
|
}
|
|
|
|
exports.toNative = toNative; |