"use strict";

module.exports = function tagAsType(type) {
	// In operation methods that can be used in multiple places with different semantic meanings (eg. `not`, `anyOf`) and where a different object type needs to be returned based on the observed input type, we use this method to 'annotate' the input based on what type it was determined to be during validation. That way, we don't need to duplicate the type-checking logic in the implementation code, which reduces the chance of bugs due to out-of-sync code.
	return function (value) {
		return { type: type, value: value };
	};
};
