all files / gulp-remove-logging/ index.js

100% Statements 10/10
80% Branches 8/10
100% Functions 1/1
100% Lines 10/10
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61                            36×     36× 35×             36× 35×                                                 36× 36×       36×    
/*
 * gulp-remove-logging
 * Based on ehynds/grunt-remove-logging
 *
 * Copyright 2016, Valerian Saliou
 * Author: Valerian Saliou <valerian@valeriansaliou.name>
 */
 
 
"use strict";
 
 
var remove_logging  = require("./lib/removelogging");
 
 
module.exports = function(opts) {
  opts = opts || {};
 
  // Use console as the default namespace
  if (!("namespace" in opts)) {
    opts.namespace = [
      "console",
      "window.console"
    ];
  }
 
  // Default methods
  if (!("methods" in opts) || (typeof opts.methods !== "object")) {
    opts.methods = [
      "log",
      "info",
      "warn",
      "error",
      "assert",
      "count",
      "clear",
      "group",
      "groupEnd",
      "groupCollapsed",
      "trace",
      "debug",
      "dir",
      "dirxml",
      "profile",
      "profileEnd",
      "time",
      "timeEnd",
      "timeStamp",
      "table",
      "exception"
    ];
  }
 
  Eif (!("verbose" in opts)) {
    opts.verbose = true;
  }
 
  // Proceed transform
  return remove_logging.proceed(opts);
};