1
0
CompleteNodeJS/notes-app/node_modules/validator/lib/util/toString.js

22 lines
819 B
JavaScript
Raw Normal View History

2019-08-11 18:15:16 +00:00
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.default = toString;
function toString(input) {
if ((typeof input === 'undefined' ? 'undefined' : _typeof(input)) === 'object' && input !== null) {
if (typeof input.toString === 'function') {
input = input.toString();
} else {
input = '[object Object]';
}
} else if (input === null || typeof input === 'undefined' || isNaN(input) && !input.length) {
input = '';
}
return String(input);
}
module.exports = exports['default'];