How to use the vue-types.sensibleDefaults function in vue-types

To help you get started, we’ve selected a few vue-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appbaseio / reactivesearch / packages / vue / src / utils / vueTypes.js View on Github external
import VueTypes from 'vue-types';
// import dateFormats from './dateFormats';

VueTypes.sensibleDefaults = false;

const reactKeyType = VueTypes.oneOfType([
	VueTypes.string,
	VueTypes.arrayOf(VueTypes.string),
	VueTypes.object,
	VueTypes.arrayOf(VueTypes.object),
]);

function validateLocation(props, propName) {
	// eslint-disable-next-line
	if (isNaN(props[propName])) {
		return new Error(`${propName} value must be a VueTypes.number`);
	}
	if (propName === 'lat' && (props[propName] < -90 || props[propName] > 90)) {
		return new Error(`${propName} value should be between -90 and 90.`);
	}