Function realType

The most fine-grained and granular version of z.type(), returning the Real-World Type Name of the value passed, not just a general type:

  • Instead of 'function' you get 'Function' | 'GeneratorFunction' | 'AsyncFunction' | 'AsyncGeneratorFunction' | 'ArrowFunction' (always endsWith 'Function')

  • Instead of 'realObject' you get 'pojso' or 'userInstance' or 'systemInstance' (endsWith 'Instance')

  • Instead of 'class' you get 'systemClass' or 'userClass' (always endsWith 'Class')

  • Instead of 'TypedArray, you get 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array' etc.

z.type() for the underlying function

  • Parameters

    • value: unknown

      any value

    Returns RealTypeNames

    TfunctionTypes | TrealObjectTypes | TinstanceTypes | TclassTypes | TrtypeExcludedTypes the type name of the value passed as a string, eg 'number' or 'AsyncFunction' or 'instance' or 'userClass' etc