_createTypeCheck(propertyType) {
    return (propertyName, value) => {
      if (typeof value !== propertyType) {
        throw new Error(propertyType + ' expected for `' + propertyName + '`');
      }
    };
  }
Create and return a function that checks for a given type