@dxos/debug 0.8.4-main.fffef41 → 0.8.4-staging.60fe92afc8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/dist/lib/browser/index.mjs +3 -3
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +3 -3
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/assert.d.ts.map +1 -1
- package/dist/types/src/equality.d.ts.map +1 -1
- package/dist/types/src/error-handler.d.ts.map +1 -1
- package/dist/types/src/error-stream.d.ts.map +1 -1
- package/dist/types/src/exposed-modules.d.ts.map +1 -1
- package/dist/types/src/inspect.d.ts.map +1 -1
- package/dist/types/src/log-method.d.ts.map +1 -1
- package/dist/types/src/raise.d.ts.map +1 -1
- package/dist/types/src/snoop.d.ts.map +1 -1
- package/dist/types/src/stack-trace.d.ts.map +1 -1
- package/dist/types/src/strings.d.ts.map +1 -1
- package/dist/types/src/throw.d.ts.map +1 -1
- package/dist/types/src/timeout-warning.d.ts.map +1 -1
- package/dist/types/src/todo.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -6
- package/src/log-method.ts +2 -0
- package/src/snoop.ts +2 -0
- package/src/timeout-warning.ts +1 -0
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2022 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
|
@@ -229,7 +229,7 @@ var todo = (message) => {
|
|
|
229
229
|
};
|
|
230
230
|
|
|
231
231
|
// src/devtools-formatter.ts
|
|
232
|
-
var devtoolsFormatter = Symbol.for("devtoolsFormatter");
|
|
232
|
+
var devtoolsFormatter = /* @__PURE__ */ Symbol.for("devtoolsFormatter");
|
|
233
233
|
var register = () => {
|
|
234
234
|
if (typeof window !== "undefined") {
|
|
235
235
|
(window.devtoolsFormatters ??= []).push({
|
|
@@ -263,7 +263,7 @@ var register = () => {
|
|
|
263
263
|
register();
|
|
264
264
|
|
|
265
265
|
// src/equality.ts
|
|
266
|
-
var equalsSymbol = Symbol.for("dxos.common.equals");
|
|
266
|
+
var equalsSymbol = /* @__PURE__ */ Symbol.for("dxos.common.equals");
|
|
267
267
|
var isEquatable = (value) => {
|
|
268
268
|
return typeof value === "object" && value !== null && typeof value[equalsSymbol] === "function";
|
|
269
269
|
};
|
|
@@ -291,7 +291,7 @@ var importModule = (name) => {
|
|
|
291
291
|
var EXPOSED_MODULES = {};
|
|
292
292
|
|
|
293
293
|
// src/inspect-custom.ts
|
|
294
|
-
var inspectCustom = Symbol.for("nodejs.util.inspect.custom");
|
|
294
|
+
var inspectCustom = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
295
295
|
export {
|
|
296
296
|
ErrorHandler,
|
|
297
297
|
ErrorStream,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/assert.ts", "../../../src/error-handler.ts", "../../../src/error-stream.ts", "../../../src/fail.ts", "../../../src/inspect.ts", "../../../src/log-method.ts", "../../../src/raise.ts", "../../../src/snoop.ts", "../../../src/stack-trace.ts", "../../../src/strings.ts", "../../../src/throw.ts", "../../../src/timeout-warning.ts", "../../../src/todo.ts", "../../../src/devtools-formatter.ts", "../../../src/equality.ts", "../../../src/exposed-modules.ts", "../../../src/inspect-custom.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * A simple syntax sugar to write `value as T` as a statement.\n *\n * NOTE: This does not provide any type safety.\n * It's just for convenience so that autocomplete works for value.\n * It's recommended to check the type URL manually beforehand or use `assertAnyType` instead.\n * @param value\n */\nexport const checkType = <T>(value: T): T => value;\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { EventEmitter } from 'node:events';\n\n/**\n * Listens for global errors.\n */\nexport class ErrorHandler extends EventEmitter {\n _listener: EventListener;\n\n constructor() {\n super();\n\n this._listener = (event: any) => {\n const cause = event.error || event.reason || event;\n const message = cause.stack || cause.message || cause.toString();\n this.emit('error', message);\n\n // Default logging.\n // code event.preventDefault();\n };\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event\n window.addEventListener('error', this._listener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event\n window.addEventListener('unhandledrejection', this._listener);\n }\n\n reset(): void {\n window.removeEventListener('error', this._listener);\n window.removeEventListener('unhandledrejection', this._listener);\n }\n}\n", "//\n// Copyright 2021 DXOS.org\n//\n\nexport type ErrorHandlerCallback = (error: Error) => void;\n\n/**\n * Represents a stream of errors that entities can expose.\n */\nexport class ErrorStream {\n private _handler: ErrorHandlerCallback | undefined;\n\n private _unhandledErrors = 0;\n\n assertNoUnhandledErrors(): void {\n if (this._unhandledErrors > 0) {\n throw new Error(\n `Assertion failed: expected no unhandled errors to be thrown, but ${this._unhandledErrors} were thrown.`,\n );\n }\n }\n\n raise(error: Error): void {\n if (this._handler) {\n this._handler(error);\n } else {\n this._unhandledError(error);\n }\n }\n\n handle(handler: ErrorHandlerCallback): void {\n this._handler = handler;\n }\n\n pipeTo(receiver: ErrorStream): void {\n this.handle((error) => receiver.raise(error));\n }\n\n private _unhandledError(error: Error): void {\n this._unhandledErrors++;\n\n setTimeout(() => {\n throw error;\n });\n }\n}\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * Should be used in expressions where values are cheked not to be null or undefined.\n *\n * Example:\n *\n * ```\n * const value: string | undefined;\n *\n * callMethod(value ?? failUndefined());\n * ```\n */\n// TODO(burdon): Rename failIfUndefined().\nexport const failUndefined = () => {\n throw new Error('Required value was null or undefined.');\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { inspect } from 'node:util';\n\n/**\n * Utility to automatically log debug info.\n *\n * ```\n * // Called via `console.log`.\n * [inspect.custom] () {\n * return inspectObject(this);\n * }\n *\n * // Called via `JSON.stringify`.\n * toJSON () {\n * return { ... };\n * }\n * ```\n */\nexport const inspectObject = (obj: any) => {\n const name = Object.getPrototypeOf(obj).constructor.name;\n return obj.toJSON ? `${name}(${inspect(obj.toJSON())})` : String(obj);\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\nexport function logMethod(\n target: any,\n propertyName: string,\n descriptor: TypedPropertyDescriptor<(...args: any) => any>,\n): void {\n const method = descriptor.value!;\n descriptor.value = function (this: any, ...args: any) {\n console.log(`Called ${target.constructor.name}.${propertyName} ${args}`);\n try {\n const result = method.apply(this, args);\n if (typeof result.catch === 'function') {\n result.catch((err: any) => {\n console.log(`Rejected ${target.constructor.name}.${propertyName}`, err);\n });\n }\n return result;\n } catch (err: any) {\n console.log(`Thrown ${target.constructor.name}.${propertyName}`, err);\n throw err;\n }\n };\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Immediatelly throws an error passed as an argument.\n *\n * Usefull for throwing errors from inside expressions.\n * For example:\n * ```\n * const item = model.getById(someId) ?? raise(new Error('Not found'));\n * ```\n * @param error\n */\nexport const raise = (error: Error): never => {\n throw error;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport enum SnoopLevel {\n DEFAULT = 0,\n VERBOSE = 1,\n BOLD = 2,\n}\n\n/**\n * Utils for debug logging of functions.\n */\n// TODO(burdon): Integrate with log/spyglass.\nexport class Snoop {\n static stackFunction(err: Error): string | undefined {\n const stack = err.stack!.split('\\n');\n const match = stack[2].match(/.+\\((.+)\\).*/);\n if (match) {\n const [file, line] = match[1].split(':');\n return `[${file.substring(file.lastIndexOf('/') + 1)}:${line}]`;\n }\n }\n\n constructor(private readonly _context?: string) {}\n\n get verbose() {\n return SnoopLevel.VERBOSE;\n }\n\n get bold() {\n return SnoopLevel.BOLD;\n }\n\n format(prefix: string, name: string, args: string, level: SnoopLevel): string {\n const pre = prefix.repeat(level === SnoopLevel.BOLD ? 8 : 2);\n const label = this._context ? `${this._context}.${name}` : name;\n const line = `${pre} ${label}${args}`;\n return level === SnoopLevel.BOLD ? [pre, line, pre].join('\\n') : line;\n }\n\n in(label: string, level: SnoopLevel, ...args: any[]): string {\n return this.format('<', label, level === SnoopLevel.DEFAULT ? '' : `(${String(...args)})`, level);\n }\n\n out(label: string, level: SnoopLevel, result: any): string {\n return this.format('>', label, level === SnoopLevel.DEFAULT ? '' : ` = ${String(result)}`, level);\n }\n\n sync(f: any, label?: string, level: SnoopLevel = SnoopLevel.VERBOSE) {\n label = label ?? Snoop.stackFunction(new Error());\n return (...args: any[]) => {\n console.log(this.in(label ?? '', level, ...args));\n const r = f(...args);\n console.log(this.out(label ?? '', level, r));\n return r;\n };\n }\n\n async(f: any, label?: string, level: SnoopLevel = SnoopLevel.VERBOSE) {\n label = label ?? Snoop.stackFunction(new Error());\n return async (...args: any[]) => {\n console.log(this.in(label ?? '', level, ...args));\n const r = await f(...args);\n console.log(this.out(label ?? '', level, r));\n return r;\n };\n }\n}\n\nexport const snoop = new Snoop();\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * Will capture the stack trace at the point where the class is created.\n * Stack traces are formatted lazily only when `getStack` is called.\n * Formatting is significantly more expensive than capture so only call getStack when you need them.\n */\nexport class StackTrace {\n private _stack: Error;\n\n constructor() {\n this._stack = new Error();\n }\n\n /**\n * Get stack formatted as string.\n * @param skipFrames Number of frames to skip. By default, the first frame would be the invocation of the StackTrace constructor.\n * @returns\n */\n getStack(skipFrames = 0): string {\n const stack = this._stack.stack!.split('\\n');\n return stack.slice(skipFrames + 2).join('\\n');\n }\n\n getStackArray(skipFrames = 0): string[] {\n const stack = this._stack.stack!.split('\\n');\n return stack.slice(skipFrames + 2);\n }\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\nexport const truncate = (str = '', length = 8, pad: boolean | string = false) => {\n if (str.length >= length - 1) {\n return str.substring(0, length - 1) + '…';\n } else {\n return pad ? str.padEnd(length, typeof pad === 'boolean' ? ' ' : pad[0]) : str;\n }\n};\n\nexport const truncateKey = (key: any, length = 8) => {\n const str = String(key);\n if (str.length <= length) {\n return str;\n }\n\n return str.slice(0, length);\n\n // return start\n // ? `${str.slice(0, length)}...`\n // : `${str.substring(0, length / 2)}...${str.substring(str.length - length / 2)}`;\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Wrapper for async tests.\n * @param {Function} test - Async test\n * @param errType\n * @return {Promise<void>}\n *\n * @deprecated Use vitests `expect(() => ...).toThrowError();` instead.\n */\nexport const expectToThrow = async (test: () => void, errType = Error) => {\n let thrown;\n try {\n await test();\n } catch (err) {\n thrown = err;\n }\n\n if (thrown === undefined || !(thrown instanceof errType)) {\n throw new Error(`Expected function to throw instance of ${errType.prototype.name}`);\n }\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { StackTrace } from './stack-trace';\n\n/**\n * Prints a warning to console if the action takes longer then specified timeout. No errors are thrown.\n *\n * @param timeout Timeout in milliseconds after which warning is printed.\n * @param context Context description that would be included in the printed message.\n * @param body Action which is timed.\n */\nexport const warnAfterTimeout = async <T>(timeout: number, context: string, body: () => Promise<T>): Promise<T> => {\n const stack = new StackTrace();\n const timeoutId = setTimeout(() => {\n console.warn(\n `Action \\`${context}\\` is taking more then ${timeout.toLocaleString()}ms to complete. This might be a bug.\\n${stack.getStack()}`,\n );\n }, timeout);\n try {\n return await body();\n } finally {\n clearTimeout(timeoutId);\n }\n};\n\n/**\n * A decorator that prints a warning to console if method execution time exceeds specified timeout.\n *\n * ```typescript\n * class Foo {\n * @timed(5_000)\n * async doStuff() {\n * // long task\n * }\n * }\n * ```\n *\n * This is useful for debugging code that might deadlock.\n *\n * @param timeout Timeout in milliseconds after which the warning is printed.\n */\nexport function timed(timeout: number) {\n return (target: any, propertyName: string, descriptor: TypedPropertyDescriptor<(...args: any) => any>) => {\n const method = descriptor.value!;\n descriptor.value = function (this: any, ...args: any) {\n return warnAfterTimeout(timeout, `${target.constructor.name}.${propertyName}`, () => method.apply(this, args));\n };\n };\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Throws an error. Can be used in an expression instead of a value\n */\nexport const todo = (message?: string): never => {\n throw new Error(message ?? 'Not implemented.');\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Lets types provide custom formatters for the Chrome Devtools.\n *\n * https://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html\n * NOTE: Must be enabled in chrome devtools preferences.\n *\n * @example\n * ```typescript\n * class MyType {\n * get [devtoolsFormatter] (): DevtoolsFormatter {\n * ...\n * }\n * ```\n */\n\nexport const devtoolsFormatter = Symbol.for('devtoolsFormatter');\n\nexport type JsonML = [string, Record<string, any>?, ...(JsonML | string)[]];\n\nexport interface DevtoolsFormatter {\n /**\n * NOTE: Make sure to do an instance check and return null if the object is not of the correct type.\n */\n header: (config?: any) => JsonML | null;\n hasBody?: (config?: any) => boolean;\n body?: (config?: any) => JsonML | null;\n}\n\n/**\n * Types that implement this interface can provide custom formatters for the Chrome Devtools.\n *\n * https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n */\nexport interface CustomDevtoolsFormattable {\n get [devtoolsFormatter](): DevtoolsFormatter;\n}\n\nconst register = () => {\n if (typeof window !== 'undefined') {\n ((window as any).devtoolsFormatters ??= []).push({\n header: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (formatter === undefined) {\n return null;\n }\n if (typeof formatter !== 'object' || formatter === null || typeof formatter.header !== 'function') {\n throw new Error(`Invalid devtools formatter for ${value.constructor.name}`);\n }\n\n return formatter.header(config);\n },\n hasBody: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (!formatter || !formatter.hasBody) {\n return false;\n }\n\n return formatter.hasBody(config);\n },\n body: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (!formatter || !formatter.body) {\n return null;\n }\n\n return formatter.body(config);\n },\n });\n }\n};\n\nregister();\n", "//\n// Copyright 2023 DXOS.org\n//\n\nexport const equalsSymbol = Symbol.for('dxos.common.equals');\n\nexport interface Equatable {\n [equalsSymbol]: (other: any) => boolean;\n}\n\n// TODO(dmaretskyi): export to @dxos/traits.\n// TODO(dmaretskyi): Hash trait for maps?\n\nexport const isEquatable = (value: any): value is Equatable => {\n return typeof value === 'object' && value !== null && typeof value[equalsSymbol] === 'function';\n};\n\nexport const isEqual = (value: Equatable, other: any) => {\n return value[equalsSymbol](other);\n};\n\n/**\n * Feed this as a third argument to `_.isEqualWith` to compare objects with `Equatable` interface.\n */\nexport const loadashEqualityFn = (value: any, other: any): boolean | undefined => {\n if (!isEquatable(value)) {\n return undefined;\n }\n return isEqual(value, other);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\n/**\n * Allows to register a module to be used later during debugging.\n *\n * ```ts\n * import * as keys from '@dxos/keys';\n * exposeModule('@dxos/keys', keys);\n *\n * ...\n *\n * const { PublicKey } = importModule('@dxos/keys');\n * ```\n *\n * Overwrites the module if it already exists.\n */\nexport const exposeModule = (name: string, module: any) => {\n EXPOSED_MODULES[name] = module;\n};\n\n/**\n * Imports a previously exposed module by its name.\n * Throws an error if the module is not found.\n *\n * @param {string} name - The name of the module to import.\n * @returns {any} The imported module.\n * @throws {Error} If the module is not exposed.\n */\nexport const importModule = (name: string) => {\n if (EXPOSED_MODULES[name]) {\n return EXPOSED_MODULES[name];\n } else {\n throw new Error(`Module ${name} is not exposed.`);\n }\n};\n\nconst EXPOSED_MODULES: Record<string, any> = {};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { InspectOptionsStylized, inspect as inspectFn } from 'node:util';\n\n/**\n * Using this allows code to be written in a portable fashion, so that the custom inspect function is used in an Node.js environment and ignored in the browser.\n */\nexport const inspectCustom = Symbol.for('nodejs.util.inspect.custom');\n\nexport type CustomInspectFunction<T = any> = (\n this: T,\n depth: number,\n options: InspectOptionsStylized,\n inspect: typeof inspectFn,\n) => any; // TODO: , inspect: inspect\n\nexport interface CustomInspectable {\n [inspectCustom]: CustomInspectFunction;\n}\n"],
|
|
5
|
-
"mappings": ";AAYO,IAAMA,YAAY,CAAIC,UAAgBA;;;ACR7C,SAASC,oBAAoB;AAKtB,IAAMC,eAAN,
|
|
6
|
-
"names": ["checkType", "value", "EventEmitter", "ErrorHandler", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * A simple syntax sugar to write `value as T` as a statement.\n *\n * NOTE: This does not provide any type safety.\n * It's just for convenience so that autocomplete works for value.\n * It's recommended to check the type URL manually beforehand or use `assertAnyType` instead.\n * @param value\n */\nexport const checkType = <T>(value: T): T => value;\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { EventEmitter } from 'node:events';\n\n/**\n * Listens for global errors.\n */\nexport class ErrorHandler extends EventEmitter {\n _listener: EventListener;\n\n constructor() {\n super();\n\n this._listener = (event: any) => {\n const cause = event.error || event.reason || event;\n const message = cause.stack || cause.message || cause.toString();\n this.emit('error', message);\n\n // Default logging.\n // code event.preventDefault();\n };\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event\n window.addEventListener('error', this._listener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event\n window.addEventListener('unhandledrejection', this._listener);\n }\n\n reset(): void {\n window.removeEventListener('error', this._listener);\n window.removeEventListener('unhandledrejection', this._listener);\n }\n}\n", "//\n// Copyright 2021 DXOS.org\n//\n\nexport type ErrorHandlerCallback = (error: Error) => void;\n\n/**\n * Represents a stream of errors that entities can expose.\n */\nexport class ErrorStream {\n private _handler: ErrorHandlerCallback | undefined;\n\n private _unhandledErrors = 0;\n\n assertNoUnhandledErrors(): void {\n if (this._unhandledErrors > 0) {\n throw new Error(\n `Assertion failed: expected no unhandled errors to be thrown, but ${this._unhandledErrors} were thrown.`,\n );\n }\n }\n\n raise(error: Error): void {\n if (this._handler) {\n this._handler(error);\n } else {\n this._unhandledError(error);\n }\n }\n\n handle(handler: ErrorHandlerCallback): void {\n this._handler = handler;\n }\n\n pipeTo(receiver: ErrorStream): void {\n this.handle((error) => receiver.raise(error));\n }\n\n private _unhandledError(error: Error): void {\n this._unhandledErrors++;\n\n setTimeout(() => {\n throw error;\n });\n }\n}\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * Should be used in expressions where values are cheked not to be null or undefined.\n *\n * Example:\n *\n * ```\n * const value: string | undefined;\n *\n * callMethod(value ?? failUndefined());\n * ```\n */\n// TODO(burdon): Rename failIfUndefined().\nexport const failUndefined = () => {\n throw new Error('Required value was null or undefined.');\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { inspect } from 'node:util';\n\n/**\n * Utility to automatically log debug info.\n *\n * ```\n * // Called via `console.log`.\n * [inspect.custom] () {\n * return inspectObject(this);\n * }\n *\n * // Called via `JSON.stringify`.\n * toJSON () {\n * return { ... };\n * }\n * ```\n */\nexport const inspectObject = (obj: any) => {\n const name = Object.getPrototypeOf(obj).constructor.name;\n return obj.toJSON ? `${name}(${inspect(obj.toJSON())})` : String(obj);\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nexport function logMethod(\n target: any,\n propertyName: string,\n descriptor: TypedPropertyDescriptor<(...args: any) => any>,\n): void {\n const method = descriptor.value!;\n descriptor.value = function (this: any, ...args: any) {\n console.log(`Called ${target.constructor.name}.${propertyName} ${args}`);\n try {\n const result = method.apply(this, args);\n if (typeof result.catch === 'function') {\n result.catch((err: any) => {\n console.log(`Rejected ${target.constructor.name}.${propertyName}`, err);\n });\n }\n return result;\n } catch (err: any) {\n console.log(`Thrown ${target.constructor.name}.${propertyName}`, err);\n throw err;\n }\n };\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Immediatelly throws an error passed as an argument.\n *\n * Usefull for throwing errors from inside expressions.\n * For example:\n * ```\n * const item = model.getById(someId) ?? raise(new Error('Not found'));\n * ```\n * @param error\n */\nexport const raise = (error: Error): never => {\n throw error;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nexport enum SnoopLevel {\n DEFAULT = 0,\n VERBOSE = 1,\n BOLD = 2,\n}\n\n/**\n * Utils for debug logging of functions.\n */\n// TODO(burdon): Integrate with log/spyglass.\nexport class Snoop {\n static stackFunction(err: Error): string | undefined {\n const stack = err.stack!.split('\\n');\n const match = stack[2].match(/.+\\((.+)\\).*/);\n if (match) {\n const [file, line] = match[1].split(':');\n return `[${file.substring(file.lastIndexOf('/') + 1)}:${line}]`;\n }\n }\n\n constructor(private readonly _context?: string) {}\n\n get verbose() {\n return SnoopLevel.VERBOSE;\n }\n\n get bold() {\n return SnoopLevel.BOLD;\n }\n\n format(prefix: string, name: string, args: string, level: SnoopLevel): string {\n const pre = prefix.repeat(level === SnoopLevel.BOLD ? 8 : 2);\n const label = this._context ? `${this._context}.${name}` : name;\n const line = `${pre} ${label}${args}`;\n return level === SnoopLevel.BOLD ? [pre, line, pre].join('\\n') : line;\n }\n\n in(label: string, level: SnoopLevel, ...args: any[]): string {\n return this.format('<', label, level === SnoopLevel.DEFAULT ? '' : `(${String(...args)})`, level);\n }\n\n out(label: string, level: SnoopLevel, result: any): string {\n return this.format('>', label, level === SnoopLevel.DEFAULT ? '' : ` = ${String(result)}`, level);\n }\n\n sync(f: any, label?: string, level: SnoopLevel = SnoopLevel.VERBOSE) {\n label = label ?? Snoop.stackFunction(new Error());\n return (...args: any[]) => {\n console.log(this.in(label ?? '', level, ...args));\n const r = f(...args);\n console.log(this.out(label ?? '', level, r));\n return r;\n };\n }\n\n async(f: any, label?: string, level: SnoopLevel = SnoopLevel.VERBOSE) {\n label = label ?? Snoop.stackFunction(new Error());\n return async (...args: any[]) => {\n console.log(this.in(label ?? '', level, ...args));\n const r = await f(...args);\n console.log(this.out(label ?? '', level, r));\n return r;\n };\n }\n}\n\nexport const snoop = new Snoop();\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * Will capture the stack trace at the point where the class is created.\n * Stack traces are formatted lazily only when `getStack` is called.\n * Formatting is significantly more expensive than capture so only call getStack when you need them.\n */\nexport class StackTrace {\n private _stack: Error;\n\n constructor() {\n this._stack = new Error();\n }\n\n /**\n * Get stack formatted as string.\n * @param skipFrames Number of frames to skip. By default, the first frame would be the invocation of the StackTrace constructor.\n * @returns\n */\n getStack(skipFrames = 0): string {\n const stack = this._stack.stack!.split('\\n');\n return stack.slice(skipFrames + 2).join('\\n');\n }\n\n getStackArray(skipFrames = 0): string[] {\n const stack = this._stack.stack!.split('\\n');\n return stack.slice(skipFrames + 2);\n }\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\nexport const truncate = (str = '', length = 8, pad: boolean | string = false) => {\n if (str.length >= length - 1) {\n return str.substring(0, length - 1) + '…';\n } else {\n return pad ? str.padEnd(length, typeof pad === 'boolean' ? ' ' : pad[0]) : str;\n }\n};\n\nexport const truncateKey = (key: any, length = 8) => {\n const str = String(key);\n if (str.length <= length) {\n return str;\n }\n\n return str.slice(0, length);\n\n // return start\n // ? `${str.slice(0, length)}...`\n // : `${str.substring(0, length / 2)}...${str.substring(str.length - length / 2)}`;\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Wrapper for async tests.\n * @param {Function} test - Async test\n * @param errType\n * @return {Promise<void>}\n *\n * @deprecated Use vitests `expect(() => ...).toThrowError();` instead.\n */\nexport const expectToThrow = async (test: () => void, errType = Error) => {\n let thrown;\n try {\n await test();\n } catch (err) {\n thrown = err;\n }\n\n if (thrown === undefined || !(thrown instanceof errType)) {\n throw new Error(`Expected function to throw instance of ${errType.prototype.name}`);\n }\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { StackTrace } from './stack-trace';\n\n/**\n * Prints a warning to console if the action takes longer then specified timeout. No errors are thrown.\n *\n * @param timeout Timeout in milliseconds after which warning is printed.\n * @param context Context description that would be included in the printed message.\n * @param body Action which is timed.\n */\nexport const warnAfterTimeout = async <T>(timeout: number, context: string, body: () => Promise<T>): Promise<T> => {\n const stack = new StackTrace();\n const timeoutId = setTimeout(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `Action \\`${context}\\` is taking more then ${timeout.toLocaleString()}ms to complete. This might be a bug.\\n${stack.getStack()}`,\n );\n }, timeout);\n try {\n return await body();\n } finally {\n clearTimeout(timeoutId);\n }\n};\n\n/**\n * A decorator that prints a warning to console if method execution time exceeds specified timeout.\n *\n * ```typescript\n * class Foo {\n * @timed(5_000)\n * async doStuff() {\n * // long task\n * }\n * }\n * ```\n *\n * This is useful for debugging code that might deadlock.\n *\n * @param timeout Timeout in milliseconds after which the warning is printed.\n */\nexport function timed(timeout: number) {\n return (target: any, propertyName: string, descriptor: TypedPropertyDescriptor<(...args: any) => any>) => {\n const method = descriptor.value!;\n descriptor.value = function (this: any, ...args: any) {\n return warnAfterTimeout(timeout, `${target.constructor.name}.${propertyName}`, () => method.apply(this, args));\n };\n };\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Throws an error. Can be used in an expression instead of a value\n */\nexport const todo = (message?: string): never => {\n throw new Error(message ?? 'Not implemented.');\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Lets types provide custom formatters for the Chrome Devtools.\n *\n * https://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html\n * NOTE: Must be enabled in chrome devtools preferences.\n *\n * @example\n * ```typescript\n * class MyType {\n * get [devtoolsFormatter] (): DevtoolsFormatter {\n * ...\n * }\n * ```\n */\n\nexport const devtoolsFormatter = Symbol.for('devtoolsFormatter');\n\nexport type JsonML = [string, Record<string, any>?, ...(JsonML | string)[]];\n\nexport interface DevtoolsFormatter {\n /**\n * NOTE: Make sure to do an instance check and return null if the object is not of the correct type.\n */\n header: (config?: any) => JsonML | null;\n hasBody?: (config?: any) => boolean;\n body?: (config?: any) => JsonML | null;\n}\n\n/**\n * Types that implement this interface can provide custom formatters for the Chrome Devtools.\n *\n * https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n */\nexport interface CustomDevtoolsFormattable {\n get [devtoolsFormatter](): DevtoolsFormatter;\n}\n\nconst register = () => {\n if (typeof window !== 'undefined') {\n ((window as any).devtoolsFormatters ??= []).push({\n header: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (formatter === undefined) {\n return null;\n }\n if (typeof formatter !== 'object' || formatter === null || typeof formatter.header !== 'function') {\n throw new Error(`Invalid devtools formatter for ${value.constructor.name}`);\n }\n\n return formatter.header(config);\n },\n hasBody: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (!formatter || !formatter.hasBody) {\n return false;\n }\n\n return formatter.hasBody(config);\n },\n body: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (!formatter || !formatter.body) {\n return null;\n }\n\n return formatter.body(config);\n },\n });\n }\n};\n\nregister();\n", "//\n// Copyright 2023 DXOS.org\n//\n\nexport const equalsSymbol = Symbol.for('dxos.common.equals');\n\nexport interface Equatable {\n [equalsSymbol]: (other: any) => boolean;\n}\n\n// TODO(dmaretskyi): export to @dxos/traits.\n// TODO(dmaretskyi): Hash trait for maps?\n\nexport const isEquatable = (value: any): value is Equatable => {\n return typeof value === 'object' && value !== null && typeof value[equalsSymbol] === 'function';\n};\n\nexport const isEqual = (value: Equatable, other: any) => {\n return value[equalsSymbol](other);\n};\n\n/**\n * Feed this as a third argument to `_.isEqualWith` to compare objects with `Equatable` interface.\n */\nexport const loadashEqualityFn = (value: any, other: any): boolean | undefined => {\n if (!isEquatable(value)) {\n return undefined;\n }\n return isEqual(value, other);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\n/**\n * Allows to register a module to be used later during debugging.\n *\n * ```ts\n * import * as keys from '@dxos/keys';\n * exposeModule('@dxos/keys', keys);\n *\n * ...\n *\n * const { PublicKey } = importModule('@dxos/keys');\n * ```\n *\n * Overwrites the module if it already exists.\n */\nexport const exposeModule = (name: string, module: any) => {\n EXPOSED_MODULES[name] = module;\n};\n\n/**\n * Imports a previously exposed module by its name.\n * Throws an error if the module is not found.\n *\n * @param {string} name - The name of the module to import.\n * @returns {any} The imported module.\n * @throws {Error} If the module is not exposed.\n */\nexport const importModule = (name: string) => {\n if (EXPOSED_MODULES[name]) {\n return EXPOSED_MODULES[name];\n } else {\n throw new Error(`Module ${name} is not exposed.`);\n }\n};\n\nconst EXPOSED_MODULES: Record<string, any> = {};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { InspectOptionsStylized, inspect as inspectFn } from 'node:util';\n\n/**\n * Using this allows code to be written in a portable fashion, so that the custom inspect function is used in an Node.js environment and ignored in the browser.\n */\nexport const inspectCustom = Symbol.for('nodejs.util.inspect.custom');\n\nexport type CustomInspectFunction<T = any> = (\n this: T,\n depth: number,\n options: InspectOptionsStylized,\n inspect: typeof inspectFn,\n) => any; // TODO: , inspect: inspect\n\nexport interface CustomInspectable {\n [inspectCustom]: CustomInspectFunction;\n}\n"],
|
|
5
|
+
"mappings": ";AAYO,IAAMA,YAAY,CAAIC,UAAgBA;;;ACR7C,SAASC,oBAAoB;AAKtB,IAAMC,eAAN,cAA2BD,aAAAA;EAChCE;EAEA,cAAc;AACZ,UAAK;AAEL,SAAKA,YAAY,CAACC,UAAAA;AAChB,YAAMC,QAAQD,MAAME,SAASF,MAAMG,UAAUH;AAC7C,YAAMI,UAAUH,MAAMI,SAASJ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N,SAAAA;;;ACvEO,IAAMa,eAAeC,uBAAOC,IAAI,oBAAA;AAShC,IAAMC,cAAc,CAACC,UAAAA;AAC1B,SAAO,OAAOA,UAAU,YAAYA,UAAU,QAAQ,OAAOA,MAAMJ,YAAAA,MAAkB;AACvF;AAEO,IAAMK,UAAU,CAACD,OAAkBE,UAAAA;AACxC,SAAOF,MAAMJ,YAAAA,EAAcM,KAAAA;AAC7B;AAKO,IAAMC,oBAAoB,CAACH,OAAYE,UAAAA;AAC5C,MAAI,CAACH,YAAYC,KAAAA,GAAQ;AACvB,WAAOI;EACT;AACA,SAAOH,QAAQD,OAAOE,KAAAA;AACxB;;;ACXO,IAAMG,eAAe,CAACC,MAAcC,WAAAA;AACzCC,kBAAgBF,IAAAA,IAAQC;AAC1B;AAUO,IAAME,eAAe,CAACH,SAAAA;AAC3B,MAAIE,gBAAgBF,IAAAA,GAAO;AACzB,WAAOE,gBAAgBF,IAAAA;EACzB,OAAO;AACL,UAAM,IAAII,MAAM,UAAUJ,IAAAA,kBAAsB;EAClD;AACF;AAEA,IAAME,kBAAuC,CAAC;;;AC7BvC,IAAMG,gBAAgBC,uBAAOC,IAAI,4BAAA;",
|
|
6
|
+
"names": ["checkType", "value", "EventEmitter", "ErrorHandler", "_listener", "event", "cause", "error", "reason", "message", "stack", "toString", "emit", "window", "addEventListener", "reset", "removeEventListener", "ErrorStream", "_handler", "_unhandledErrors", "assertNoUnhandledErrors", "Error", "raise", "error", "_unhandledError", "handle", "handler", "pipeTo", "receiver", "setTimeout", "failUndefined", "Error", "inspect", "inspectObject", "obj", "name", "Object", "getPrototypeOf", "toJSON", "String", "logMethod", "target", "propertyName", "descriptor", "method", "value", "args", "console", "log", "name", "result", "apply", "catch", "err", "raise", "error", "SnoopLevel", "Snoop", "stackFunction", "err", "stack", "split", "match", "file", "line", "substring", "lastIndexOf", "_context", "verbose", "bold", "format", "prefix", "name", "args", "level", "pre", "repeat", "label", "join", "in", "String", "out", "result", "sync", "f", "Error", "console", "log", "r", "async", "snoop", "StackTrace", "_stack", "Error", "getStack", "skipFrames", "stack", "split", "slice", "join", "getStackArray", "truncate", "str", "length", "pad", "substring", "padEnd", "truncateKey", "key", "String", "slice", "expectToThrow", "test", "errType", "Error", "thrown", "err", "undefined", "prototype", "name", "warnAfterTimeout", "timeout", "context", "body", "stack", "StackTrace", "timeoutId", "setTimeout", "console", "warn", "toLocaleString", "getStack", "clearTimeout", "timed", "target", "propertyName", "descriptor", "method", "value", "args", "name", "apply", "todo", "message", "Error", "devtoolsFormatter", "Symbol", "for", "register", "window", "devtoolsFormatters", "push", "header", "value", "config", "formatter", "undefined", "Error", "name", "hasBody", "body", "equalsSymbol", "Symbol", "for", "isEquatable", "value", "isEqual", "other", "loadashEqualityFn", "undefined", "exposeModule", "name", "module", "EXPOSED_MODULES", "importModule", "Error", "inspectCustom", "Symbol", "for"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/assert.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/assert.ts":{"bytes":1208,"imports":[],"format":"esm"},"src/error-handler.ts":{"bytes":3455,"imports":[{"path":"@dxos/node-std/events","kind":"import-statement","external":true}],"format":"esm"},"src/error-stream.ts":{"bytes":3333,"imports":[],"format":"esm"},"src/fail.ts":{"bytes":1269,"imports":[],"format":"esm"},"src/inspect.ts":{"bytes":1862,"imports":[{"path":"@dxos/node-std/util","kind":"import-statement","external":true}],"format":"esm"},"src/log-method.ts":{"bytes":3002,"imports":[],"format":"esm"},"src/raise.ts":{"bytes":1116,"imports":[],"format":"esm"},"src/snoop.ts":{"bytes":7915,"imports":[],"format":"esm"},"src/stack-trace.ts":{"bytes":2911,"imports":[],"format":"esm"},"src/strings.ts":{"bytes":2395,"imports":[],"format":"esm"},"src/throw.ts":{"bytes":1987,"imports":[],"format":"esm"},"src/timeout-warning.ts":{"bytes":5103,"imports":[{"path":"src/stack-trace.ts","kind":"import-statement","original":"./stack-trace"}],"format":"esm"},"src/todo.ts":{"bytes":836,"imports":[],"format":"esm"},"src/devtools-formatter.ts":{"bytes":6039,"imports":[],"format":"esm"},"src/equality.ts":{"bytes":2632,"imports":[],"format":"esm"},"src/exposed-modules.ts":{"bytes":2866,"imports":[],"format":"esm"},"src/inspect-custom.ts":{"bytes":1456,"imports":[],"format":"esm"},"src/index.ts":{"bytes":1855,"imports":[{"path":"src/assert.ts","kind":"import-statement","original":"./assert"},{"path":"src/error-handler.ts","kind":"import-statement","original":"./error-handler"},{"path":"src/error-stream.ts","kind":"import-statement","original":"./error-stream"},{"path":"src/fail.ts","kind":"import-statement","original":"./fail"},{"path":"src/inspect.ts","kind":"import-statement","original":"./inspect"},{"path":"src/log-method.ts","kind":"import-statement","original":"./log-method"},{"path":"src/raise.ts","kind":"import-statement","original":"./raise"},{"path":"src/snoop.ts","kind":"import-statement","original":"./snoop"},{"path":"src/stack-trace.ts","kind":"import-statement","original":"./stack-trace"},{"path":"src/strings.ts","kind":"import-statement","original":"./strings"},{"path":"src/throw.ts","kind":"import-statement","original":"./throw"},{"path":"src/timeout-warning.ts","kind":"import-statement","original":"./timeout-warning"},{"path":"src/todo.ts","kind":"import-statement","original":"./todo"},{"path":"src/devtools-formatter.ts","kind":"import-statement","original":"./devtools-formatter"},{"path":"src/equality.ts","kind":"import-statement","original":"./equality"},{"path":"src/exposed-modules.ts","kind":"import-statement","original":"./exposed-modules"},{"path":"src/inspect-custom.ts","kind":"import-statement","original":"./inspect-custom"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":24007},"dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/node-std/events","kind":"import-statement","external":true},{"path":"@dxos/node-std/util","kind":"import-statement","external":true}],"exports":["ErrorHandler","ErrorStream","Snoop","SnoopLevel","StackTrace","checkType","devtoolsFormatter","equalsSymbol","expectToThrow","exposeModule","failUndefined","importModule","inspectCustom","inspectObject","isEqual","isEquatable","loadashEqualityFn","logMethod","raise","snoop","timed","todo","truncate","truncateKey","warnAfterTimeout"],"entryPoint":"src/index.ts","inputs":{"src/assert.ts":{"bytesInOutput":34},"src/index.ts":{"bytesInOutput":0},"src/error-handler.ts":{"bytesInOutput":623},"src/error-stream.ts":{"bytesInOutput":638},"src/fail.ts":{"bytesInOutput":91},"src/inspect.ts":{"bytesInOutput":214},"src/log-method.ts":{"bytesInOutput":597},"src/raise.ts":{"bytesInOutput":43},"src/snoop.ts":{"bytesInOutput":1806},"src/stack-trace.ts":{"bytesInOutput":541},"src/strings.ts":{"bytesInOutput":396},"src/throw.ts":{"bytesInOutput":290},"src/timeout-warning.ts":{"bytesInOutput":664},"src/todo.ts":{"bytesInOutput":79},"src/devtools-formatter.ts":{"bytesInOutput":1051},"src/equality.ts":{"bytesInOutput":407},"src/exposed-modules.ts":{"bytesInOutput":271},"src/inspect-custom.ts":{"bytesInOutput":78}},"bytes":8591}}}
|
|
@@ -231,7 +231,7 @@ var todo = (message) => {
|
|
|
231
231
|
};
|
|
232
232
|
|
|
233
233
|
// src/devtools-formatter.ts
|
|
234
|
-
var devtoolsFormatter = Symbol.for("devtoolsFormatter");
|
|
234
|
+
var devtoolsFormatter = /* @__PURE__ */ Symbol.for("devtoolsFormatter");
|
|
235
235
|
var register = () => {
|
|
236
236
|
if (typeof window !== "undefined") {
|
|
237
237
|
(window.devtoolsFormatters ??= []).push({
|
|
@@ -265,7 +265,7 @@ var register = () => {
|
|
|
265
265
|
register();
|
|
266
266
|
|
|
267
267
|
// src/equality.ts
|
|
268
|
-
var equalsSymbol = Symbol.for("dxos.common.equals");
|
|
268
|
+
var equalsSymbol = /* @__PURE__ */ Symbol.for("dxos.common.equals");
|
|
269
269
|
var isEquatable = (value) => {
|
|
270
270
|
return typeof value === "object" && value !== null && typeof value[equalsSymbol] === "function";
|
|
271
271
|
};
|
|
@@ -293,7 +293,7 @@ var importModule = (name) => {
|
|
|
293
293
|
var EXPOSED_MODULES = {};
|
|
294
294
|
|
|
295
295
|
// src/inspect-custom.ts
|
|
296
|
-
var inspectCustom = Symbol.for("nodejs.util.inspect.custom");
|
|
296
|
+
var inspectCustom = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
297
297
|
export {
|
|
298
298
|
ErrorHandler,
|
|
299
299
|
ErrorStream,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/assert.ts", "../../../src/error-handler.ts", "../../../src/error-stream.ts", "../../../src/fail.ts", "../../../src/inspect.ts", "../../../src/log-method.ts", "../../../src/raise.ts", "../../../src/snoop.ts", "../../../src/stack-trace.ts", "../../../src/strings.ts", "../../../src/throw.ts", "../../../src/timeout-warning.ts", "../../../src/todo.ts", "../../../src/devtools-formatter.ts", "../../../src/equality.ts", "../../../src/exposed-modules.ts", "../../../src/inspect-custom.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * A simple syntax sugar to write `value as T` as a statement.\n *\n * NOTE: This does not provide any type safety.\n * It's just for convenience so that autocomplete works for value.\n * It's recommended to check the type URL manually beforehand or use `assertAnyType` instead.\n * @param value\n */\nexport const checkType = <T>(value: T): T => value;\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { EventEmitter } from 'node:events';\n\n/**\n * Listens for global errors.\n */\nexport class ErrorHandler extends EventEmitter {\n _listener: EventListener;\n\n constructor() {\n super();\n\n this._listener = (event: any) => {\n const cause = event.error || event.reason || event;\n const message = cause.stack || cause.message || cause.toString();\n this.emit('error', message);\n\n // Default logging.\n // code event.preventDefault();\n };\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event\n window.addEventListener('error', this._listener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event\n window.addEventListener('unhandledrejection', this._listener);\n }\n\n reset(): void {\n window.removeEventListener('error', this._listener);\n window.removeEventListener('unhandledrejection', this._listener);\n }\n}\n", "//\n// Copyright 2021 DXOS.org\n//\n\nexport type ErrorHandlerCallback = (error: Error) => void;\n\n/**\n * Represents a stream of errors that entities can expose.\n */\nexport class ErrorStream {\n private _handler: ErrorHandlerCallback | undefined;\n\n private _unhandledErrors = 0;\n\n assertNoUnhandledErrors(): void {\n if (this._unhandledErrors > 0) {\n throw new Error(\n `Assertion failed: expected no unhandled errors to be thrown, but ${this._unhandledErrors} were thrown.`,\n );\n }\n }\n\n raise(error: Error): void {\n if (this._handler) {\n this._handler(error);\n } else {\n this._unhandledError(error);\n }\n }\n\n handle(handler: ErrorHandlerCallback): void {\n this._handler = handler;\n }\n\n pipeTo(receiver: ErrorStream): void {\n this.handle((error) => receiver.raise(error));\n }\n\n private _unhandledError(error: Error): void {\n this._unhandledErrors++;\n\n setTimeout(() => {\n throw error;\n });\n }\n}\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * Should be used in expressions where values are cheked not to be null or undefined.\n *\n * Example:\n *\n * ```\n * const value: string | undefined;\n *\n * callMethod(value ?? failUndefined());\n * ```\n */\n// TODO(burdon): Rename failIfUndefined().\nexport const failUndefined = () => {\n throw new Error('Required value was null or undefined.');\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { inspect } from 'node:util';\n\n/**\n * Utility to automatically log debug info.\n *\n * ```\n * // Called via `console.log`.\n * [inspect.custom] () {\n * return inspectObject(this);\n * }\n *\n * // Called via `JSON.stringify`.\n * toJSON () {\n * return { ... };\n * }\n * ```\n */\nexport const inspectObject = (obj: any) => {\n const name = Object.getPrototypeOf(obj).constructor.name;\n return obj.toJSON ? `${name}(${inspect(obj.toJSON())})` : String(obj);\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\nexport function logMethod(\n target: any,\n propertyName: string,\n descriptor: TypedPropertyDescriptor<(...args: any) => any>,\n): void {\n const method = descriptor.value!;\n descriptor.value = function (this: any, ...args: any) {\n console.log(`Called ${target.constructor.name}.${propertyName} ${args}`);\n try {\n const result = method.apply(this, args);\n if (typeof result.catch === 'function') {\n result.catch((err: any) => {\n console.log(`Rejected ${target.constructor.name}.${propertyName}`, err);\n });\n }\n return result;\n } catch (err: any) {\n console.log(`Thrown ${target.constructor.name}.${propertyName}`, err);\n throw err;\n }\n };\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Immediatelly throws an error passed as an argument.\n *\n * Usefull for throwing errors from inside expressions.\n * For example:\n * ```\n * const item = model.getById(someId) ?? raise(new Error('Not found'));\n * ```\n * @param error\n */\nexport const raise = (error: Error): never => {\n throw error;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport enum SnoopLevel {\n DEFAULT = 0,\n VERBOSE = 1,\n BOLD = 2,\n}\n\n/**\n * Utils for debug logging of functions.\n */\n// TODO(burdon): Integrate with log/spyglass.\nexport class Snoop {\n static stackFunction(err: Error): string | undefined {\n const stack = err.stack!.split('\\n');\n const match = stack[2].match(/.+\\((.+)\\).*/);\n if (match) {\n const [file, line] = match[1].split(':');\n return `[${file.substring(file.lastIndexOf('/') + 1)}:${line}]`;\n }\n }\n\n constructor(private readonly _context?: string) {}\n\n get verbose() {\n return SnoopLevel.VERBOSE;\n }\n\n get bold() {\n return SnoopLevel.BOLD;\n }\n\n format(prefix: string, name: string, args: string, level: SnoopLevel): string {\n const pre = prefix.repeat(level === SnoopLevel.BOLD ? 8 : 2);\n const label = this._context ? `${this._context}.${name}` : name;\n const line = `${pre} ${label}${args}`;\n return level === SnoopLevel.BOLD ? [pre, line, pre].join('\\n') : line;\n }\n\n in(label: string, level: SnoopLevel, ...args: any[]): string {\n return this.format('<', label, level === SnoopLevel.DEFAULT ? '' : `(${String(...args)})`, level);\n }\n\n out(label: string, level: SnoopLevel, result: any): string {\n return this.format('>', label, level === SnoopLevel.DEFAULT ? '' : ` = ${String(result)}`, level);\n }\n\n sync(f: any, label?: string, level: SnoopLevel = SnoopLevel.VERBOSE) {\n label = label ?? Snoop.stackFunction(new Error());\n return (...args: any[]) => {\n console.log(this.in(label ?? '', level, ...args));\n const r = f(...args);\n console.log(this.out(label ?? '', level, r));\n return r;\n };\n }\n\n async(f: any, label?: string, level: SnoopLevel = SnoopLevel.VERBOSE) {\n label = label ?? Snoop.stackFunction(new Error());\n return async (...args: any[]) => {\n console.log(this.in(label ?? '', level, ...args));\n const r = await f(...args);\n console.log(this.out(label ?? '', level, r));\n return r;\n };\n }\n}\n\nexport const snoop = new Snoop();\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * Will capture the stack trace at the point where the class is created.\n * Stack traces are formatted lazily only when `getStack` is called.\n * Formatting is significantly more expensive than capture so only call getStack when you need them.\n */\nexport class StackTrace {\n private _stack: Error;\n\n constructor() {\n this._stack = new Error();\n }\n\n /**\n * Get stack formatted as string.\n * @param skipFrames Number of frames to skip. By default, the first frame would be the invocation of the StackTrace constructor.\n * @returns\n */\n getStack(skipFrames = 0): string {\n const stack = this._stack.stack!.split('\\n');\n return stack.slice(skipFrames + 2).join('\\n');\n }\n\n getStackArray(skipFrames = 0): string[] {\n const stack = this._stack.stack!.split('\\n');\n return stack.slice(skipFrames + 2);\n }\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\nexport const truncate = (str = '', length = 8, pad: boolean | string = false) => {\n if (str.length >= length - 1) {\n return str.substring(0, length - 1) + '…';\n } else {\n return pad ? str.padEnd(length, typeof pad === 'boolean' ? ' ' : pad[0]) : str;\n }\n};\n\nexport const truncateKey = (key: any, length = 8) => {\n const str = String(key);\n if (str.length <= length) {\n return str;\n }\n\n return str.slice(0, length);\n\n // return start\n // ? `${str.slice(0, length)}...`\n // : `${str.substring(0, length / 2)}...${str.substring(str.length - length / 2)}`;\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Wrapper for async tests.\n * @param {Function} test - Async test\n * @param errType\n * @return {Promise<void>}\n *\n * @deprecated Use vitests `expect(() => ...).toThrowError();` instead.\n */\nexport const expectToThrow = async (test: () => void, errType = Error) => {\n let thrown;\n try {\n await test();\n } catch (err) {\n thrown = err;\n }\n\n if (thrown === undefined || !(thrown instanceof errType)) {\n throw new Error(`Expected function to throw instance of ${errType.prototype.name}`);\n }\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { StackTrace } from './stack-trace';\n\n/**\n * Prints a warning to console if the action takes longer then specified timeout. No errors are thrown.\n *\n * @param timeout Timeout in milliseconds after which warning is printed.\n * @param context Context description that would be included in the printed message.\n * @param body Action which is timed.\n */\nexport const warnAfterTimeout = async <T>(timeout: number, context: string, body: () => Promise<T>): Promise<T> => {\n const stack = new StackTrace();\n const timeoutId = setTimeout(() => {\n console.warn(\n `Action \\`${context}\\` is taking more then ${timeout.toLocaleString()}ms to complete. This might be a bug.\\n${stack.getStack()}`,\n );\n }, timeout);\n try {\n return await body();\n } finally {\n clearTimeout(timeoutId);\n }\n};\n\n/**\n * A decorator that prints a warning to console if method execution time exceeds specified timeout.\n *\n * ```typescript\n * class Foo {\n * @timed(5_000)\n * async doStuff() {\n * // long task\n * }\n * }\n * ```\n *\n * This is useful for debugging code that might deadlock.\n *\n * @param timeout Timeout in milliseconds after which the warning is printed.\n */\nexport function timed(timeout: number) {\n return (target: any, propertyName: string, descriptor: TypedPropertyDescriptor<(...args: any) => any>) => {\n const method = descriptor.value!;\n descriptor.value = function (this: any, ...args: any) {\n return warnAfterTimeout(timeout, `${target.constructor.name}.${propertyName}`, () => method.apply(this, args));\n };\n };\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Throws an error. Can be used in an expression instead of a value\n */\nexport const todo = (message?: string): never => {\n throw new Error(message ?? 'Not implemented.');\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Lets types provide custom formatters for the Chrome Devtools.\n *\n * https://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html\n * NOTE: Must be enabled in chrome devtools preferences.\n *\n * @example\n * ```typescript\n * class MyType {\n * get [devtoolsFormatter] (): DevtoolsFormatter {\n * ...\n * }\n * ```\n */\n\nexport const devtoolsFormatter = Symbol.for('devtoolsFormatter');\n\nexport type JsonML = [string, Record<string, any>?, ...(JsonML | string)[]];\n\nexport interface DevtoolsFormatter {\n /**\n * NOTE: Make sure to do an instance check and return null if the object is not of the correct type.\n */\n header: (config?: any) => JsonML | null;\n hasBody?: (config?: any) => boolean;\n body?: (config?: any) => JsonML | null;\n}\n\n/**\n * Types that implement this interface can provide custom formatters for the Chrome Devtools.\n *\n * https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n */\nexport interface CustomDevtoolsFormattable {\n get [devtoolsFormatter](): DevtoolsFormatter;\n}\n\nconst register = () => {\n if (typeof window !== 'undefined') {\n ((window as any).devtoolsFormatters ??= []).push({\n header: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (formatter === undefined) {\n return null;\n }\n if (typeof formatter !== 'object' || formatter === null || typeof formatter.header !== 'function') {\n throw new Error(`Invalid devtools formatter for ${value.constructor.name}`);\n }\n\n return formatter.header(config);\n },\n hasBody: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (!formatter || !formatter.hasBody) {\n return false;\n }\n\n return formatter.hasBody(config);\n },\n body: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (!formatter || !formatter.body) {\n return null;\n }\n\n return formatter.body(config);\n },\n });\n }\n};\n\nregister();\n", "//\n// Copyright 2023 DXOS.org\n//\n\nexport const equalsSymbol = Symbol.for('dxos.common.equals');\n\nexport interface Equatable {\n [equalsSymbol]: (other: any) => boolean;\n}\n\n// TODO(dmaretskyi): export to @dxos/traits.\n// TODO(dmaretskyi): Hash trait for maps?\n\nexport const isEquatable = (value: any): value is Equatable => {\n return typeof value === 'object' && value !== null && typeof value[equalsSymbol] === 'function';\n};\n\nexport const isEqual = (value: Equatable, other: any) => {\n return value[equalsSymbol](other);\n};\n\n/**\n * Feed this as a third argument to `_.isEqualWith` to compare objects with `Equatable` interface.\n */\nexport const loadashEqualityFn = (value: any, other: any): boolean | undefined => {\n if (!isEquatable(value)) {\n return undefined;\n }\n return isEqual(value, other);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\n/**\n * Allows to register a module to be used later during debugging.\n *\n * ```ts\n * import * as keys from '@dxos/keys';\n * exposeModule('@dxos/keys', keys);\n *\n * ...\n *\n * const { PublicKey } = importModule('@dxos/keys');\n * ```\n *\n * Overwrites the module if it already exists.\n */\nexport const exposeModule = (name: string, module: any) => {\n EXPOSED_MODULES[name] = module;\n};\n\n/**\n * Imports a previously exposed module by its name.\n * Throws an error if the module is not found.\n *\n * @param {string} name - The name of the module to import.\n * @returns {any} The imported module.\n * @throws {Error} If the module is not exposed.\n */\nexport const importModule = (name: string) => {\n if (EXPOSED_MODULES[name]) {\n return EXPOSED_MODULES[name];\n } else {\n throw new Error(`Module ${name} is not exposed.`);\n }\n};\n\nconst EXPOSED_MODULES: Record<string, any> = {};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { InspectOptionsStylized, inspect as inspectFn } from 'node:util';\n\n/**\n * Using this allows code to be written in a portable fashion, so that the custom inspect function is used in an Node.js environment and ignored in the browser.\n */\nexport const inspectCustom = Symbol.for('nodejs.util.inspect.custom');\n\nexport type CustomInspectFunction<T = any> = (\n this: T,\n depth: number,\n options: InspectOptionsStylized,\n inspect: typeof inspectFn,\n) => any; // TODO: , inspect: inspect\n\nexport interface CustomInspectable {\n [inspectCustom]: CustomInspectFunction;\n}\n"],
|
|
5
|
-
"mappings": ";;;AAYO,IAAMA,YAAY,CAAIC,UAAgBA;;;ACR7C,SAASC,oBAAoB;AAKtB,IAAMC,eAAN,
|
|
6
|
-
"names": ["checkType", "value", "EventEmitter", "ErrorHandler", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * A simple syntax sugar to write `value as T` as a statement.\n *\n * NOTE: This does not provide any type safety.\n * It's just for convenience so that autocomplete works for value.\n * It's recommended to check the type URL manually beforehand or use `assertAnyType` instead.\n * @param value\n */\nexport const checkType = <T>(value: T): T => value;\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { EventEmitter } from 'node:events';\n\n/**\n * Listens for global errors.\n */\nexport class ErrorHandler extends EventEmitter {\n _listener: EventListener;\n\n constructor() {\n super();\n\n this._listener = (event: any) => {\n const cause = event.error || event.reason || event;\n const message = cause.stack || cause.message || cause.toString();\n this.emit('error', message);\n\n // Default logging.\n // code event.preventDefault();\n };\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event\n window.addEventListener('error', this._listener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event\n window.addEventListener('unhandledrejection', this._listener);\n }\n\n reset(): void {\n window.removeEventListener('error', this._listener);\n window.removeEventListener('unhandledrejection', this._listener);\n }\n}\n", "//\n// Copyright 2021 DXOS.org\n//\n\nexport type ErrorHandlerCallback = (error: Error) => void;\n\n/**\n * Represents a stream of errors that entities can expose.\n */\nexport class ErrorStream {\n private _handler: ErrorHandlerCallback | undefined;\n\n private _unhandledErrors = 0;\n\n assertNoUnhandledErrors(): void {\n if (this._unhandledErrors > 0) {\n throw new Error(\n `Assertion failed: expected no unhandled errors to be thrown, but ${this._unhandledErrors} were thrown.`,\n );\n }\n }\n\n raise(error: Error): void {\n if (this._handler) {\n this._handler(error);\n } else {\n this._unhandledError(error);\n }\n }\n\n handle(handler: ErrorHandlerCallback): void {\n this._handler = handler;\n }\n\n pipeTo(receiver: ErrorStream): void {\n this.handle((error) => receiver.raise(error));\n }\n\n private _unhandledError(error: Error): void {\n this._unhandledErrors++;\n\n setTimeout(() => {\n throw error;\n });\n }\n}\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * Should be used in expressions where values are cheked not to be null or undefined.\n *\n * Example:\n *\n * ```\n * const value: string | undefined;\n *\n * callMethod(value ?? failUndefined());\n * ```\n */\n// TODO(burdon): Rename failIfUndefined().\nexport const failUndefined = () => {\n throw new Error('Required value was null or undefined.');\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { inspect } from 'node:util';\n\n/**\n * Utility to automatically log debug info.\n *\n * ```\n * // Called via `console.log`.\n * [inspect.custom] () {\n * return inspectObject(this);\n * }\n *\n * // Called via `JSON.stringify`.\n * toJSON () {\n * return { ... };\n * }\n * ```\n */\nexport const inspectObject = (obj: any) => {\n const name = Object.getPrototypeOf(obj).constructor.name;\n return obj.toJSON ? `${name}(${inspect(obj.toJSON())})` : String(obj);\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nexport function logMethod(\n target: any,\n propertyName: string,\n descriptor: TypedPropertyDescriptor<(...args: any) => any>,\n): void {\n const method = descriptor.value!;\n descriptor.value = function (this: any, ...args: any) {\n console.log(`Called ${target.constructor.name}.${propertyName} ${args}`);\n try {\n const result = method.apply(this, args);\n if (typeof result.catch === 'function') {\n result.catch((err: any) => {\n console.log(`Rejected ${target.constructor.name}.${propertyName}`, err);\n });\n }\n return result;\n } catch (err: any) {\n console.log(`Thrown ${target.constructor.name}.${propertyName}`, err);\n throw err;\n }\n };\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Immediatelly throws an error passed as an argument.\n *\n * Usefull for throwing errors from inside expressions.\n * For example:\n * ```\n * const item = model.getById(someId) ?? raise(new Error('Not found'));\n * ```\n * @param error\n */\nexport const raise = (error: Error): never => {\n throw error;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nexport enum SnoopLevel {\n DEFAULT = 0,\n VERBOSE = 1,\n BOLD = 2,\n}\n\n/**\n * Utils for debug logging of functions.\n */\n// TODO(burdon): Integrate with log/spyglass.\nexport class Snoop {\n static stackFunction(err: Error): string | undefined {\n const stack = err.stack!.split('\\n');\n const match = stack[2].match(/.+\\((.+)\\).*/);\n if (match) {\n const [file, line] = match[1].split(':');\n return `[${file.substring(file.lastIndexOf('/') + 1)}:${line}]`;\n }\n }\n\n constructor(private readonly _context?: string) {}\n\n get verbose() {\n return SnoopLevel.VERBOSE;\n }\n\n get bold() {\n return SnoopLevel.BOLD;\n }\n\n format(prefix: string, name: string, args: string, level: SnoopLevel): string {\n const pre = prefix.repeat(level === SnoopLevel.BOLD ? 8 : 2);\n const label = this._context ? `${this._context}.${name}` : name;\n const line = `${pre} ${label}${args}`;\n return level === SnoopLevel.BOLD ? [pre, line, pre].join('\\n') : line;\n }\n\n in(label: string, level: SnoopLevel, ...args: any[]): string {\n return this.format('<', label, level === SnoopLevel.DEFAULT ? '' : `(${String(...args)})`, level);\n }\n\n out(label: string, level: SnoopLevel, result: any): string {\n return this.format('>', label, level === SnoopLevel.DEFAULT ? '' : ` = ${String(result)}`, level);\n }\n\n sync(f: any, label?: string, level: SnoopLevel = SnoopLevel.VERBOSE) {\n label = label ?? Snoop.stackFunction(new Error());\n return (...args: any[]) => {\n console.log(this.in(label ?? '', level, ...args));\n const r = f(...args);\n console.log(this.out(label ?? '', level, r));\n return r;\n };\n }\n\n async(f: any, label?: string, level: SnoopLevel = SnoopLevel.VERBOSE) {\n label = label ?? Snoop.stackFunction(new Error());\n return async (...args: any[]) => {\n console.log(this.in(label ?? '', level, ...args));\n const r = await f(...args);\n console.log(this.out(label ?? '', level, r));\n return r;\n };\n }\n}\n\nexport const snoop = new Snoop();\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * Will capture the stack trace at the point where the class is created.\n * Stack traces are formatted lazily only when `getStack` is called.\n * Formatting is significantly more expensive than capture so only call getStack when you need them.\n */\nexport class StackTrace {\n private _stack: Error;\n\n constructor() {\n this._stack = new Error();\n }\n\n /**\n * Get stack formatted as string.\n * @param skipFrames Number of frames to skip. By default, the first frame would be the invocation of the StackTrace constructor.\n * @returns\n */\n getStack(skipFrames = 0): string {\n const stack = this._stack.stack!.split('\\n');\n return stack.slice(skipFrames + 2).join('\\n');\n }\n\n getStackArray(skipFrames = 0): string[] {\n const stack = this._stack.stack!.split('\\n');\n return stack.slice(skipFrames + 2);\n }\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\nexport const truncate = (str = '', length = 8, pad: boolean | string = false) => {\n if (str.length >= length - 1) {\n return str.substring(0, length - 1) + '…';\n } else {\n return pad ? str.padEnd(length, typeof pad === 'boolean' ? ' ' : pad[0]) : str;\n }\n};\n\nexport const truncateKey = (key: any, length = 8) => {\n const str = String(key);\n if (str.length <= length) {\n return str;\n }\n\n return str.slice(0, length);\n\n // return start\n // ? `${str.slice(0, length)}...`\n // : `${str.substring(0, length / 2)}...${str.substring(str.length - length / 2)}`;\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Wrapper for async tests.\n * @param {Function} test - Async test\n * @param errType\n * @return {Promise<void>}\n *\n * @deprecated Use vitests `expect(() => ...).toThrowError();` instead.\n */\nexport const expectToThrow = async (test: () => void, errType = Error) => {\n let thrown;\n try {\n await test();\n } catch (err) {\n thrown = err;\n }\n\n if (thrown === undefined || !(thrown instanceof errType)) {\n throw new Error(`Expected function to throw instance of ${errType.prototype.name}`);\n }\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { StackTrace } from './stack-trace';\n\n/**\n * Prints a warning to console if the action takes longer then specified timeout. No errors are thrown.\n *\n * @param timeout Timeout in milliseconds after which warning is printed.\n * @param context Context description that would be included in the printed message.\n * @param body Action which is timed.\n */\nexport const warnAfterTimeout = async <T>(timeout: number, context: string, body: () => Promise<T>): Promise<T> => {\n const stack = new StackTrace();\n const timeoutId = setTimeout(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `Action \\`${context}\\` is taking more then ${timeout.toLocaleString()}ms to complete. This might be a bug.\\n${stack.getStack()}`,\n );\n }, timeout);\n try {\n return await body();\n } finally {\n clearTimeout(timeoutId);\n }\n};\n\n/**\n * A decorator that prints a warning to console if method execution time exceeds specified timeout.\n *\n * ```typescript\n * class Foo {\n * @timed(5_000)\n * async doStuff() {\n * // long task\n * }\n * }\n * ```\n *\n * This is useful for debugging code that might deadlock.\n *\n * @param timeout Timeout in milliseconds after which the warning is printed.\n */\nexport function timed(timeout: number) {\n return (target: any, propertyName: string, descriptor: TypedPropertyDescriptor<(...args: any) => any>) => {\n const method = descriptor.value!;\n descriptor.value = function (this: any, ...args: any) {\n return warnAfterTimeout(timeout, `${target.constructor.name}.${propertyName}`, () => method.apply(this, args));\n };\n };\n}\n", "//\n// Copyright 2020 DXOS.org\n//\n\n/**\n * Throws an error. Can be used in an expression instead of a value\n */\nexport const todo = (message?: string): never => {\n throw new Error(message ?? 'Not implemented.');\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Lets types provide custom formatters for the Chrome Devtools.\n *\n * https://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html\n * NOTE: Must be enabled in chrome devtools preferences.\n *\n * @example\n * ```typescript\n * class MyType {\n * get [devtoolsFormatter] (): DevtoolsFormatter {\n * ...\n * }\n * ```\n */\n\nexport const devtoolsFormatter = Symbol.for('devtoolsFormatter');\n\nexport type JsonML = [string, Record<string, any>?, ...(JsonML | string)[]];\n\nexport interface DevtoolsFormatter {\n /**\n * NOTE: Make sure to do an instance check and return null if the object is not of the correct type.\n */\n header: (config?: any) => JsonML | null;\n hasBody?: (config?: any) => boolean;\n body?: (config?: any) => JsonML | null;\n}\n\n/**\n * Types that implement this interface can provide custom formatters for the Chrome Devtools.\n *\n * https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n */\nexport interface CustomDevtoolsFormattable {\n get [devtoolsFormatter](): DevtoolsFormatter;\n}\n\nconst register = () => {\n if (typeof window !== 'undefined') {\n ((window as any).devtoolsFormatters ??= []).push({\n header: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (formatter === undefined) {\n return null;\n }\n if (typeof formatter !== 'object' || formatter === null || typeof formatter.header !== 'function') {\n throw new Error(`Invalid devtools formatter for ${value.constructor.name}`);\n }\n\n return formatter.header(config);\n },\n hasBody: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (!formatter || !formatter.hasBody) {\n return false;\n }\n\n return formatter.hasBody(config);\n },\n body: (value: any, config: any) => {\n const formatter = value[devtoolsFormatter];\n if (!formatter || !formatter.body) {\n return null;\n }\n\n return formatter.body(config);\n },\n });\n }\n};\n\nregister();\n", "//\n// Copyright 2023 DXOS.org\n//\n\nexport const equalsSymbol = Symbol.for('dxos.common.equals');\n\nexport interface Equatable {\n [equalsSymbol]: (other: any) => boolean;\n}\n\n// TODO(dmaretskyi): export to @dxos/traits.\n// TODO(dmaretskyi): Hash trait for maps?\n\nexport const isEquatable = (value: any): value is Equatable => {\n return typeof value === 'object' && value !== null && typeof value[equalsSymbol] === 'function';\n};\n\nexport const isEqual = (value: Equatable, other: any) => {\n return value[equalsSymbol](other);\n};\n\n/**\n * Feed this as a third argument to `_.isEqualWith` to compare objects with `Equatable` interface.\n */\nexport const loadashEqualityFn = (value: any, other: any): boolean | undefined => {\n if (!isEquatable(value)) {\n return undefined;\n }\n return isEqual(value, other);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\n/**\n * Allows to register a module to be used later during debugging.\n *\n * ```ts\n * import * as keys from '@dxos/keys';\n * exposeModule('@dxos/keys', keys);\n *\n * ...\n *\n * const { PublicKey } = importModule('@dxos/keys');\n * ```\n *\n * Overwrites the module if it already exists.\n */\nexport const exposeModule = (name: string, module: any) => {\n EXPOSED_MODULES[name] = module;\n};\n\n/**\n * Imports a previously exposed module by its name.\n * Throws an error if the module is not found.\n *\n * @param {string} name - The name of the module to import.\n * @returns {any} The imported module.\n * @throws {Error} If the module is not exposed.\n */\nexport const importModule = (name: string) => {\n if (EXPOSED_MODULES[name]) {\n return EXPOSED_MODULES[name];\n } else {\n throw new Error(`Module ${name} is not exposed.`);\n }\n};\n\nconst EXPOSED_MODULES: Record<string, any> = {};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { InspectOptionsStylized, inspect as inspectFn } from 'node:util';\n\n/**\n * Using this allows code to be written in a portable fashion, so that the custom inspect function is used in an Node.js environment and ignored in the browser.\n */\nexport const inspectCustom = Symbol.for('nodejs.util.inspect.custom');\n\nexport type CustomInspectFunction<T = any> = (\n this: T,\n depth: number,\n options: InspectOptionsStylized,\n inspect: typeof inspectFn,\n) => any; // TODO: , inspect: inspect\n\nexport interface CustomInspectable {\n [inspectCustom]: CustomInspectFunction;\n}\n"],
|
|
5
|
+
"mappings": ";;;AAYO,IAAMA,YAAY,CAAIC,UAAgBA;;;ACR7C,SAASC,oBAAoB;AAKtB,IAAMC,eAAN,cAA2BD,aAAAA;EAChCE;EAEA,cAAc;AACZ,UAAK;AAEL,SAAKA,YAAY,CAACC,UAAAA;AAChB,YAAMC,QAAQD,MAAME,SAASF,MAAMG,UAAUH;AAC7C,YAAMI,UAAUH,MAAMI,SAASJ,MAAMG,WAAWH,MAAMK,SAAQ;AAC9D,WAAKC,KAAK,SAASH,OAAAA;IAIrB;AAGAI,WAAOC,iBAAiB,SAAS,KAAKV,SAAS;AAG/CS,WAAOC,iBAAiB,sBAAsB,KAAKV,SAAS;EAC9D;EAEAW,QAAc;AACZF,WAAOG,oBAAoB,SAAS,KAAKZ,SAAS;AAClDS,WAAOG,oBAAoB,sBAAsB,KAAKZ,SAAS;EACjE;AACF;;;AC1BO,IAAMa,cAAN,MAAMA;EACHC;EAEAC,mBAAmB;EAE3BC,0BAAgC;AAC9B,QAAI,KAAKD,mBAAmB,GAAG;AAC7B,YAAM,IAAIE,MACR,oEAAoE,KAAKF,gBAAgB,eAAe;IAE5G;EACF;EAEAG,MAAMC,OAAoB;AACxB,QAAI,KAAKL,UAAU;AACjB,WAAKA,SAASK,KAAAA;IAChB,OAAO;AACL,WAAKC,gBAAgBD,KAAAA;IACvB;EACF;EAEAE,OAAOC,SAAqC;AAC1C,SAAKR,WAAWQ;EAClB;EAEAC,OAAOC,UAA6B;AAClC,SAAKH,OAAO,CAACF,UAAUK,SAASN,MAAMC,KAAAA,CAAAA;EACxC;EAEQC,gBAAgBD,OAAoB;AAC1C,SAAKJ;AAELU,eAAW,MAAA;AACT,YAAMN;IACR,CAAA;EACF;AACF;;;AC7BO,IAAMO,gBAAgB,MAAA;AAC3B,QAAM,IA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AAAA;MAC1B;MACAK,SAAS,CAACN,OAAYC,WAAAA;AACpB,cAAMC,YAAYF,MAAMR,iBAAAA;AACxB,YAAI,CAACU,aAAa,CAACA,UAAUI,SAAS;AACpC,iBAAO;QACT;AAEA,eAAOJ,UAAUI,QAAQL,MAAAA;MAC3B;MACAM,MAAM,CAACP,OAAYC,WAAAA;AACjB,cAAMC,YAAYF,MAAMR,iBAAAA;AACxB,YAAI,CAACU,aAAa,CAACA,UAAUK,MAAM;AACjC,iBAAO;QACT;AAEA,eAAOL,UAAUK,KAAKN,MAAAA;MACxB;IACF,CAAA;EACF;AACF;AAEAN,SAAAA;;;ACvEO,IAAMa,eAAeC,uBAAOC,IAAI,oBAAA;AAShC,IAAMC,cAAc,CAACC,UAAAA;AAC1B,SAAO,OAAOA,UAAU,YAAYA,UAAU,QAAQ,OAAOA,MAAMJ,YAAAA,MAAkB;AACvF;AAEO,IAAMK,UAAU,CAACD,OAAkBE,UAAAA;AACxC,SAAOF,MAAMJ,YAAAA,EAAcM,KAAAA;AAC7B;AAKO,IAAMC,oBAAoB,CAACH,OAAYE,UAAAA;AAC5C,MAAI,CAACH,YAAYC,KAAAA,GAAQ;AACvB,WAAOI;EACT;AACA,SAAOH,QAAQD,OAAOE,KAAAA;AACxB;;;ACXO,IAAMG,eAAe,CAACC,MAAcC,WAAAA;AACzCC,kBAAgBF,IAAAA,IAAQC;AAC1B;AAUO,IAAME,eAAe,CAACH,SAAAA;AAC3B,MAAIE,gBAAgBF,IAAAA,GAAO;AACzB,WAAOE,gBAAgBF,IAAAA;EACzB,OAAO;AACL,UAAM,IAAII,MAAM,UAAUJ,IAAAA,kBAAsB;EAClD;AACF;AAEA,IAAME,kBAAuC,CAAC;;;AC7BvC,IAAMG,gBAAgBC,uBAAOC,IAAI,4BAAA;",
|
|
6
|
+
"names": ["checkType", "value", "EventEmitter", "ErrorHandler", "_listener", "event", "cause", "error", "reason", "message", "stack", "toString", "emit", "window", "addEventListener", "reset", "removeEventListener", "ErrorStream", "_handler", "_unhandledErrors", "assertNoUnhandledErrors", "Error", "raise", "error", "_unhandledError", "handle", "handler", "pipeTo", "receiver", "setTimeout", "failUndefined", "Error", "inspect", "inspectObject", "obj", "name", "Object", "getPrototypeOf", "toJSON", "String", "logMethod", "target", "propertyName", "descriptor", "method", "value", "args", "console", "log", "name", "result", "apply", "catch", "err", "raise", "error", "SnoopLevel", "Snoop", "stackFunction", "err", "stack", "split", "match", "file", "line", "substring", "lastIndexOf", "_context", "verbose", "bold", "format", "prefix", "name", "args", "level", "pre", "repeat", "label", "join", "in", "String", "out", "result", "sync", "f", "Error", "console", "log", "r", "async", "snoop", "StackTrace", "_stack", "Error", "getStack", "skipFrames", "stack", "split", "slice", "join", "getStackArray", "truncate", "str", "length", "pad", "substring", "padEnd", "truncateKey", "key", "String", "slice", "expectToThrow", "test", "errType", "Error", "thrown", "err", "undefined", "prototype", "name", "warnAfterTimeout", "timeout", "context", "body", "stack", "StackTrace", "timeoutId", "setTimeout", "console", "warn", "toLocaleString", "getStack", "clearTimeout", "timed", "target", "propertyName", "descriptor", "method", "value", "args", "name", "apply", "todo", "message", "Error", "devtoolsFormatter", "Symbol", "for", "register", "window", "devtoolsFormatters", "push", "header", "value", "config", "formatter", "undefined", "Error", "name", "hasBody", "body", "equalsSymbol", "Symbol", "for", "isEquatable", "value", "isEqual", "other", "loadashEqualityFn", "undefined", "exposeModule", "name", "module", "EXPOSED_MODULES", "importModule", "Error", "inspectCustom", "Symbol", "for"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/assert.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/assert.ts":{"bytes":1208,"imports":[],"format":"esm"},"src/error-handler.ts":{"bytes":3455,"imports":[{"path":"node:events","kind":"import-statement","external":true}],"format":"esm"},"src/error-stream.ts":{"bytes":3333,"imports":[],"format":"esm"},"src/fail.ts":{"bytes":1269,"imports":[],"format":"esm"},"src/inspect.ts":{"bytes":1862,"imports":[{"path":"node:util","kind":"import-statement","external":true}],"format":"esm"},"src/log-method.ts":{"bytes":3002,"imports":[],"format":"esm"},"src/raise.ts":{"bytes":1116,"imports":[],"format":"esm"},"src/snoop.ts":{"bytes":7915,"imports":[],"format":"esm"},"src/stack-trace.ts":{"bytes":2911,"imports":[],"format":"esm"},"src/strings.ts":{"bytes":2395,"imports":[],"format":"esm"},"src/throw.ts":{"bytes":1987,"imports":[],"format":"esm"},"src/timeout-warning.ts":{"bytes":5103,"imports":[{"path":"src/stack-trace.ts","kind":"import-statement","original":"./stack-trace"}],"format":"esm"},"src/todo.ts":{"bytes":836,"imports":[],"format":"esm"},"src/devtools-formatter.ts":{"bytes":6039,"imports":[],"format":"esm"},"src/equality.ts":{"bytes":2632,"imports":[],"format":"esm"},"src/exposed-modules.ts":{"bytes":2866,"imports":[],"format":"esm"},"src/inspect-custom.ts":{"bytes":1456,"imports":[],"format":"esm"},"src/index.ts":{"bytes":1855,"imports":[{"path":"src/assert.ts","kind":"import-statement","original":"./assert"},{"path":"src/error-handler.ts","kind":"import-statement","original":"./error-handler"},{"path":"src/error-stream.ts","kind":"import-statement","original":"./error-stream"},{"path":"src/fail.ts","kind":"import-statement","original":"./fail"},{"path":"src/inspect.ts","kind":"import-statement","original":"./inspect"},{"path":"src/log-method.ts","kind":"import-statement","original":"./log-method"},{"path":"src/raise.ts","kind":"import-statement","original":"./raise"},{"path":"src/snoop.ts","kind":"import-statement","original":"./snoop"},{"path":"src/stack-trace.ts","kind":"import-statement","original":"./stack-trace"},{"path":"src/strings.ts","kind":"import-statement","original":"./strings"},{"path":"src/throw.ts","kind":"import-statement","original":"./throw"},{"path":"src/timeout-warning.ts","kind":"import-statement","original":"./timeout-warning"},{"path":"src/todo.ts","kind":"import-statement","original":"./todo"},{"path":"src/devtools-formatter.ts","kind":"import-statement","original":"./devtools-formatter"},{"path":"src/equality.ts","kind":"import-statement","original":"./equality"},{"path":"src/exposed-modules.ts","kind":"import-statement","original":"./exposed-modules"},{"path":"src/inspect-custom.ts","kind":"import-statement","original":"./inspect-custom"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":24009},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"node:events","kind":"import-statement","external":true},{"path":"node:util","kind":"import-statement","external":true}],"exports":["ErrorHandler","ErrorStream","Snoop","SnoopLevel","StackTrace","checkType","devtoolsFormatter","equalsSymbol","expectToThrow","exposeModule","failUndefined","importModule","inspectCustom","inspectObject","isEqual","isEquatable","loadashEqualityFn","logMethod","raise","snoop","timed","todo","truncate","truncateKey","warnAfterTimeout"],"entryPoint":"src/index.ts","inputs":{"src/assert.ts":{"bytesInOutput":34},"src/index.ts":{"bytesInOutput":0},"src/error-handler.ts":{"bytesInOutput":613},"src/error-stream.ts":{"bytesInOutput":638},"src/fail.ts":{"bytesInOutput":91},"src/inspect.ts":{"bytesInOutput":204},"src/log-method.ts":{"bytesInOutput":597},"src/raise.ts":{"bytesInOutput":43},"src/snoop.ts":{"bytesInOutput":1806},"src/stack-trace.ts":{"bytesInOutput":541},"src/strings.ts":{"bytesInOutput":396},"src/throw.ts":{"bytesInOutput":290},"src/timeout-warning.ts":{"bytesInOutput":664},"src/todo.ts":{"bytesInOutput":79},"src/devtools-formatter.ts":{"bytesInOutput":1051},"src/equality.ts":{"bytesInOutput":407},"src/exposed-modules.ts":{"bytesInOutput":271},"src/inspect-custom.ts":{"bytesInOutput":78}},"bytes":8664}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../src/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../src/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,CAAC,KAAG,CAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equality.d.ts","sourceRoot":"","sources":["../../../src/equality.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,eAAmC,CAAC;AAE7D,MAAM,WAAW,SAAS;IACxB,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC;CACzC;AAKD,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"equality.d.ts","sourceRoot":"","sources":["../../../src/equality.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,eAAmC,CAAC;AAE7D,MAAM,WAAW,SAAS;IACxB,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC;CACzC;AAKD,eAAO,MAAM,WAAW,UAAW,GAAG,KAAG,KAAK,IAAI,SAEjD,CAAC;AAEF,eAAO,MAAM,OAAO,UAAW,SAAS,SAAS,GAAG,YAEnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,UAAW,GAAG,SAAS,GAAG,KAAG,OAAO,GAAG,SAKpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../../src/error-handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAC5C,SAAS,EAAE,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../../src/error-handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAC5C,SAAS,EAAE,aAAa,CAAC;IAEzB,cAiBC;IAED,KAAK,IAAI,IAAI,CAGZ;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-stream.d.ts","sourceRoot":"","sources":["../../../src/error-stream.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AAE1D;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAmC;IAEnD,OAAO,CAAC,gBAAgB,CAAK;IAE7B,uBAAuB,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"error-stream.d.ts","sourceRoot":"","sources":["../../../src/error-stream.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AAE1D;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAmC;IAEnD,OAAO,CAAC,gBAAgB,CAAK;IAE7B,uBAAuB,IAAI,IAAI,CAM9B;IAED,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAMxB;IAED,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAE1C;IAED,MAAM,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAElC;IAED,OAAO,CAAC,eAAe;CAOxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exposed-modules.d.ts","sourceRoot":"","sources":["../../../src/exposed-modules.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"exposed-modules.d.ts","sourceRoot":"","sources":["../../../src/exposed-modules.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,SAAU,MAAM,UAAU,GAAG,SAErD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,SAAU,MAAM,QAMxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../src/inspect.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../src/inspect.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,QAAS,GAAG,WAGrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-method.d.ts","sourceRoot":"","sources":["../../../src/log-method.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log-method.d.ts","sourceRoot":"","sources":["../../../src/log-method.ts"],"names":[],"mappings":"AAMA,wBAAgB,SAAS,CACvB,MAAM,EAAE,GAAG,EACX,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,uBAAuB,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC,GACzD,IAAI,CAiBN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raise.d.ts","sourceRoot":"","sources":["../../../src/raise.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"raise.d.ts","sourceRoot":"","sources":["../../../src/raise.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,UAAW,KAAK,KAAG,KAEpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snoop.d.ts","sourceRoot":"","sources":["../../../src/snoop.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snoop.d.ts","sourceRoot":"","sources":["../../../src/snoop.ts"],"names":[],"mappings":"AAMA,oBAAY,UAAU;IACpB,OAAO,IAAI;IACX,OAAO,IAAI;IACX,IAAI,IAAI;CACT;AAED;;GAEG;AAEH,qBAAa,KAAK;IAUJ,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;IATtC,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAOnD;IAED,YAA6B,QAAQ,CAAC,EAAE,MAAM,YAAA,EAAI;IAElD,IAAI,OAAO,eAEV;IAED,IAAI,IAAI,eAEP;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAK5E;IAED,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAE3D;IAED,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,GAAG,MAAM,CAEzD;IAED,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,UAA+B,aAEhD,GAAG,EAAE,SAMvB;IAED,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,UAA+B,aAE3C,GAAG,EAAE,kBAM7B;CACF;AAED,eAAO,MAAM,KAAK,OAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-trace.d.ts","sourceRoot":"","sources":["../../../src/stack-trace.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAQ
|
|
1
|
+
{"version":3,"file":"stack-trace.d.ts","sourceRoot":"","sources":["../../../src/stack-trace.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAQ;IAEtB,cAEC;IAED;;;;OAIG;IACH,QAAQ,CAAC,UAAU,SAAI,GAAG,MAAM,CAG/B;IAED,aAAa,CAAC,UAAU,SAAI,GAAG,MAAM,EAAE,CAGtC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../../src/strings.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../../src/strings.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,wCAA+B,OAAO,GAAG,MAAM,WAMnE,CAAC;AAEF,eAAO,MAAM,WAAW,QAAS,GAAG,4BAWnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throw.d.ts","sourceRoot":"","sources":["../../../src/throw.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"throw.d.ts","sourceRoot":"","sources":["../../../src/throw.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,SAAgB,MAAM,IAAI,8CAWnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeout-warning.d.ts","sourceRoot":"","sources":["../../../src/timeout-warning.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"timeout-warning.d.ts","sourceRoot":"","sources":["../../../src/timeout-warning.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAU,CAAC,WAAW,MAAM,WAAW,MAAM,QAAQ,MAAM,OAAO,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAa7G,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,YACnB,GAAG,gBAAgB,MAAM,cAAc,uBAAuB,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC,UAMtG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"todo.d.ts","sourceRoot":"","sources":["../../../src/todo.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"todo.d.ts","sourceRoot":"","sources":["../../../src/todo.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,IAAI,aAAc,MAAM,KAAG,KAEvC,CAAC"}
|