Comparing version 1.1.1 to 1.2.0
{ | ||
"name": "dumper.js", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "A better and pretty variable inspector for your Node.js applications.", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/zeeshanu/dumper.js.git" | ||
"url": "git+https://github.com/ziishaned/dumper.js.git" | ||
}, | ||
@@ -25,12 +25,12 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/zeeshanu/dumper.js/issues" | ||
"url": "https://github.com/ziishaned/dumper.js/issues" | ||
}, | ||
"homepage": "https://github.com/zeeshanu/dumper.js#readme", | ||
"homepage": "https://github.com/ziishaned/dumper.js#readme", | ||
"devDependencies": { | ||
"chai": "^4.1.2", | ||
"codecov": "^3.0.4", | ||
"eslint": "^5.2.0", | ||
"chai": "^4.2.0", | ||
"codecov": "^3.1.0", | ||
"eslint": "^5.6.1", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^5.2.0", | ||
"prettier": "^1.14.0" | ||
"prettier": "^1.14.3" | ||
}, | ||
@@ -41,4 +41,4 @@ "dependencies": { | ||
"kind-of": "^6.0.2", | ||
"kleur": "^2.0.1" | ||
"kleur": "^2.0.2" | ||
} | ||
} |
<h1 align="center"> | ||
<img height="150" src="https://cdn.rawgit.com/zeeshanu/dumper.js/master/logo.svg" alt="Dumper.js - Dumps information about a variable" /> | ||
<img height="150" src="https://cdn.rawgit.com/ziishaned/dumper.js/master/logo.svg" alt="Dumper.js - Dumps information about a variable" /> | ||
<br> Dumper.js | ||
</h1> | ||
<p align="center"> | ||
<a href="https://travis-ci.org/zeeshanu/dumper.js"> | ||
<img src="https://img.shields.io/travis/zeeshanu/dumper.js/master.svg?style=flat-square" alt="Build Status"> | ||
<a href="https://travis-ci.org/ziishaned/dumper.js"> | ||
<img src="https://img.shields.io/travis/ziishaned/dumper.js/master.svg?style=flat-square" alt="Build Status"> | ||
</a> | ||
<a href="https://github.com/zeeshanu/dumper.js"> | ||
<img src="https://img.shields.io/codecov/c/github/zeeshanu/dumper.js.svg?style=flat-square" alt="Codecov"> | ||
<a href="https://github.com/ziishaned/dumper.js"> | ||
<img src="https://img.shields.io/codecov/c/github/ziishaned/dumper.js.svg?style=flat-square" alt="Codecov"> | ||
</a> | ||
@@ -81,2 +81,2 @@ <a href="#"> | ||
MIT © [Zeeshan Ahmed](https://twitter.com/zeeshanu) | ||
MIT © [Zeeshan Ahmad](https://twitter.com/ziishaned) |
/* eslint-disable no-console */ | ||
const callerId = require('caller-id'); | ||
let Dumper = require('./dumper'); | ||
const Dumper = require('./dumper'); | ||
@@ -6,0 +6,0 @@ function dd(obj) { |
/* eslint-disable no-console */ | ||
const callerId = require('caller-id'); | ||
let Dumper = require('./dumper'); | ||
const Dumper = require('./dumper'); | ||
@@ -6,0 +6,0 @@ function dump(obj) { |
@@ -48,3 +48,3 @@ const kindOf = require('kind-of'); | ||
// preparing the inspection output | ||
for (let itemKey in toDump) { | ||
for (const itemKey in toDump) { | ||
if (!Object.prototype.hasOwnProperty.call(toDump, itemKey)) { | ||
@@ -93,2 +93,5 @@ continue; | ||
break; | ||
case 'undefined': | ||
displayValue = blue('undefined'); | ||
break; | ||
case 'number': | ||
@@ -125,15 +128,13 @@ displayType = Number.isInteger(originalValue) ? 'int' : 'float'; | ||
makeArrowString(paramType, indent, key, valueDump) { | ||
if (paramType === 'array') { | ||
if (typeof key === 'string') { | ||
return `${indent}${this.spaces}'${key}' => ${valueDump},\n`; | ||
} | ||
const startWith = `${indent}${this.spaces}`; | ||
const valuePart = `${valueDump},\n`; | ||
return `${indent}${this.spaces}[${key}] => ${valueDump},\n`; | ||
let keyPart; | ||
if (Number.isInteger(parseInt(key)) || (paramType === 'array' && typeof key !== 'string')) { | ||
keyPart = `[${key}]`; | ||
} else { | ||
keyPart = `'${key}'`; | ||
} | ||
if (Number.isInteger(parseInt(key))) { | ||
return `${indent}${this.spaces}[${key}] => ${valueDump},\n`; | ||
} | ||
return `${indent}${this.spaces}'${key}' => ${valueDump},\n`; | ||
return `${startWith + keyPart} => ${valuePart}`; | ||
} | ||
@@ -140,0 +141,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
71589
151
Updatedkleur@^2.0.2