lost+found/src/interfaces_.js
function _gpfIsImplementedBy (inspectedObject, interfaceDefinition) {
    var member,
        memberReference,
        memberValue,
        memberType;
    /*
     * IMPORTANT note: we test the object itself (i.e. own members and the prototype).
     * That's why the hasOwnProperty is skipped
     */
    /*jslint forin:true*/
    for (member in interfaceDefinition.prototype) {
        if ("constructor" === member) { // Object
            continue;
        }
        memberReference = interfaceDefinition.prototype[member];
        memberValue = inspectedObject[member];
        memberType = typeof memberValue;
        if (typeof memberReference !== memberType) {
            return false;
        }
        if ("function" === memberType && memberReference.length !== memberValue.length) {
            return false;
        }
    }
    return true;
}
function _gpfIsImplementedBy (inspectedObject, interfaceDefinition) {
    var member,
        memberReference,
        memberValue,
        memberType;
    /*
     * IMPORTANT note: we test the object itself (i.e. own members and the prototype).
     * That's why the hasOwnProperty is skipped
     */
    /*jslint forin:true*/
    for (member in interfaceDefinition.prototype) {
        if ("constructor" === member) { // Object
            continue;
        }
        memberReference = interfaceDefinition.prototype[member];
        memberValue = inspectedObject[member];
        memberType = typeof memberValue;
        if (typeof memberReference !== memberType) {
            return false;
        }
        if ("function" === memberType && memberReference.length !== memberValue.length) {
            return false;
        }
    }
    return true;
}
function _gpfIsImplementedBy ( inspectedObject , interfaceDefinition ) { var member , memberReference , memberValue , memberType ; /*
     * IMPORTANT note: we test the object itself (i.e. own members and the prototype).
     * That's why the hasOwnProperty is skipped
     */ /*jslint forin:true*/ for ( member in interfaceDefinition . prototype ) { if ( "constructor" === member ) { // Object continue ; } memberReference = interfaceDefinition . prototype [ member ] ; memberValue = inspectedObject [ member ] ; memberType = typeof memberValue ; if ( typeof memberReference !== memberType ) { return false ; } if ( "function" === memberType && memberReference . length !== memberValue . length ) { return false ; } } return true ; }
Verify that the object implements the current interface

@param {Object} inspectedObject Object (or class) to inspect
@param {gpf.interfaces.Interface} interfaceDefinition Reference interface
@return {Boolean} True if implemented
Verify that the object implements the current interface