pretty-format2
Advanced tools
Comparing version 1.1.0 to 1.1.1
24
index.js
@@ -210,3 +210,3 @@ // @flow | ||
push(value) { | ||
push(value /*: any */) { | ||
this.length = this.length + 1; | ||
@@ -216,3 +216,3 @@ this.items.push(value); | ||
pop(value) { | ||
pop() /*: any */ { | ||
this.length = this.length - 1; | ||
@@ -234,3 +234,3 @@ return this.items.pop(); | ||
char(value) { | ||
char(value /*: string */) { | ||
this.push(new Char(value)); | ||
@@ -240,5 +240,9 @@ } | ||
/*:: | ||
export type { Stack }; | ||
*/ | ||
class Refs { | ||
/*:: | ||
layers: Array<Set<mixed>>; | ||
layers: Array<Set<any>>; | ||
*/ | ||
@@ -371,3 +375,3 @@ | ||
function filterSymbol(val) { | ||
function filterSymbol(val /*: mixed */) { | ||
let typeOf = typeof val; | ||
@@ -379,3 +383,3 @@ return typeOf !== 'symbol' && toString.call(val) !== '[object Symbol]'; | ||
let keys = Object.keys(value).sort(); | ||
let symbols = getSymbols(value); | ||
let symbols /*: Array<any> */ = getSymbols(value); | ||
if (symbols.length) { | ||
@@ -390,3 +394,3 @@ keys = keys.filter(filterSymbol).concat(symbols); | ||
stack.push(OBJECT_OPEN); | ||
stack.push(new Char(value.constructor ? value.constructor.name : 'Object')); | ||
stack.push(new Char(typeof value.constructor === 'function' ? value.constructor.name : 'Object')); | ||
} | ||
@@ -528,3 +532,5 @@ } | ||
if (value instanceof Error) return printError(value); | ||
if (value instanceof Error) { | ||
return printError(value); | ||
} | ||
@@ -673,4 +679,2 @@ return printObject(value, stack, env); | ||
prettyFormat.printSeries = printSeries; | ||
module.exports = prettyFormat; |
{ | ||
"name": "pretty-format2", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Stringify any value. Better, faster, prettier.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
17741
556