lib/secureAccessMethods.js
function bypass(method, options) {
    // jscs:disable
    // jshint -W040
    const self = this;
    // jshint +W040
    // jscs:enable
    const shield = self.constructor.shield;

    if (!_.includes(shield.protectedMethods, method)) {
        return Promise.reject(new Error('no such protected method'));
    }
    const protectedMethod = `_${method}`;
    return shield[protectedMethod].call(self, options);
}
function bypass(method, options) {
    // jscs:disable
    // jshint -W040
    const self = this;
    // jshint +W040
    // jscs:enable
    const shield = self.constructor.shield;

    if (!_.includes(shield.protectedMethods, method)) {
        return Promise.reject(new Error('no such protected method'));
    }
    const protectedMethod = `_${method}`;
    return shield[protectedMethod].call(self, options);
}
function bypass ( method , options ) { // jscs:disable // jshint -W040 const self = this ; // jshint +W040 // jscs:enable const shield = self . constructor . shield ; if ( ! _ . includes ( shield . protectedMethods , method ) ) { return Promise . reject ( new Error ( 'no such protected method' ) ) ; } const protectedMethod = ` ${ method } ` ; return shield [ protectedMethod ] . call ( self , options ) ; }
allows a protected method to be called
@param  {string} method   protected method to call
@param  {object} options  options to call function with
@return {Promise}         Promise that the called function returns
allows a protected method to be called