All files / npm-pack-all/utils utils.index.js

100% Statements 15/15
75% Branches 3/4
100% Functions 3/3
100% Lines 14/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 276x   1x     1x 1x     1x 1x 1x 1x       6x 12x 42x 42x   2x 1x        
module.exports.CliError = class CliError extends Error {
    constructor(flag, value, message) {
        super();
 
        // Maintains proper stack trace for where our error was thrown (only available on V8)
        Eif (Error.captureStackTrace) {
            Error.captureStackTrace(this, CliError);
        }
 
        this.name = `CliInputError`;
        this.cliFlag = flag;
        this.cliValue = value;
        this.message = message;
    }
};
 
module.exports.safetyDecorator = function(wrapped) {
    return function() {
        try {
            wrapped.apply(this, arguments);
        } catch (e) {
            if (e.message.toLowerCase().includes(`no such file`)) return;
            throw e;
        }
    };
};