utils.js 734 B

123456789101112131415161718192021222324
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.isUndefined = exports.isPlainObject = exports.isFunction = exports.isRegex = void 0;
  4. function isRegex(o) {
  5. return o instanceof RegExp;
  6. }
  7. exports.isRegex = isRegex;
  8. // https://stackoverflow.com/a/7356528/228885
  9. function isFunction(functionToCheck) {
  10. return (functionToCheck && {}.toString.call(functionToCheck) === "[object Function]");
  11. }
  12. exports.isFunction = isFunction;
  13. function isPlainObject(a) {
  14. if (a === null || Array.isArray(a)) {
  15. return false;
  16. }
  17. return typeof a === "object";
  18. }
  19. exports.isPlainObject = isPlainObject;
  20. function isUndefined(a) {
  21. return typeof a === "undefined";
  22. }
  23. exports.isUndefined = isUndefined;
  24. //# sourceMappingURL=utils.js.map