index.js
/**
 * Searches linked list of objects for implementation of property `key` anywhere on their prototype chain.
 * The search excludes members of `DatasaurBase.prototype` (previously installed forwarding catchers).
 * @param {object} transformer - Data model transformer list, linked backwards one to the previous one by `next` property.
 * The first transformer, the actual data source, has null `next`, meaning start-of-list.
 * @param {string} key - Property to search for.
 * @param {boolean} [remove] - Delete all implementations along prototype chains of all transformers and return falsy.
 * @returns {undefined|function} - Found method implementation or `undefined` if not found.
 */
Searches linked list of objects for implementation of property `key` anywhere on their prototype chain.
The search excludes members of `DatasaurBase.prototype` (previously installed forwarding catchers).
@param {object} transformer - Data model transformer list, linked backwards one to the previous one by `next` property.
The first transformer, the actual data source, has null `next`, meaning start-of-list.
@param {string} key - Property to search for.
@param {boolean} [remove] - Delete all implementations along prototype chains of all transformers and return falsy.
@returns {undefined|function} - Found method implementation or `undefined` if not found.
Searches linked list of objects for implementation of property ` key ` anywhere on their prototype chain . The search excludes members of ` DatasaurBase . prototype ` ( previously installed forwarding catchers ) . @param { object } transformer - Data model transformer list linked backwards one to the previous one by ` next ` property . The first transformer the actual data source has null ` next ` meaning start - of - list . @param { string } key - Property to search for . @param { boolean } [ remove ] - Delete all implementations along prototype chains of all transformers and return falsy . @returns { undefined|function } - Found method implementation or ` undefined ` if not found .
function findMethod(transformer, key, remove) {
    do {
        if (transformer[key]) {
            if (remove) {
                for (var link = transformer; link && link !== Object.prototype; link = Object.getPrototypeOf(link)) {
                    delete link[key];
                }
            } else if (transformer[key] !== DatasaurBase.prototype[key]) {
                return transformer[key];
            }
        }
        transformer = transformer.next;
    } while (transformer);
}
function findMethod ( transformer , key , remove ) { do { if ( transformer [ key ] ) { if ( remove ) { for ( var link = transformer ; link && link !== Object . prototype ; link = Object . getPrototypeOf ( link ) ) { delete link [ key ] ; } } else if ( transformer [ key ] !== DatasaurBase . prototype [ key ] ) { return transformer [ key ] ; } } transformer = transformer . next ; } while ( transformer ) ; }
Searches linked list of objects for implementation of property `key` anywhere on their prototype chain.
Searches linked list of objects for implementation of property ` key ` anywhere on their prototype chain .