object.js 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. /*
  3. This file is part of web3.js.
  4. web3.js is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. web3.js is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License
  13. along with web3.js. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. Object.defineProperty(exports, "__esModule", { value: true });
  16. exports.isObject = exports.isNullish = void 0;
  17. const web3_types_1 = require("web3-types");
  18. // Explicitly check for the
  19. // eslint-disable-next-line @typescript-eslint/ban-types
  20. const isNullish = (item) =>
  21. // Using "null" value intentionally for validation
  22. // eslint-disable-next-line no-null/no-null
  23. item === undefined || item === null;
  24. exports.isNullish = isNullish;
  25. const isObject = (item) => typeof item === 'object' &&
  26. !(0, exports.isNullish)(item) &&
  27. !Array.isArray(item) &&
  28. !(item instanceof web3_types_1.TypedArray);
  29. exports.isObject = isObject;
  30. //# sourceMappingURL=object.js.map