Skip to content

Commit

Permalink
for transform in arrow arrow-return let obj-shorthand obj-method ; do…
Browse files Browse the repository at this point in the history
… for dir in lib test; do lebab --transform $transform --replace $dir; done ; done
  • Loading branch information
papandreou committed Jun 23, 2019
1 parent b8a958e commit f083a24
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/uninspected.js
@@ -1,6 +1,6 @@
var unexpected = require('unexpected').clone();
const unexpected = require('unexpected').clone();

var originalConsole = console; // Take a copy so we don't loop infinitely when someone goes: console=uninspected;console.log('foo');
const originalConsole = console; // Take a copy so we don't loop infinitely when someone goes: console=uninspected;console.log('foo');

unexpected.installPlugin(require('magicpen-prism'));

Expand All @@ -9,11 +9,11 @@ function uninspected() {
return uninspected.log.apply(uninspected, arguments);
}

uninspected.inspect = function(obj, options) {
uninspected.inspect = (obj, options) => {
if (!options || typeof options !== 'object') {
options = {};
}
var depth =
const depth =
options.depth === null
? Infinity
: options.depth || uninspected.defaultDepth;
Expand All @@ -34,7 +34,7 @@ if (uninspected.outputFormat === 'html') {
uninspected.outputFormat = 'text';
}

var isChrome =
const isChrome =
typeof navigator !== 'undefined' &&
navigator &&
typeof navigator.userAgent === 'string' &&
Expand All @@ -46,11 +46,11 @@ function createOutput() {
);
}

['log', 'info', 'warn', 'error'].forEach(function(methodName) {
['log', 'info', 'warn', 'error'].forEach(methodName => {
uninspected[methodName] = function() {
// ...
var output = createOutput();
Array.prototype.forEach.call(arguments, function(obj, i) {
const output = createOutput();
Array.prototype.forEach.call(arguments, (obj, i) => {
if (i > 0) {
output.sp();
}
Expand All @@ -72,12 +72,12 @@ function createOutput() {

uninspected.dir = originalConsole.dir.bind(originalConsole);

uninspected.assert = function(subject) {
uninspected.assert = subject => {
unexpected(subject, 'to be truthy');
};

uninspected.diff = function(a, b) {
var result = unexpected.diff(a, b, createOutput());
uninspected.diff = (a, b) => {
const result = unexpected.diff(a, b, createOutput());
if (result) {
uninspected.log(result);
} else if (unexpected.equal(a, b)) {
Expand All @@ -96,7 +96,7 @@ uninspected.diff = function(a, b) {
};

// Support trace, time, timeEnd etc.
Object.keys(originalConsole).forEach(function(key) {
Object.keys(originalConsole).forEach(key => {
if (typeof originalConsole[key] === 'function' && !uninspected[key]) {
uninspected[key] = function() {
// ...
Expand Down

0 comments on commit f083a24

Please sign in to comment.