types/numeric.js
function registerDual(numberType, numericType, checkFn, toJSONSchema) {
		context.registerType(numberType, 'number', checkFn, numberType, extra => toJSONSchema('number', extra))

		context.registerType(numericType, 'string', value => {
			let numberValue = toNumber(value)
			checkFn(numberValue)
			return numberValue
		}, numericType, () => ({
				type: 'string',
				format: numericType
			}))
	}
function registerDual(numberType, numericType, checkFn, toJSONSchema) {
		context.registerType(numberType, 'number', checkFn, numberType, extra => toJSONSchema('number', extra))

		context.registerType(numericType, 'string', value => {
			let numberValue = toNumber(value)
			checkFn(numberValue)
			return numberValue
		}, numericType, () => ({
				type: 'string',
				format: numericType
			}))
	}
function registerDual ( numberType , numericType , checkFn , toJSONSchema ) { context . registerType ( numberType , 'number' , checkFn , numberType , extra => toJSONSchema ( 'number' , extra ) ) context . registerType ( numericType , 'string' , value => { let numberValue = toNumber ( value ) checkFn ( numberValue ) return numberValue } , numericType , ( ) => ( { type : 'string' , format : numericType } ) ) }
Register number and numeric dual basic types
@param {string} numberType
@param {string} numericType
@param {Function} checkFn
@param {function(string, *):Object} toJSONSchema
@private
Register number and numeric dual basic types