lib/api/deprecate.js
function deprecateField(book, key, instance, property, value, msg) {
    var store = undefined;

    var prepare = function() {
        if (!is.undefined(store)) return;

        if (is.fn(value)) store = value();
        else store = value;
    };

    var getter = function(){
        prepare();

        logNotice(book, key, msg);
        return store;
    };
    var setter = function(v) {
        prepare();

        logNotice(book, key, msg);
        store = v;
        return store;
    };

    Object.defineProperty(instance, property, {
        get: getter,
        set: setter,
        enumerable: true,
        configurable: true
    });
}
function deprecateField(book, key, instance, property, value, msg) {
    var store = undefined;

    var prepare = function() {
        if (!is.undefined(store)) return;

        if (is.fn(value)) store = value();
        else store = value;
    };

    var getter = function(){
        prepare();

        logNotice(book, key, msg);
        return store;
    };
    var setter = function(v) {
        prepare();

        logNotice(book, key, msg);
        store = v;
        return store;
    };

    Object.defineProperty(instance, property, {
        get: getter,
        set: setter,
        enumerable: true,
        configurable: true
    });
}
function deprecateField ( book , key , instance , property , value , msg ) { var store = undefined ; var prepare = function ( ) { if ( ! is . undefined ( store ) ) return ; if ( is . fn ( value ) ) store = value ( ) ; else store = value ; } ; var getter = function ( ) { prepare ( ) ; logNotice ( book , key , msg ) ; return store ; } ; var setter = function ( v ) { prepare ( ) ; logNotice ( book , key , msg ) ; store = v ; return store ; } ; Object . defineProperty ( instance , property , { get : getter , set : setter , enumerable : true , configurable : true } ) ; }
Deprecate a property of an object

@param {Book|Output} book
@param {String} key: unique identitifer for the deprecated
@param {Object} instance
@param {String|Function} property
@param {String} msg: message to print when called
@return {Function}
Deprecate a property of an object