types/numeric.js
function registerTaggedDual(numberTag, numericTag, checkFn, toJSONSchema) {
		context.registerTaggedType({
			tag: numberTag,
			jsonType: 'number',
			minArgs: 2,
			maxArgs: 2,
			sparse: true,
			numeric: true
		}, checkFn, returnOriginal, toJSONSchema)

		context.registerTaggedType({
			tag: numericTag,
			jsonType: 'string',
			minArgs: 2,
			maxArgs: 2,
			sparse: true,
			numeric: true
		}, (value, args) => {
			let numberValue = toNumber(value)
			checkFn(numberValue, args)
			return numberValue
		}, returnOriginal, extra => ({
				type: 'string',
				format: extra.original
			}))
	}
function registerTaggedDual(numberTag, numericTag, checkFn, toJSONSchema) {
		context.registerTaggedType({
			tag: numberTag,
			jsonType: 'number',
			minArgs: 2,
			maxArgs: 2,
			sparse: true,
			numeric: true
		}, checkFn, returnOriginal, toJSONSchema)

		context.registerTaggedType({
			tag: numericTag,
			jsonType: 'string',
			minArgs: 2,
			maxArgs: 2,
			sparse: true,
			numeric: true
		}, (value, args) => {
			let numberValue = toNumber(value)
			checkFn(numberValue, args)
			return numberValue
		}, returnOriginal, extra => ({
				type: 'string',
				format: extra.original
			}))
	}
function registerTaggedDual ( numberTag , numericTag , checkFn , toJSONSchema ) { context . registerTaggedType ( { tag : numberTag , jsonType : 'number' , minArgs : 2 , maxArgs : 2 , sparse : true , numeric : true } , checkFn , returnOriginal , toJSONSchema ) context . registerTaggedType ( { tag : numericTag , jsonType : 'string' , minArgs : 2 , maxArgs : 2 , sparse : true , numeric : true } , ( value , args ) => { let numberValue = toNumber ( value ) checkFn ( numberValue , args ) return numberValue } , returnOriginal , extra => ( { type : 'string' , format : extra . original } ) ) }
Register number and numeric dual tagged types
@param {string} numberTag
@param {string} numericTag
@param {Function} checkFn
@param {function(*):Object} toJSONSchema
@private
Register number and numeric dual tagged types