b78ac76ca3327adcd6021caa8a4bdf3ccac05c7c842f179448289ed57e363a2aac7a28203a32470cb6e744541aba2efb97c9c0c71109efb8f19e107cdd5d84 449 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. var isObject = require('../helpers/isObject');
  3. // https://262.ecma-international.org/5.1/#sec-8
  4. module.exports = function Type(x) {
  5. if (x === null) {
  6. return 'Null';
  7. }
  8. if (typeof x === 'undefined') {
  9. return 'Undefined';
  10. }
  11. if (isObject(x)) {
  12. return 'Object';
  13. }
  14. if (typeof x === 'number') {
  15. return 'Number';
  16. }
  17. if (typeof x === 'boolean') {
  18. return 'Boolean';
  19. }
  20. if (typeof x === 'string') {
  21. return 'String';
  22. }
  23. };