Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

An option to respect Object.inspect() #28

Open
jmendeth opened this Issue · 1 comment

1 participant

@jmendeth

The original util.inspect always looks wether an object has the
inspect property defined as a function. If it is, then it calls it and
prints the result instead of the literal representation.

Classes like Buffer have inspect defined so when you do:

console.log( { some: Buffer(2) } )

you get:

{ some: <Buffer d0 c7> }

I think eyes should respect this, or at least have an option to
do so. The style applied should be the other style, since what
inspect returns is often not a literal representation.

@jmendeth

It definitively should. If you inspect the same as above with eyes, you get:

{
    some: {
        0: 28,
        1: 0,
        length: 2,
        parent: {
            0: 248,
            1: 78,
            2: 89,
            3: 197,
            4: 191,
            5: 127,
            6: 0,
            7: 0,
            8: 123,
            9: 10,
            10: 32,
            11: 32,
            12: 34,
            13: 110,
            14: 97,
            15: 109,
            16: 101,
            17: 34,
            18: 58,
            19: 32,
            20: 34,
            21: 101,
            22: 121,
            23: 101,
            24: 115,
            25: 34,
            26: 44,
            27: 10,
            28: 32,
            29: 32,
            30: 34,
            31: 100,
            32: 101,
            33: 115,
            34: 99,
            35: 114,
            36: 105,
            37: 112,
            38: 116,
            39: 105,
            40: 111,
            41: 110,
            42: 34,
            43: 58,
            44: 32,
            45: 34,
            46: 97,
            47: 32,
            48: 99,
            49: 117,
            50: 115,
            51: 116,
            52: 111,
            53: 109,
            54: 105,
            55: 122,
            56: 97,
            57: 98,
            58: 108,
            59: 101,
            60: 32,
            61: 118,
            62: 97,
            63: 108,
            64: 117,
            65: 101,
            66: 32,
            67: 105,
            68: 110,
            69: 115,
            70: 112,
            71: 101,
            72: 99,
            73: 116,
            74: 111,
            75: 114,
            76: 34,
            77: 44,
            78: 10,
            79: 32,
            80: 32,
            81: 34,
            82: 117,
            83: 114,
            84: 108,
            85: 34,
            86: 58,
            87: 32,
            88: 34,
            89: 104,
            90: 116,
            91: 116,
            92: 112,
            93: 58,
            94: 47,
            95: 47,
            96: 103,
            97: 105,
            98: 116,
            99: 104,
            100: 117,
         …

And it goes on and on...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.