param propertyName param input export function parseJsonProperty ( input , propertyName ) { if ( ! ( propertyName in input ) ) { throw TypeError ( `property "${ propertyName }" does not exists on object: ${ JSON . stringify ( input ) }` ) ; } try { return JSON . parse ( input [ propertyName ] ) ; } catch ( error ) { throw TypeError ( `property "${ propertyName }" is not JSON parsable, value was: ${ input [ propertyName ] }` ) ; } }