'use strict';

var callable = require('es5-ext/object/valid-callable')

module.exports = function (normalizer) {
	if (typeof normalizer === 'function') return { set: normalizer, get: normalizer };
	normalizer = { get: callable(normalizer.get) };
	if (normalizer.set !== undefined) {
		normalizer.set = callable(normalizer.set);
		normalizer.delete = callable(normalizer.delete);
		normalizer.clear = callable(normalizer.clear);
		return normalizer;
	}
	normalizer.set = normalizer.get;
	return normalizer;
};

'use strict';

var callable = require('es5-ext/object/valid-callable')

module.exports = function (userNormalizer) {
	var normalizer;
	if (typeof userNormalizer === 'function') return { set: userNormalizer, get: userNormalizer };
	normalizer = { get: callable(userNormalizer.get) };
	if (userNormalizer.set !== undefined) {
		normalizer.set = callable(userNormalizer.set);
		normalizer.delete = callable(userNormalizer.delete);
		normalizer.clear = callable(userNormalizer.clear);
		return normalizer;
	}
	normalizer.set = normalizer.get;
	return normalizer;
};

Fix normalizer resolution