'use strict';

var forEach       = require('es5-ext/object/for-each')
  , normalizeOpts = require('es5-ext/object/normalize-options')
  , callable      = require('es5-ext/object/valid-callable')
  , lazy          = require('d/lazy');

module.exports = function (memoize) {
	return function (props) {
		forEach(props, function (desc, name) {
			var fn = callable(desc.value);
			desc.value = function (options) {
				if (options.getNormalizer) {
					options = normalizeOpts(options);
					options.normalizer = options.getNormalizer();
					delete options.getNormalizer;
				}
				return memoize(fn.bind(this), options);
			};
		});
		return lazy(props);
	};
};

@@ -225,18 +225,121 @@
 d/lazy')
+%0A  , resolveLength = require('./resolve-length')%0A  , extensions    = require('./registered-extensions')
 ;%0A
-
 %0Amodule.
@@ -469,16 +469,24 @@
 c.value)
+, length
 ;%0A%09%09%09des
@@ -588,16 +588,148 @@
 tions);%0A
+%09%09%09%09%09if (length === undefined) %7B%0A%09%09%09%09%09%09length = resolveLength(options.length, fn.length, options.async && extensions.async);%0A%09%09%09%09%09%7D%0A
 %09%09%09%09%09opt
@@ -768,16 +768,22 @@
 malizer(
+length
 );%0A%09%09%09%09%09

Provide `length` to getNormalizer