utils.lang.js 527 B

123456789101112131415161718
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. function isNumber(v) {
  4. return v === +v;
  5. }
  6. exports.isNumber = isNumber;
  7. function isString(v) {
  8. return typeof v === 'string';
  9. }
  10. exports.isString = isString;
  11. function isObject(v) {
  12. return v != null && typeof v === 'object' && Array.isArray(v) === false;
  13. }
  14. exports.isObject = isObject;
  15. function isPlainObject(v) {
  16. return isObject(v) && [null, Object.prototype].includes(Object.getPrototypeOf(v));
  17. }
  18. exports.isPlainObject = isPlainObject;