Skip to content

Latest commit

 

History

History
29 lines (16 loc) · 793 Bytes

API.md

File metadata and controls

29 lines (16 loc) · 793 Bytes

Table of Contents

coerce

Validate an object is an instance of the expected type, or is a valid constructor object for the requested type

Parameters

  • value any The value for validation

  • Type any The type for instance of comparison

  • message string The message to be displayed if coercion fails

  • Throws TypeError If the value is not coercable.

Returns any Instance of provided Type