UNPKG

dtrim

Version:

A tool for trimming deep/lenghty javascript structures. Some potential usages are: debugging, logging or data sanitization.

419 lines 15.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = { config: { transformRequest: {}, transformResponse: {}, timeout: 5000, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, headers: { Accept: 'application/json, text/plain, */*', 'Content-Type': 'multipart/form111-data; boundary=--------------------------0123456789', 'user-agent': 'curl', 'x-request-id': 'afe950b4-30f0-4dc0-a4c7-349e5c1216d6', authorization: 'Bearer abcdef', }, method: 'post', baseURL: 'http://example.xyz', url: 'http://example.xyz/foo/bar', data: { _overheadLength: 283, _valueLength: 9523, _valuesToMeasure: [], writable: false, readable: true, dataSize: 0, maxDataSize: 2097152, pauseStreams: true, _released: true, _streams: [], _currentStream: null, _boundary: '--------------------------0123456789', _events: {}, _eventsCount: 0, }, }, request: { domain: null, _events: {}, _eventsCount: 6, output: [], outputEncodings: [], outputCallbacks: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: true, shouldKeepAlive: false, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: null, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: { connecting: false, _hadError: false, _handle: { reading: true, onconnection: null }, _parent: null, _host: 'example.xyz', _readableState: { objectMode: false, highWaterMark: 16384, buffer: { head: null, tail: null, length: 0 }, length: 0, pipes: null, pipesCount: 0, flowing: true, ended: false, endEmitted: false, reading: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, emitClose: false, destroyed: false, defaultEncoding: 'utf8', awaitDrain: 0, readingMore: false, decoder: null, encoding: null, }, readable: true, domain: null, _events: { close: [null, null] }, _eventsCount: 7, _writableState: { objectMode: false, highWaterMark: 16384, finalCalled: true, needDrain: false, ending: true, ended: true, finished: false, destroyed: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, writecb: null, writelen: 0, bufferedRequest: null, lastBufferedRequest: null, pendingcb: 1, prefinished: false, errorEmitted: false, emitClose: false, bufferedRequestCount: 0, corkedRequestsFree: { next: { next: null, entry: null }, entry: null }, }, writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: '~request', }, connection: '~request~socket', _header: 'POST /foo/bar HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: multipart/form111-data; ' + 'boundary=--------------------------0123456789\r\nuser-agent: curl/empty\r\nx-request-id: ' + 'afe950b4-30f0-4dc0-a4c7-349e5c1216d6\r\nauthorization: Bearer abcdef\r\nHost: example.xyz\r\nConnection: ' + 'close\r\nTransfer-Encoding: chunked\r\n\r\n', agent: { domain: null, _events: {}, _eventsCount: 1, defaultPort: 80, protocol: 'http:', options: { path: null }, requests: {}, sockets: { 'example.xyz:80:': ['~request~socket'], }, freeSockets: {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: null, maxFreeSockets: 256, }, method: 'POST', path: '/foo/bar', _ended: true, res: { _readableState: { objectMode: false, highWaterMark: 16384, buffer: { head: null, tail: null, length: 0 }, length: 0, pipes: null, pipesCount: 0, flowing: true, ended: true, endEmitted: true, reading: false, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, emitClose: true, destroyed: false, defaultEncoding: 'utf8', awaitDrain: 0, readingMore: true, decoder: null, encoding: null, }, readable: false, domain: null, _events: { end: [null, null] }, _eventsCount: 3, socket: '~request~socket', connection: '~request~socket', httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, headers: { 'content-type': 'text/plain; charset=utf-8', date: 'Thu, 27 Dec 2018 00:01:10 GMT', 'content-length': '0', connection: 'Close', }, rawHeaders: [ 'Content-Type', 'text/plain; charset=utf-8', 'Date', 'Thu, 27 Dec 2018 00:01:10 GMT', 'Content-Length', '0', 'Connection', 'Close', ], trailers: {}, rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 500, statusMessage: 'Internal Server Error', client: '~request~socket', _consuming: false, _dumped: false, req: '~request', responseUrl: 'http://example.xyz/foo/bar', redirects: [], }, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, _redirectable: { _writableState: { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, writecb: null, writelen: 0, bufferedRequest: null, lastBufferedRequest: null, pendingcb: 0, prefinished: false, errorEmitted: false, emitClose: true, bufferedRequestCount: 0, corkedRequestsFree: { next: null, entry: null }, }, writable: true, domain: null, _events: {}, _eventsCount: 2, _options: { protocol: 'http:', maxRedirects: 21, maxBodyLength: 10485760, path: '/foo/bar', method: 'post', headers: '~config~headers', hostname: 'example.xyz', port: null, nativeProtocols: { 'http:': { METHODS: [ 'ACL', 'BIND', 'CHECKOUT', 'CONNECT', 'COPY', 'DELETE', 'GET', 'HEAD', 'LINK', 'LOCK', 'M-SEARCH', 'MERGE', 'MKACTIVITY', 'MKCALENDAR', 'MKCOL', 'MOVE', 'NOTIFY', 'OPTIONS', 'PATCH', 'POST', 'PROPFIND', 'PROPPATCH', 'PURGE', 'PUT', 'REBIND', 'REPORT', 'SEARCH', 'SOURCE', 'SUBSCRIBE', 'TRACE', 'UNBIND', 'UNLINK', 'UNLOCK', 'UNSUBSCRIBE', ], STATUS_CODES: { 100: 'Continue', 101: 'Switching Protocols', 102: 'Processing', 103: 'Early Hints', 200: 'OK', 201: 'Created', 202: 'Accepted', 203: 'Non-Authoritative Information', 204: 'No Content', 205: 'Reset Content', 206: 'Partial Content', 207: 'Multi-Status', 208: 'Already Reported', 226: 'IM Used', 300: 'Multiple Choices', 301: 'Moved Permanently', 302: 'Found', 303: 'See Other', 304: 'Not Modified', 305: 'Use Proxy', 307: 'Temporary Redirect', 308: 'Permanent Redirect', 400: 'Bad Request', 401: 'Unauthorized', 402: 'Payment Required', 403: 'Forbidden', 404: 'Not Found', 405: 'Method Not Allowed', 406: 'Not Acceptable', 407: 'Proxy Authentication Required', 408: 'Request Timeout', 409: 'Conflict', 410: 'Gone', 411: 'Length Required', 412: 'Precondition Failed', 413: 'Payload Too Large', 414: 'URI Too Long', 415: 'Unsupported Media Type', 416: 'Range Not Satisfiable', 417: 'Expectation Failed', 418: "I'm a Teapot", 421: 'Misdirected Request', 422: 'Unprocessable Entity', 423: 'Locked', 424: 'Failed Dependency', 425: 'Unordered Collection', 426: 'Upgrade Required', 428: 'Precondition Required', 429: 'Too Many Requests', 431: 'Request Header Fields Too Large', 451: 'Unavailable For Legal Reasons', 500: 'Internal Server Error', 501: 'Not Implemented', 502: 'Bad Gateway', 503: 'Service Unavailable', 504: 'Gateway Timeout', 505: 'HTTP Version Not Supported', 506: 'Variant Also Negotiates', 507: 'Insufficient Storage', 508: 'Loop Detected', 509: 'Bandwidth Limit Exceeded', 510: 'Not Extended', 511: 'Network Authentication Required', }, globalAgent: '~request~agent', }, 'https:': { globalAgent: { domain: null, _events: {}, _eventsCount: 1, defaultPort: 443, protocol: 'https:', options: { path: null }, requests: {}, sockets: {}, freeSockets: {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: null, maxFreeSockets: 256, maxCachedSessions: 100, _sessionCache: { map: { 's3-ap-southeast-2.amazonaws.com:443::::::::::::::::': { type: 'Buffer', data: Buffer.alloc(2048), }, }, list: ['s3-ap-southeast-2.amazonaws.com:443::::::::::::::::'], }, }, }, }, pathname: '/foo/bar', }, _redirectCount: 0, _redirects: '~request~res~redirects', _requestBodyLength: 9862, _requestBodyBuffers: [], _currentRequest: '~request', _currentUrl: 'http://example.xyz/foo/bar', }, }, response: { status: 500, statusText: 'Internal Server Error', headers: '~request~res~headers', config: '~config', request: '~request', data: '', }, }; //# sourceMappingURL=fixture-real-world.js.map