|
PythonMonkey v0.9.1 (dev)
|
Functions | |
| function | join (output, separator) |
| function | isError (e) |
| function | isDate (o) |
| function | isSet (o) |
| function | isMap (o) |
| function | isDataView (o) |
| function | isExternal (o) |
| function | objectToString (o) |
| function | getConstructorOf (obj) |
| function | colour (colourCode, val) |
| function | strEscape (str) |
| function | tryStringify (arg) |
| function | format (f) |
| function | inspect (obj, opts=undefined) |
| Object | defineProperty (inspect, 'defaultOptions', { get() { return inspectDefaultOptions;}, set(options) { if(options===null||typeof options !=='object') { throw new TypeError('"options" must be an object');} Object.assign(inspectDefaultOptions, options);} }) |
| function | stylizeWithColor (str, styleType) |
| function | stylizeNoColor (str, styleType) |
| function | formatValue (ctx, value, recurseTimes, ln) |
Variables | |
| const | internalBinding = require('internal-binding') |
| const | |
| const | customInspectSymbol = Symbol.for('nodejs.util.inspect.custom') |
| const | kPending = 0 |
| const | kFulfilled = 1 |
| const | kRejected = 2 |
| const | inspectDefaultOptions |
| const | propertyIsEnumerable = Object.prototype.propertyIsEnumerable |
| const | regExpToString = RegExp.prototype.toString |
| const | dateToISOString = Date.prototype.toISOString |
| let | CIRCULAR_ERROR_MESSAGE |
| const | strEscapeSequencesRegExp = /[\x00-\x1f\x27\x5c]/ |
| const | strEscapeSequencesReplacer = /[\x00-\x1f\x27\x5c]/g |
| const | colorRegExp = /\u001b\[\d\d?m/g |
| const | keyStrRegExp = /^[a-zA-Z_][a-zA-Z_0-9]*$/ |
| const | numberRegExp = /^(0|[1-9][0-9]*)$/ |
| const | meta |
| const | escapeFn = (str) => meta[str.charCodeAt(0)] |
| inspect | custom = customInspectSymbol |
| inspect | colors |
| inspect | styles |
Node.js-style util.inspect implementation, largely based on https://github.com/nodejs/node/blob/v8.17.0/lib/util.js.
| function colour | ( | colourCode, | |
| val | |||
| ) |
Return String(val) surrounded by appropriate ANSI escape codes to change the console text colour.
| Object defineProperty | ( | inspect | , |
| 'defaultOptions' | , | ||
| { get() { return inspectDefaultOptions;}, set(options) { if(options===null||typeof options !=='object') { throw new TypeError('"options" must be an object');} Object.assign(inspectDefaultOptions, options);} } | |||
| ) |
| function format | ( | f | ) |
| function formatValue | ( | ctx, | |
| value, | |||
| recurseTimes, | |||
| ln | |||
| ) |
Format an instance of Error. Error is the only type which is typically displayed using two different colours – the stack gets darker at the bottom where it's less relevant.
| ctx | {object} inspect context - lets us know if we're using colors or not |
| error | {object} instance of Error to inspect |
| function getConstructorOf | ( | obj | ) |
| function inspect | ( | obj, | |
opts = undefined |
|||
| ) |
Echos the value of a value. Tries to print the value out in the best way possible given the different types.
| {Object} | obj The object to print out. |
| {Object} | opts Optional options object that alters the output. |
| function isDataView | ( | o | ) |
| function isDate | ( | o | ) |
| function isError | ( | e | ) |
| function isExternal | ( | o | ) |
V8 IsJSExternalObject
| function isMap | ( | o | ) |
| function isSet | ( | o | ) |
| function join | ( | output, | |
| separator | |||
| ) |
| {string[]} | output |
| {string} | separator |
| function objectToString | ( | o | ) |
| function strEscape | ( | str | ) |
| function stylizeNoColor | ( | str, | |
| styleType | |||
| ) |
| function stylizeWithColor | ( | str, | |
| styleType | |||
| ) |
| function tryStringify | ( | arg | ) |
| let CIRCULAR_ERROR_MESSAGE |
| const colorRegExp = /\u001b\[\d\d?m/g |
| inspect colors |
| const |
| inspect custom = customInspectSymbol |
| const customInspectSymbol = Symbol.for('nodejs.util.inspect.custom') |
| const dateToISOString = Date.prototype.toISOString |
| const inspectDefaultOptions |
| const keyStrRegExp = /^[a-zA-Z_][a-zA-Z_0-9]*$/ |
| const kFulfilled = 1 |
@type {PromiseState.Fulfilled}
| const kPending = 0 |
@type {PromiseState.Pending}
| const kRejected = 2 |
@type {PromiseState.Rejected}
| const meta |
| const numberRegExp = /^(0|[1-9][0-9]*)$/ |
| const propertyIsEnumerable = Object.prototype.propertyIsEnumerable |
| const regExpToString = RegExp.prototype.toString |
| const strEscapeSequencesRegExp = /[\x00-\x1f\x27\x5c]/ |
| const strEscapeSequencesReplacer = /[\x00-\x1f\x27\x5c]/g |
| inspect styles |