Created
          May 21, 2020 05:22 
        
      - 
      
 - 
        
Save snakeneedy/04f6ce92d358b61207d2ad2b42f072c7 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
snakeneedy created this gist
May 21, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ const getTypeName = (o) => { if (o === undefined) return 'undefined'; if (o === null) return 'null'; return o.constructor.name; }; const isUndefined = (o) => (o === undefined); const isNull = (o) => (o === null); const isString = (o) => (getTypeName(o) === 'String'); const isNumber = (o) => (getTypeName(o) === 'Number'); const isInteger = (o) => (Number.isInteger(o)); const isBoolean = (o) => (getTypeName(o) === 'Boolean'); const isArray = (o) => (Array.isArray(o)); const isPureObject = (o) => (getTypeName(o) === 'Object'); const isSymbol = (o) => (getTypeName(o) === 'Symbol'); export default { getTypeName, isUndefined, isNull, isString, isNumber, isInteger, isBoolean, isArray, isPureObject, isSymbol, };