@grafana/faro-core 2.3.0 → 2.4.0
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/dist/bundle/faro-core.iife.js +1 -1
- package/dist/bundle/types/extensions/baseExtension.d.ts +1 -1
- package/dist/bundle/types/testUtils/mockTransport.d.ts +1 -1
- package/dist/bundle/types/version.d.ts +1 -1
- package/dist/cjs/api/ItemBuffer.js +11 -13
- package/dist/cjs/api/ItemBuffer.js.map +1 -1
- package/dist/cjs/api/events/initialize.js +12 -14
- package/dist/cjs/api/events/initialize.js.map +1 -1
- package/dist/cjs/api/exceptions/const.js +3 -3
- package/dist/cjs/api/exceptions/const.js.map +1 -1
- package/dist/cjs/api/exceptions/initialize.js +26 -39
- package/dist/cjs/api/exceptions/initialize.js.map +1 -1
- package/dist/cjs/api/initialize.js +25 -36
- package/dist/cjs/api/initialize.js.map +1 -1
- package/dist/cjs/api/logs/const.js +10 -12
- package/dist/cjs/api/logs/const.js.map +1 -1
- package/dist/cjs/api/logs/initialize.js +14 -16
- package/dist/cjs/api/logs/initialize.js.map +1 -1
- package/dist/cjs/api/measurements/initialize.js +12 -25
- package/dist/cjs/api/measurements/initialize.js.map +1 -1
- package/dist/cjs/api/meta/initialize.js +29 -41
- package/dist/cjs/api/meta/initialize.js.map +1 -1
- package/dist/cjs/api/traces/initialize.js +17 -17
- package/dist/cjs/api/traces/initialize.js.map +1 -1
- package/dist/cjs/api/userActions/initialize.js +23 -24
- package/dist/cjs/api/userActions/initialize.js.map +1 -1
- package/dist/cjs/api/userActions/userAction.js +48 -80
- package/dist/cjs/api/userActions/userAction.js.map +1 -1
- package/dist/cjs/api/utils.js +2 -2
- package/dist/cjs/api/utils.js.map +1 -1
- package/dist/cjs/extensions/baseExtension.js +17 -47
- package/dist/cjs/extensions/baseExtension.js.map +1 -1
- package/dist/cjs/initialize.js +14 -14
- package/dist/cjs/initialize.js.map +1 -1
- package/dist/cjs/instrumentations/base.js +7 -25
- package/dist/cjs/instrumentations/base.js.map +1 -1
- package/dist/cjs/instrumentations/initialize.js +14 -31
- package/dist/cjs/instrumentations/initialize.js.map +1 -1
- package/dist/cjs/instrumentations/registerInitial.js +1 -2
- package/dist/cjs/instrumentations/registerInitial.js.map +1 -1
- package/dist/cjs/internalLogger/const.js +1 -1
- package/dist/cjs/internalLogger/const.js.map +1 -1
- package/dist/cjs/internalLogger/createInternalLogger.js +13 -40
- package/dist/cjs/internalLogger/createInternalLogger.js.map +1 -1
- package/dist/cjs/internalLogger/initialize.js +2 -2
- package/dist/cjs/internalLogger/initialize.js.map +1 -1
- package/dist/cjs/metas/initialize.js +18 -26
- package/dist/cjs/metas/initialize.js.map +1 -1
- package/dist/cjs/metas/registerInitial.js +7 -28
- package/dist/cjs/metas/registerInitial.js.map +1 -1
- package/dist/cjs/sdk/faroGlobalObject.js +3 -3
- package/dist/cjs/sdk/faroGlobalObject.js.map +1 -1
- package/dist/cjs/sdk/internalFaroGlobalObject.js +2 -2
- package/dist/cjs/sdk/internalFaroGlobalObject.js.map +1 -1
- package/dist/cjs/sdk/registerFaro.js +9 -9
- package/dist/cjs/sdk/registerFaro.js.map +1 -1
- package/dist/cjs/testUtils/mockConfig.js +6 -18
- package/dist/cjs/testUtils/mockConfig.js.map +1 -1
- package/dist/cjs/testUtils/mockInternalLogger.js +1 -1
- package/dist/cjs/testUtils/mockInternalLogger.js.map +1 -1
- package/dist/cjs/testUtils/mockStacktraceParser.js +5 -5
- package/dist/cjs/testUtils/mockStacktraceParser.js.map +1 -1
- package/dist/cjs/testUtils/mockTransport.js +17 -37
- package/dist/cjs/testUtils/mockTransport.js.map +1 -1
- package/dist/cjs/testUtils/testPromise.js +3 -3
- package/dist/cjs/testUtils/testPromise.js.map +1 -1
- package/dist/cjs/transports/base.js +7 -27
- package/dist/cjs/transports/base.js.map +1 -1
- package/dist/cjs/transports/batchExecutor.js +24 -36
- package/dist/cjs/transports/batchExecutor.js.map +1 -1
- package/dist/cjs/transports/const.js +7 -8
- package/dist/cjs/transports/const.js.map +1 -1
- package/dist/cjs/transports/initialize.js +50 -79
- package/dist/cjs/transports/initialize.js.map +1 -1
- package/dist/cjs/transports/registerInitial.js +1 -2
- package/dist/cjs/transports/registerInitial.js.map +1 -1
- package/dist/cjs/transports/utils.js +13 -34
- package/dist/cjs/transports/utils.js.map +1 -1
- package/dist/cjs/unpatchedConsole/const.js +1 -12
- package/dist/cjs/unpatchedConsole/const.js.map +1 -1
- package/dist/cjs/unpatchedConsole/initialize.js +1 -1
- package/dist/cjs/unpatchedConsole/initialize.js.map +1 -1
- package/dist/cjs/utils/deepEqual.js +14 -16
- package/dist/cjs/utils/deepEqual.js.map +1 -1
- package/dist/cjs/utils/is.js +25 -29
- package/dist/cjs/utils/is.js.map +1 -1
- package/dist/cjs/utils/json.js +6 -9
- package/dist/cjs/utils/json.js.map +1 -1
- package/dist/cjs/utils/promiseBuffer.js +14 -14
- package/dist/cjs/utils/promiseBuffer.js.map +1 -1
- package/dist/cjs/utils/reactive.js +43 -50
- package/dist/cjs/utils/reactive.js.map +1 -1
- package/dist/cjs/utils/shortId.js +3 -4
- package/dist/cjs/utils/shortId.js.map +1 -1
- package/dist/cjs/utils/sourceMaps.js +2 -2
- package/dist/cjs/utils/sourceMaps.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/extensions/baseExtension.d.ts +1 -1
- package/dist/types/testUtils/mockTransport.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +8 -5
- package/dist/spec/core/src/api/ItemBuffer.js +0 -27
- package/dist/spec/core/src/api/ItemBuffer.js.map +0 -1
- package/dist/spec/core/src/api/apiTestHelpers.js +0 -40
- package/dist/spec/core/src/api/apiTestHelpers.js.map +0 -1
- package/dist/spec/core/src/api/events/index.js +0 -6
- package/dist/spec/core/src/api/events/index.js.map +0 -1
- package/dist/spec/core/src/api/events/initialize.js +0 -54
- package/dist/spec/core/src/api/events/initialize.js.map +0 -1
- package/dist/spec/core/src/api/events/initialize.test.js +0 -171
- package/dist/spec/core/src/api/events/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/events/types.js +0 -3
- package/dist/spec/core/src/api/events/types.js.map +0 -1
- package/dist/spec/core/src/api/exceptions/const.js +0 -17
- package/dist/spec/core/src/api/exceptions/const.js.map +0 -1
- package/dist/spec/core/src/api/exceptions/index.js +0 -9
- package/dist/spec/core/src/api/exceptions/index.js.map +0 -1
- package/dist/spec/core/src/api/exceptions/initialize.js +0 -104
- package/dist/spec/core/src/api/exceptions/initialize.js.map +0 -1
- package/dist/spec/core/src/api/exceptions/initialize.test.js +0 -317
- package/dist/spec/core/src/api/exceptions/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/exceptions/types.js +0 -3
- package/dist/spec/core/src/api/exceptions/types.js.map +0 -1
- package/dist/spec/core/src/api/index.js +0 -15
- package/dist/spec/core/src/api/index.js.map +0 -1
- package/dist/spec/core/src/api/initialize.js +0 -56
- package/dist/spec/core/src/api/initialize.js.map +0 -1
- package/dist/spec/core/src/api/initialize.test.js +0 -33
- package/dist/spec/core/src/api/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/itemBuffer.test.js +0 -36
- package/dist/spec/core/src/api/itemBuffer.test.js.map +0 -1
- package/dist/spec/core/src/api/logs/const.js +0 -17
- package/dist/spec/core/src/api/logs/const.js.map +0 -1
- package/dist/spec/core/src/api/logs/index.js +0 -8
- package/dist/spec/core/src/api/logs/index.js.map +0 -1
- package/dist/spec/core/src/api/logs/initialize.js +0 -58
- package/dist/spec/core/src/api/logs/initialize.js.map +0 -1
- package/dist/spec/core/src/api/logs/initialize.test.js +0 -185
- package/dist/spec/core/src/api/logs/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/logs/types.js +0 -3
- package/dist/spec/core/src/api/logs/types.js.map +0 -1
- package/dist/spec/core/src/api/measurements/index.js +0 -6
- package/dist/spec/core/src/api/measurements/index.js.map +0 -1
- package/dist/spec/core/src/api/measurements/initialize.js +0 -60
- package/dist/spec/core/src/api/measurements/initialize.js.map +0 -1
- package/dist/spec/core/src/api/measurements/initialize.test.js +0 -244
- package/dist/spec/core/src/api/measurements/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/measurements/types.js +0 -3
- package/dist/spec/core/src/api/measurements/types.js.map +0 -1
- package/dist/spec/core/src/api/meta/index.js +0 -6
- package/dist/spec/core/src/api/meta/index.js.map +0 -1
- package/dist/spec/core/src/api/meta/initialize.js +0 -92
- package/dist/spec/core/src/api/meta/initialize.js.map +0 -1
- package/dist/spec/core/src/api/meta/initilialize.test.js +0 -135
- package/dist/spec/core/src/api/meta/initilialize.test.js.map +0 -1
- package/dist/spec/core/src/api/meta/types.js +0 -3
- package/dist/spec/core/src/api/meta/types.js.map +0 -1
- package/dist/spec/core/src/api/traces/index.js +0 -6
- package/dist/spec/core/src/api/traces/index.js.map +0 -1
- package/dist/spec/core/src/api/traces/initialize.js +0 -48
- package/dist/spec/core/src/api/traces/initialize.js.map +0 -1
- package/dist/spec/core/src/api/traces/types.js +0 -3
- package/dist/spec/core/src/api/traces/types.js.map +0 -1
- package/dist/spec/core/src/api/types.js +0 -3
- package/dist/spec/core/src/api/types.js.map +0 -1
- package/dist/spec/core/src/api/userActions/const.js +0 -11
- package/dist/spec/core/src/api/userActions/const.js.map +0 -1
- package/dist/spec/core/src/api/userActions/index.js +0 -11
- package/dist/spec/core/src/api/userActions/index.js.map +0 -1
- package/dist/spec/core/src/api/userActions/initialize.js +0 -80
- package/dist/spec/core/src/api/userActions/initialize.js.map +0 -1
- package/dist/spec/core/src/api/userActions/initialize.test.js +0 -83
- package/dist/spec/core/src/api/userActions/initialize.test.js.map +0 -1
- package/dist/spec/core/src/api/userActions/types.js +0 -11
- package/dist/spec/core/src/api/userActions/types.js.map +0 -1
- package/dist/spec/core/src/api/userActions/userAction.js +0 -126
- package/dist/spec/core/src/api/userActions/userAction.js.map +0 -1
- package/dist/spec/core/src/api/userActions/userAction.test.js +0 -85
- package/dist/spec/core/src/api/userActions/userAction.test.js.map +0 -1
- package/dist/spec/core/src/api/utils.js +0 -10
- package/dist/spec/core/src/api/utils.js.map +0 -1
- package/dist/spec/core/src/api/utils.test.js +0 -20
- package/dist/spec/core/src/api/utils.test.js.map +0 -1
- package/dist/spec/core/src/config/const.js +0 -10
- package/dist/spec/core/src/config/const.js.map +0 -1
- package/dist/spec/core/src/config/index.js +0 -7
- package/dist/spec/core/src/config/index.js.map +0 -1
- package/dist/spec/core/src/config/types.js +0 -3
- package/dist/spec/core/src/config/types.js.map +0 -1
- package/dist/spec/core/src/consts.js +0 -5
- package/dist/spec/core/src/consts.js.map +0 -1
- package/dist/spec/core/src/extensions/baseExtension.js +0 -57
- package/dist/spec/core/src/extensions/baseExtension.js.map +0 -1
- package/dist/spec/core/src/extensions/index.js +0 -6
- package/dist/spec/core/src/extensions/index.js.map +0 -1
- package/dist/spec/core/src/extensions/types.js +0 -3
- package/dist/spec/core/src/extensions/types.js.map +0 -1
- package/dist/spec/core/src/faro.test.js +0 -40
- package/dist/spec/core/src/faro.test.js.map +0 -1
- package/dist/spec/core/src/globalObject/globalObject.js +0 -12
- package/dist/spec/core/src/globalObject/globalObject.js.map +0 -1
- package/dist/spec/core/src/globalObject/index.js +0 -6
- package/dist/spec/core/src/globalObject/index.js.map +0 -1
- package/dist/spec/core/src/index.js +0 -103
- package/dist/spec/core/src/index.js.map +0 -1
- package/dist/spec/core/src/initialize.js +0 -31
- package/dist/spec/core/src/initialize.js.map +0 -1
- package/dist/spec/core/src/instrumentations/base.js +0 -31
- package/dist/spec/core/src/instrumentations/base.js.map +0 -1
- package/dist/spec/core/src/instrumentations/index.js +0 -10
- package/dist/spec/core/src/instrumentations/index.js.map +0 -1
- package/dist/spec/core/src/instrumentations/initialize.js +0 -70
- package/dist/spec/core/src/instrumentations/initialize.js.map +0 -1
- package/dist/spec/core/src/instrumentations/registerInitial.js +0 -8
- package/dist/spec/core/src/instrumentations/registerInitial.js.map +0 -1
- package/dist/spec/core/src/instrumentations/types.js +0 -3
- package/dist/spec/core/src/instrumentations/types.js.map +0 -1
- package/dist/spec/core/src/internalLogger/const.js +0 -22
- package/dist/spec/core/src/internalLogger/const.js.map +0 -1
- package/dist/spec/core/src/internalLogger/createInternalLogger.js +0 -64
- package/dist/spec/core/src/internalLogger/createInternalLogger.js.map +0 -1
- package/dist/spec/core/src/internalLogger/index.js +0 -13
- package/dist/spec/core/src/internalLogger/index.js.map +0 -1
- package/dist/spec/core/src/internalLogger/initialize.js +0 -12
- package/dist/spec/core/src/internalLogger/initialize.js.map +0 -1
- package/dist/spec/core/src/internalLogger/types.js +0 -3
- package/dist/spec/core/src/internalLogger/types.js.map +0 -1
- package/dist/spec/core/src/metas/index.js +0 -8
- package/dist/spec/core/src/metas/index.js.map +0 -1
- package/dist/spec/core/src/metas/initialize.js +0 -51
- package/dist/spec/core/src/metas/initialize.js.map +0 -1
- package/dist/spec/core/src/metas/initialize.test.js +0 -20
- package/dist/spec/core/src/metas/initialize.test.js.map +0 -1
- package/dist/spec/core/src/metas/registerInitial.js +0 -53
- package/dist/spec/core/src/metas/registerInitial.js.map +0 -1
- package/dist/spec/core/src/metas/types.js +0 -3
- package/dist/spec/core/src/metas/types.js.map +0 -1
- package/dist/spec/core/src/sdk/const.js +0 -5
- package/dist/spec/core/src/sdk/const.js.map +0 -1
- package/dist/spec/core/src/sdk/faroGlobalObject.js +0 -22
- package/dist/spec/core/src/sdk/faroGlobalObject.js.map +0 -1
- package/dist/spec/core/src/sdk/index.js +0 -13
- package/dist/spec/core/src/sdk/index.js.map +0 -1
- package/dist/spec/core/src/sdk/internalFaroGlobalObject.js +0 -28
- package/dist/spec/core/src/sdk/internalFaroGlobalObject.js.map +0 -1
- package/dist/spec/core/src/sdk/registerFaro.js +0 -25
- package/dist/spec/core/src/sdk/registerFaro.js.map +0 -1
- package/dist/spec/core/src/sdk/types.js +0 -3
- package/dist/spec/core/src/sdk/types.js.map +0 -1
- package/dist/spec/core/src/semantic.js +0 -12
- package/dist/spec/core/src/semantic.js.map +0 -1
- package/dist/spec/core/src/testUtils/index.js +0 -14
- package/dist/spec/core/src/testUtils/index.js.map +0 -1
- package/dist/spec/core/src/testUtils/mockConfig.js +0 -27
- package/dist/spec/core/src/testUtils/mockConfig.js.map +0 -1
- package/dist/spec/core/src/testUtils/mockInternalLogger.js +0 -12
- package/dist/spec/core/src/testUtils/mockInternalLogger.js.map +0 -1
- package/dist/spec/core/src/testUtils/mockStacktraceParser.js +0 -21
- package/dist/spec/core/src/testUtils/mockStacktraceParser.js.map +0 -1
- package/dist/spec/core/src/testUtils/mockTransport.js +0 -45
- package/dist/spec/core/src/testUtils/mockTransport.js.map +0 -1
- package/dist/spec/core/src/testUtils/testPromise.js +0 -14
- package/dist/spec/core/src/testUtils/testPromise.js.map +0 -1
- package/dist/spec/core/src/transports/base.js +0 -34
- package/dist/spec/core/src/transports/base.js.map +0 -1
- package/dist/spec/core/src/transports/batchExecutor.js +0 -82
- package/dist/spec/core/src/transports/batchExecutor.js.map +0 -1
- package/dist/spec/core/src/transports/batchExecutor.test.js +0 -179
- package/dist/spec/core/src/transports/batchExecutor.test.js.map +0 -1
- package/dist/spec/core/src/transports/const.js +0 -20
- package/dist/spec/core/src/transports/const.js.map +0 -1
- package/dist/spec/core/src/transports/index.js +0 -15
- package/dist/spec/core/src/transports/index.js.map +0 -1
- package/dist/spec/core/src/transports/initialize.js +0 -188
- package/dist/spec/core/src/transports/initialize.js.map +0 -1
- package/dist/spec/core/src/transports/registerInitial.js +0 -9
- package/dist/spec/core/src/transports/registerInitial.js.map +0 -1
- package/dist/spec/core/src/transports/transports.test.js +0 -258
- package/dist/spec/core/src/transports/transports.test.js.map +0 -1
- package/dist/spec/core/src/transports/types.js +0 -3
- package/dist/spec/core/src/transports/types.js.map +0 -1
- package/dist/spec/core/src/transports/utils.js +0 -73
- package/dist/spec/core/src/transports/utils.js.map +0 -1
- package/dist/spec/core/src/transports/utils.test.js +0 -216
- package/dist/spec/core/src/transports/utils.test.js.map +0 -1
- package/dist/spec/core/src/unpatchedConsole/const.js +0 -16
- package/dist/spec/core/src/unpatchedConsole/const.js.map +0 -1
- package/dist/spec/core/src/unpatchedConsole/index.js +0 -9
- package/dist/spec/core/src/unpatchedConsole/index.js.map +0 -1
- package/dist/spec/core/src/unpatchedConsole/initialize.js +0 -12
- package/dist/spec/core/src/unpatchedConsole/initialize.js.map +0 -1
- package/dist/spec/core/src/unpatchedConsole/types.js +0 -3
- package/dist/spec/core/src/unpatchedConsole/types.js.map +0 -1
- package/dist/spec/core/src/utils/baseObject.js +0 -3
- package/dist/spec/core/src/utils/baseObject.js.map +0 -1
- package/dist/spec/core/src/utils/date.js +0 -15
- package/dist/spec/core/src/utils/date.js.map +0 -1
- package/dist/spec/core/src/utils/deepEqual.js +0 -61
- package/dist/spec/core/src/utils/deepEqual.js.map +0 -1
- package/dist/spec/core/src/utils/deepEqual.test.js +0 -103
- package/dist/spec/core/src/utils/deepEqual.test.js.map +0 -1
- package/dist/spec/core/src/utils/index.js +0 -60
- package/dist/spec/core/src/utils/index.js.map +0 -1
- package/dist/spec/core/src/utils/is.js +0 -66
- package/dist/spec/core/src/utils/is.js.map +0 -1
- package/dist/spec/core/src/utils/is.test.js +0 -21
- package/dist/spec/core/src/utils/is.test.js.map +0 -1
- package/dist/spec/core/src/utils/json.js +0 -32
- package/dist/spec/core/src/utils/json.js.map +0 -1
- package/dist/spec/core/src/utils/json.test.js +0 -35
- package/dist/spec/core/src/utils/json.test.js.map +0 -1
- package/dist/spec/core/src/utils/logLevels.js +0 -22
- package/dist/spec/core/src/utils/logLevels.js.map +0 -1
- package/dist/spec/core/src/utils/noop.js +0 -5
- package/dist/spec/core/src/utils/noop.js.map +0 -1
- package/dist/spec/core/src/utils/promiseBuffer.js +0 -42
- package/dist/spec/core/src/utils/promiseBuffer.js.map +0 -1
- package/dist/spec/core/src/utils/promiseBuffer.test.js +0 -146
- package/dist/spec/core/src/utils/promiseBuffer.test.js.map +0 -1
- package/dist/spec/core/src/utils/reactive.js +0 -90
- package/dist/spec/core/src/utils/reactive.js.map +0 -1
- package/dist/spec/core/src/utils/reactive.test.js +0 -117
- package/dist/spec/core/src/utils/reactive.test.js.map +0 -1
- package/dist/spec/core/src/utils/sampling.js +0 -7
- package/dist/spec/core/src/utils/sampling.js.map +0 -1
- package/dist/spec/core/src/utils/sampling.test.js +0 -17
- package/dist/spec/core/src/utils/sampling.test.js.map +0 -1
- package/dist/spec/core/src/utils/shortId.js +0 -11
- package/dist/spec/core/src/utils/shortId.js.map +0 -1
- package/dist/spec/core/src/utils/sourceMaps.js +0 -8
- package/dist/spec/core/src/utils/sourceMaps.js.map +0 -1
- package/dist/spec/core/src/utils/sourceMaps.test.js +0 -17
- package/dist/spec/core/src/utils/sourceMaps.test.js.map +0 -1
- package/dist/spec/core/src/version.js +0 -6
- package/dist/spec/core/src/version.js.map +0 -1
- package/dist/types/core/src/api/ItemBuffer.d.ts +0 -7
- package/dist/types/core/src/api/apiTestHelpers.d.ts +0 -13
- package/dist/types/core/src/api/events/index.d.ts +0 -2
- package/dist/types/core/src/api/events/initialize.d.ts +0 -17
- package/dist/types/core/src/api/events/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/events/types.d.ts +0 -29
- package/dist/types/core/src/api/exceptions/const.d.ts +0 -2
- package/dist/types/core/src/api/exceptions/index.d.ts +0 -3
- package/dist/types/core/src/api/exceptions/initialize.d.ts +0 -17
- package/dist/types/core/src/api/exceptions/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/exceptions/types.d.ts +0 -61
- package/dist/types/core/src/api/index.d.ts +0 -11
- package/dist/types/core/src/api/initialize.d.ts +0 -7
- package/dist/types/core/src/api/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/itemBuffer.test.d.ts +0 -1
- package/dist/types/core/src/api/logs/const.d.ts +0 -2
- package/dist/types/core/src/api/logs/index.d.ts +0 -3
- package/dist/types/core/src/api/logs/initialize.d.ts +0 -17
- package/dist/types/core/src/api/logs/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/logs/types.d.ts +0 -24
- package/dist/types/core/src/api/measurements/index.d.ts +0 -2
- package/dist/types/core/src/api/measurements/initialize.d.ts +0 -17
- package/dist/types/core/src/api/measurements/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/measurements/types.d.ts +0 -25
- package/dist/types/core/src/api/meta/index.d.ts +0 -2
- package/dist/types/core/src/api/meta/initialize.d.ts +0 -15
- package/dist/types/core/src/api/meta/initilialize.test.d.ts +0 -1
- package/dist/types/core/src/api/meta/types.d.ts +0 -21
- package/dist/types/core/src/api/traces/index.d.ts +0 -2
- package/dist/types/core/src/api/traces/initialize.d.ts +0 -7
- package/dist/types/core/src/api/traces/types.d.ts +0 -20
- package/dist/types/core/src/api/types.d.ts +0 -14
- package/dist/types/core/src/api/userActions/const.d.ts +0 -8
- package/dist/types/core/src/api/userActions/index.d.ts +0 -4
- package/dist/types/core/src/api/userActions/initialize.d.ts +0 -21
- package/dist/types/core/src/api/userActions/initialize.test.d.ts +0 -1
- package/dist/types/core/src/api/userActions/types.d.ts +0 -55
- package/dist/types/core/src/api/userActions/userAction.d.ts +0 -36
- package/dist/types/core/src/api/userActions/userAction.test.d.ts +0 -1
- package/dist/types/core/src/api/utils.d.ts +0 -2
- package/dist/types/core/src/api/utils.test.d.ts +0 -1
- package/dist/types/core/src/config/const.d.ts +0 -6
- package/dist/types/core/src/config/index.d.ts +0 -2
- package/dist/types/core/src/config/types.d.ts +0 -237
- package/dist/types/core/src/consts.d.ts +0 -1
- package/dist/types/core/src/extensions/baseExtension.d.ts +0 -15
- package/dist/types/core/src/extensions/index.d.ts +0 -2
- package/dist/types/core/src/extensions/types.d.ts +0 -16
- package/dist/types/core/src/faro.test.d.ts +0 -1
- package/dist/types/core/src/globalObject/globalObject.d.ts +0 -6
- package/dist/types/core/src/globalObject/index.d.ts +0 -2
- package/dist/types/core/src/index.d.ts +0 -25
- package/dist/types/core/src/initialize.d.ts +0 -3
- package/dist/types/core/src/instrumentations/base.d.ts +0 -9
- package/dist/types/core/src/instrumentations/index.d.ts +0 -4
- package/dist/types/core/src/instrumentations/initialize.d.ts +0 -8
- package/dist/types/core/src/instrumentations/registerInitial.d.ts +0 -2
- package/dist/types/core/src/instrumentations/types.d.ts +0 -14
- package/dist/types/core/src/internalLogger/const.d.ts +0 -11
- package/dist/types/core/src/internalLogger/createInternalLogger.d.ts +0 -4
- package/dist/types/core/src/internalLogger/index.d.ts +0 -4
- package/dist/types/core/src/internalLogger/initialize.d.ts +0 -5
- package/dist/types/core/src/internalLogger/types.d.ts +0 -7
- package/dist/types/core/src/metas/index.d.ts +0 -3
- package/dist/types/core/src/metas/initialize.d.ts +0 -5
- package/dist/types/core/src/metas/initialize.test.d.ts +0 -1
- package/dist/types/core/src/metas/registerInitial.d.ts +0 -2
- package/dist/types/core/src/metas/types.d.ts +0 -118
- package/dist/types/core/src/sdk/const.d.ts +0 -1
- package/dist/types/core/src/sdk/faroGlobalObject.d.ts +0 -2
- package/dist/types/core/src/sdk/index.d.ts +0 -4
- package/dist/types/core/src/sdk/internalFaroGlobalObject.d.ts +0 -4
- package/dist/types/core/src/sdk/registerFaro.d.ts +0 -10
- package/dist/types/core/src/sdk/types.d.ts +0 -18
- package/dist/types/core/src/semantic.d.ts +0 -8
- package/dist/types/core/src/testUtils/index.d.ts +0 -6
- package/dist/types/core/src/testUtils/mockConfig.d.ts +0 -2
- package/dist/types/core/src/testUtils/mockInternalLogger.d.ts +0 -2
- package/dist/types/core/src/testUtils/mockStacktraceParser.d.ts +0 -2
- package/dist/types/core/src/testUtils/mockTransport.d.ts +0 -13
- package/dist/types/core/src/testUtils/testPromise.d.ts +0 -7
- package/dist/types/core/src/transports/base.d.ts +0 -8
- package/dist/types/core/src/transports/batchExecutor.d.ts +0 -16
- package/dist/types/core/src/transports/batchExecutor.test.d.ts +0 -1
- package/dist/types/core/src/transports/const.d.ts +0 -9
- package/dist/types/core/src/transports/index.d.ts +0 -6
- package/dist/types/core/src/transports/initialize.d.ts +0 -6
- package/dist/types/core/src/transports/registerInitial.d.ts +0 -2
- package/dist/types/core/src/transports/transports.test.d.ts +0 -1
- package/dist/types/core/src/transports/types.d.ts +0 -45
- package/dist/types/core/src/transports/utils.d.ts +0 -5
- package/dist/types/core/src/transports/utils.test.d.ts +0 -1
- package/dist/types/core/src/unpatchedConsole/const.d.ts +0 -2
- package/dist/types/core/src/unpatchedConsole/index.d.ts +0 -3
- package/dist/types/core/src/unpatchedConsole/initialize.d.ts +0 -4
- package/dist/types/core/src/unpatchedConsole/types.d.ts +0 -1
- package/dist/types/core/src/utils/baseObject.d.ts +0 -6
- package/dist/types/core/src/utils/date.d.ts +0 -3
- package/dist/types/core/src/utils/deepEqual.d.ts +0 -1
- package/dist/types/core/src/utils/deepEqual.test.d.ts +0 -1
- package/dist/types/core/src/utils/index.d.ts +0 -16
- package/dist/types/core/src/utils/is.d.ts +0 -32
- package/dist/types/core/src/utils/is.test.d.ts +0 -1
- package/dist/types/core/src/utils/json.d.ts +0 -3
- package/dist/types/core/src/utils/json.test.d.ts +0 -1
- package/dist/types/core/src/utils/logLevels.d.ts +0 -10
- package/dist/types/core/src/utils/noop.d.ts +0 -1
- package/dist/types/core/src/utils/promiseBuffer.d.ts +0 -14
- package/dist/types/core/src/utils/promiseBuffer.test.d.ts +0 -1
- package/dist/types/core/src/utils/reactive.d.ts +0 -17
- package/dist/types/core/src/utils/reactive.test.d.ts +0 -1
- package/dist/types/core/src/utils/sampling.d.ts +0 -1
- package/dist/types/core/src/utils/sampling.test.d.ts +0 -1
- package/dist/types/core/src/utils/shortId.d.ts +0 -1
- package/dist/types/core/src/utils/sourceMaps.d.ts +0 -1
- package/dist/types/core/src/utils/sourceMaps.test.d.ts +0 -1
- package/dist/types/core/src/version.d.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deepEqual = deepEqual;
|
|
4
|
-
|
|
4
|
+
const is_1 = require("./is");
|
|
5
5
|
// This function was inspired by fast-deep-equal
|
|
6
6
|
// fast-deep-equal has issues with Rollup and also it checks for some edge cases that we don't need
|
|
7
7
|
function deepEqual(a, b) {
|
|
@@ -12,44 +12,42 @@ function deepEqual(a, b) {
|
|
|
12
12
|
if ((0, is_1.isTypeof)(a, 'number') && isNaN(a)) {
|
|
13
13
|
return (0, is_1.isTypeof)(b, 'number') && isNaN(b);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const aIsArray = (0, is_1.isArray)(a);
|
|
16
|
+
const bIsArray = (0, is_1.isArray)(b);
|
|
17
17
|
if (aIsArray !== bIsArray) {
|
|
18
18
|
return false;
|
|
19
19
|
}
|
|
20
20
|
if (aIsArray && bIsArray) {
|
|
21
|
-
|
|
22
|
-
if (
|
|
21
|
+
const length = a.length;
|
|
22
|
+
if (length !== b.length) {
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
25
|
-
for (
|
|
25
|
+
for (let idx = length; idx-- !== 0;) {
|
|
26
26
|
if (!deepEqual(a[idx], b[idx])) {
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
return true;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const aIsObject = (0, is_1.isObject)(a);
|
|
33
|
+
const bIsObject = (0, is_1.isObject)(b);
|
|
34
34
|
if (aIsObject !== bIsObject) {
|
|
35
35
|
return false;
|
|
36
36
|
}
|
|
37
37
|
if (a && b && aIsObject && bIsObject) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
const aKeys = Object.keys(a);
|
|
39
|
+
const bKeys = Object.keys(b);
|
|
40
|
+
const aLength = aKeys.length;
|
|
41
|
+
const bLength = bKeys.length;
|
|
42
42
|
if (aLength !== bLength) {
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
|
-
for (
|
|
46
|
-
var aKey = aKeys_1[_i];
|
|
45
|
+
for (let aKey of aKeys) {
|
|
47
46
|
if (!bKeys.includes(aKey)) {
|
|
48
47
|
return false;
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
|
-
for (
|
|
52
|
-
var aKey = aKeys_2[_a];
|
|
50
|
+
for (let aKey of aKeys) {
|
|
53
51
|
if (!deepEqual(a[aKey], b[aKey])) {
|
|
54
52
|
return false;
|
|
55
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepEqual.js","sourceRoot":"","sources":["../../../src/utils/deepEqual.ts"],"names":[],"mappings":";;AAKA,8BAkEC;AAvED,
|
|
1
|
+
{"version":3,"file":"deepEqual.js","sourceRoot":"","sources":["../../../src/utils/deepEqual.ts"],"names":[],"mappings":";;AAKA,8BAkEC;AAvED,6BAAmD;AAEnD,gDAAgD;AAChD,mGAAmG;AAEnG,SAAgB,SAAS,CAAC,CAAM,EAAE,CAAM;IACtC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,yEAAyE;IACzE,IAAI,IAAA,aAAQ,EAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAW,CAAC,EAAE,CAAC;QAChD,OAAO,IAAA,aAAQ,EAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAW,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,QAAQ,GAAG,IAAA,YAAO,EAAC,CAAC,CAAC,CAAC;IAC5B,MAAM,QAAQ,GAAG,IAAA,YAAO,EAAC,CAAC,CAAC,CAAC;IAE5B,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;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,CAAC;gBACjC,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { isArray, isObject, isTypeof } from './is';\n\n// This function was inspired by fast-deep-equal\n// fast-deep-equal has issues with Rollup and also it checks for some edge cases that we don't need\n\nexport function deepEqual(a: any, b: any): boolean {\n if (a === b) {\n return true;\n }\n\n // Using isTypeOf instead of isNumber as isNumber also checks against NaN\n if (isTypeof(a, 'number') && isNaN(a as number)) {\n return isTypeof(b, 'number') && isNaN(b as number);\n }\n\n const aIsArray = isArray(a);\n const bIsArray = isArray(b);\n\n if (aIsArray !== bIsArray) {\n return false;\n }\n\n if (aIsArray && bIsArray) {\n const length = a.length;\n\n if (length !== b.length) {\n return false;\n }\n\n for (let idx = length; idx-- !== 0; ) {\n if (!deepEqual(a[idx], b[idx])) {\n return false;\n }\n }\n\n return true;\n }\n\n const aIsObject = isObject(a);\n const bIsObject = isObject(b);\n\n if (aIsObject !== bIsObject) {\n return false;\n }\n\n if (a && b && aIsObject && bIsObject) {\n const aKeys = Object.keys(a) as Array<keyof typeof a>;\n const bKeys = Object.keys(b);\n const aLength = aKeys.length;\n const bLength = bKeys.length;\n\n if (aLength !== bLength) {\n return false;\n }\n\n for (let aKey of aKeys) {\n if (!bKeys.includes(aKey)) {\n return false;\n }\n }\n\n for (let aKey of aKeys) {\n if (!deepEqual(a[aKey], b[aKey])) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}
|
package/dist/cjs/utils/is.js
CHANGED
|
@@ -9,7 +9,7 @@ function isTypeof(value, type) {
|
|
|
9
9
|
return typeof value === type;
|
|
10
10
|
}
|
|
11
11
|
function isToString(value, type) {
|
|
12
|
-
return Object.prototype.toString.call(value) ===
|
|
12
|
+
return Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
13
13
|
}
|
|
14
14
|
function isInstanceOf(value, reference) {
|
|
15
15
|
try {
|
|
@@ -19,38 +19,34 @@ function isInstanceOf(value, reference) {
|
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
exports.isUndefined = (
|
|
23
|
-
exports.isNull = (
|
|
24
|
-
exports.isString = (
|
|
25
|
-
exports.isNumber = (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.isThenable = (function (value) { return (0, exports.isFunction)(value === null || value === void 0 ? void 0 : value.then); });
|
|
36
|
-
exports.isPrimitive = (function (value) { return !(0, exports.isObject)(value) && !(0, exports.isFunction)(value); });
|
|
22
|
+
exports.isUndefined = ((value) => isTypeof(value, 'undefined'));
|
|
23
|
+
exports.isNull = ((value) => isTypeof(value, 'null'));
|
|
24
|
+
exports.isString = ((value) => isTypeof(value, 'string'));
|
|
25
|
+
exports.isNumber = ((value) => (isTypeof(value, 'number') && !isNaN(value)) || isTypeof(value, 'bigint'));
|
|
26
|
+
exports.isInt = ((value) => (0, exports.isNumber)(value) && Number.isInteger(value));
|
|
27
|
+
exports.isBoolean = ((value) => isTypeof(value, 'boolean'));
|
|
28
|
+
exports.isSymbol = ((value) => isTypeof(value, 'symbol'));
|
|
29
|
+
exports.isObject = ((value) => !(0, exports.isNull)(value) && isTypeof(value, 'object'));
|
|
30
|
+
exports.isFunction = ((value) => isTypeof(value, 'function'));
|
|
31
|
+
exports.isArray = ((value) => isToString(value, 'Array'));
|
|
32
|
+
exports.isRegExp = ((value) => isToString(value, 'RegExp'));
|
|
33
|
+
exports.isThenable = ((value) => (0, exports.isFunction)(value === null || value === void 0 ? void 0 : value.then));
|
|
34
|
+
exports.isPrimitive = ((value) => !(0, exports.isObject)(value) && !(0, exports.isFunction)(value));
|
|
37
35
|
exports.isEventDefined = typeof Event !== 'undefined';
|
|
38
|
-
exports.isEvent = (
|
|
36
|
+
exports.isEvent = ((value) => exports.isEventDefined && isInstanceOf(value, Event));
|
|
39
37
|
exports.isErrorDefined = typeof Error !== 'undefined';
|
|
40
|
-
exports.isError = (
|
|
41
|
-
exports.isErrorEvent = (
|
|
42
|
-
exports.isDomError = (
|
|
43
|
-
exports.isDomException = (
|
|
38
|
+
exports.isError = ((value) => exports.isErrorDefined && isInstanceOf(value, Error));
|
|
39
|
+
exports.isErrorEvent = ((value) => isToString(value, 'ErrorEvent'));
|
|
40
|
+
exports.isDomError = ((value) => isToString(value, 'DOMError'));
|
|
41
|
+
exports.isDomException = ((value) => isToString(value, 'DOMException'));
|
|
44
42
|
exports.isElementDefined = typeof Element !== 'undefined';
|
|
45
|
-
exports.isElement = (
|
|
43
|
+
exports.isElement = ((value) => exports.isElementDefined && isInstanceOf(value, Element));
|
|
46
44
|
exports.isMapDefined = typeof Map !== 'undefined';
|
|
47
|
-
exports.isMap = (
|
|
48
|
-
exports.isSyntheticEvent = (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
'stopPropagation' in value;
|
|
53
|
-
});
|
|
45
|
+
exports.isMap = ((value) => exports.isMapDefined && isInstanceOf(value, Map));
|
|
46
|
+
exports.isSyntheticEvent = ((value) => (0, exports.isObject)(value) &&
|
|
47
|
+
'nativeEvent' in value &&
|
|
48
|
+
'preventDefault' in value &&
|
|
49
|
+
'stopPropagation' in value);
|
|
54
50
|
function isEmpty(value) {
|
|
55
51
|
if (value == null) {
|
|
56
52
|
return true;
|
package/dist/cjs/utils/is.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is.js","sourceRoot":"","sources":["../../../src/utils/is.ts"],"names":[],"mappings":";;;AAEA,4BAEC;AAED,gCAEC;AAED,oCAMC;AA2DD,0BAcC;AAvFD,SAAgB,QAAQ,CAAc,KAAc,EAAE,IAAY;IAChE,OAAO,OAAO,KAAK,KAAK,IAAI,CAAC;AAC/B,CAAC;AAED,SAAgB,UAAU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ClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,IAAA,eAAO,EAAC,KAAK,CAAC,IAAI,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,IAAI,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["export type IsFnHelper<T = unknown> = (value: unknown) => value is T;\n\nexport function isTypeof<T = unknown>(value: unknown, type: string): value is T {\n return typeof value === type;\n}\n\nexport function isToString<T = unknown>(value: unknown, type: string): value is T {\n return Object.prototype.toString.call(value) === `[object ${type}]`;\n}\n\nexport function isInstanceOf<T extends Function = any>(value: unknown, reference: T): value is T {\n try {\n return value instanceof reference;\n } catch (_err) {\n return false;\n }\n}\n\nexport const isUndefined = ((value) => isTypeof(value, 'undefined')) as IsFnHelper<undefined>;\n\nexport const isNull = ((value) => isTypeof(value, 'null')) as IsFnHelper<null>;\n\nexport const isString = ((value) => isTypeof(value, 'string')) as IsFnHelper<string>;\n\nexport const isNumber = ((value) =>\n (isTypeof<number>(value, 'number') && !isNaN(value)) || isTypeof(value, 'bigint')) as IsFnHelper<number | bigint>;\n\nexport const isInt = ((value) => isNumber(value) && Number.isInteger(value)) as IsFnHelper<number>;\n\nexport const isBoolean = ((value) => isTypeof(value, 'boolean')) as IsFnHelper<boolean>;\n\nexport const isSymbol = ((value) => isTypeof(value, 'symbol')) as IsFnHelper<Symbol>;\n\nexport const isObject = ((value) => !isNull(value) && isTypeof(value, 'object')) as IsFnHelper<object>;\n\nexport const isFunction = ((value) => isTypeof(value, 'function')) as IsFnHelper<Function>;\n\nexport const isArray = ((value) => isToString(value, 'Array')) as IsFnHelper<unknown[]>;\n\nexport const isRegExp = ((value) => isToString(value, 'RegExp')) as IsFnHelper<string>;\n\nexport const isThenable = ((value) => isFunction((value as any)?.then)) as IsFnHelper<{ then: Function }>;\n\nexport const isPrimitive = ((value) => !isObject(value) && !isFunction(value)) as IsFnHelper<\n string | number | bigint | boolean | symbol\n>;\n\nexport const isEventDefined = typeof Event !== 'undefined';\n\nexport const isEvent = ((value) => isEventDefined && isInstanceOf(value, Event)) as IsFnHelper<Event>;\n\nexport const isErrorDefined = typeof Error !== 'undefined';\n\nexport const isError = ((value) => isErrorDefined && isInstanceOf(value, Error)) as IsFnHelper<Error>;\n\nexport const isErrorEvent = ((value) => isToString(value, 'ErrorEvent')) as IsFnHelper<ErrorEvent>;\n\nexport const isDomError = ((value) => isToString(value, 'DOMError')) as IsFnHelper<DOMException>;\n\nexport const isDomException = ((value) => isToString(value, 'DOMException')) as IsFnHelper<DOMException>;\n\nexport const isElementDefined = typeof Element !== 'undefined';\n\nexport const isElement = ((value) => isElementDefined && isInstanceOf(value, Element)) as IsFnHelper<Element>;\n\nexport const isMapDefined = typeof Map !== 'undefined';\n\nexport const isMap = ((value) => isMapDefined && isInstanceOf(value, Map)) as IsFnHelper<Map<any, any>>;\n\nexport const isSyntheticEvent = ((value: unknown) =>\n isObject(value) &&\n 'nativeEvent' in value &&\n 'preventDefault' in value &&\n 'stopPropagation' in value) as unknown as IsFnHelper<Event>;\n\nexport function isEmpty(value: any): boolean {\n if (value == null) {\n return true;\n }\n\n if (isArray(value) || isString(value)) {\n return value.length === 0;\n }\n\n if (isObject(value)) {\n return Object.keys(value).length === 0;\n }\n\n return false;\n}\n"]}
|
package/dist/cjs/utils/json.js
CHANGED
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getCircularDependencyReplacer = getCircularDependencyReplacer;
|
|
4
4
|
exports.stringifyExternalJson = stringifyExternalJson;
|
|
5
5
|
exports.stringifyObjectValues = stringifyObjectValues;
|
|
6
|
-
|
|
6
|
+
const is_1 = require("./is");
|
|
7
7
|
function getCircularDependencyReplacer() {
|
|
8
|
-
|
|
8
|
+
const valueSeen = new WeakSet();
|
|
9
9
|
return function (_key, value) {
|
|
10
10
|
if ((0, is_1.isObject)(value) && value !== null) {
|
|
11
11
|
if (valueSeen.has(value)) {
|
|
@@ -16,15 +16,12 @@ function getCircularDependencyReplacer() {
|
|
|
16
16
|
return value;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function stringifyExternalJson(json) {
|
|
20
|
-
if (json === void 0) { json = {}; }
|
|
19
|
+
function stringifyExternalJson(json = {}) {
|
|
21
20
|
return JSON.stringify(json !== null && json !== void 0 ? json : {}, getCircularDependencyReplacer());
|
|
22
21
|
}
|
|
23
|
-
function stringifyObjectValues(obj) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
for (var _i = 0, _a = Object.entries(obj); _i < _a.length; _i++) {
|
|
27
|
-
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
22
|
+
function stringifyObjectValues(obj = {}) {
|
|
23
|
+
const o = {};
|
|
24
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
28
25
|
o[key] = (0, is_1.isObject)(value) && value !== null ? stringifyExternalJson(value) : String(value);
|
|
29
26
|
}
|
|
30
27
|
return o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/utils/json.ts"],"names":[],"mappings":";;AAEA,sEAWC;AAQD,sDAEC;AAED,sDAQC;AAjCD,
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/utils/json.ts"],"names":[],"mappings":";;AAEA,sEAWC;AAQD,sDAEC;AAED,sDAQC;AAjCD,6BAAgC;AAEhC,SAAgB,6BAA6B;IAC3C,MAAM,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;IAChC,OAAO,UAAU,IAAqB,EAAE,KAAc;QACpD,IAAI,IAAA,aAAQ,EAAC,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACtC,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC;AAQD,SAAgB,qBAAqB,CAAC,OAAY,EAAE;IAClD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EAAE,6BAA6B,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,SAAgB,qBAAqB,CAAC,MAA+B,EAAE;IACrE,MAAM,CAAC,GAA2B,EAAE,CAAC;IAErC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,CAAC,CAAC,GAAG,CAAC,GAAG,IAAA,aAAQ,EAAC,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5F,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["import { isObject } from './is';\n\nexport function getCircularDependencyReplacer() {\n const valueSeen = new WeakSet();\n return function (_key: string | Symbol, value: unknown) {\n if (isObject(value) && value !== null) {\n if (valueSeen.has(value)) {\n return null;\n }\n valueSeen.add(value);\n }\n return value;\n };\n}\n\ntype JSONObject = {\n [key: string]: JSONValue;\n};\ntype JSONArray = JSONValue[] & {};\ntype JSONValue = string | number | boolean | null | JSONObject | JSONArray;\n\nexport function stringifyExternalJson(json: any = {}) {\n return JSON.stringify(json ?? {}, getCircularDependencyReplacer());\n}\n\nexport function stringifyObjectValues(obj: Record<string, unknown> = {}) {\n const o: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n o[key] = isObject(value) && value !== null ? stringifyExternalJson(value) : String(value);\n }\n\n return o;\n}\n"]}
|
|
@@ -2,41 +2,41 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPromiseBuffer = createPromiseBuffer;
|
|
4
4
|
function createPromiseBuffer(options) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const { size, concurrency } = options;
|
|
6
|
+
const buffer = []; // pending, not-yet-started tasks
|
|
7
|
+
let inProgress = 0; // counter for tasks currently in progress
|
|
8
|
+
const work = () => {
|
|
9
9
|
// if there's space for a task and buffer is not empty,
|
|
10
10
|
// take one task from buffer and run it
|
|
11
11
|
if (inProgress < concurrency && buffer.length) {
|
|
12
|
-
|
|
12
|
+
const { producer, resolve, reject } = buffer.shift();
|
|
13
13
|
inProgress++;
|
|
14
|
-
producer().then(
|
|
14
|
+
producer().then((result) => {
|
|
15
15
|
inProgress--;
|
|
16
16
|
work();
|
|
17
|
-
|
|
18
|
-
},
|
|
17
|
+
resolve(result);
|
|
18
|
+
}, (reason) => {
|
|
19
19
|
inProgress--;
|
|
20
20
|
work();
|
|
21
|
-
|
|
21
|
+
reject(reason);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
const add = (promiseProducer) => {
|
|
26
26
|
if (buffer.length + inProgress >= size) {
|
|
27
27
|
throw new Error('Task buffer full');
|
|
28
28
|
}
|
|
29
|
-
return new Promise(
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
30
|
buffer.push({
|
|
31
31
|
producer: promiseProducer,
|
|
32
|
-
resolve
|
|
33
|
-
reject
|
|
32
|
+
resolve,
|
|
33
|
+
reject,
|
|
34
34
|
});
|
|
35
35
|
work();
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
return {
|
|
39
|
-
add
|
|
39
|
+
add,
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
//# sourceMappingURL=promiseBuffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promiseBuffer.js","sourceRoot":"","sources":["../../../src/utils/promiseBuffer.ts"],"names":[],"mappings":";;AAmBA,kDAmDC;AAnDD,SAAgB,mBAAmB,CAAI,OAA6B;
|
|
1
|
+
{"version":3,"file":"promiseBuffer.js","sourceRoot":"","sources":["../../../src/utils/promiseBuffer.ts"],"names":[],"mappings":";;AAmBA,kDAmDC;AAnDD,SAAgB,mBAAmB,CAAI,OAA6B;IAClE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEtC,MAAM,MAAM,GAAyB,EAAE,CAAC,CAAC,iCAAiC;IAC1E,IAAI,UAAU,GAAG,CAAC,CAAC,CAAC,0CAA0C;IAE9D,MAAM,IAAI,GAAG,GAAG,EAAE;QAChB,uDAAuD;QACvD,uCAAuC;QACvC,IAAI,UAAU,GAAG,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAC9C,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,EAAG,CAAC;YAEtD,UAAU,EAAE,CAAC;YAEb,QAAQ,EAAE,CAAC,IAAI,CACb,CAAC,MAAM,EAAE,EAAE;gBACT,UAAU,EAAE,CAAC;gBAEb,IAAI,EAAE,CAAC;gBAEP,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC,EACD,CAAC,MAAM,EAAE,EAAE;gBACT,UAAU,EAAE,CAAC;gBAEb,IAAI,EAAE,CAAC;gBAEP,MAAM,CAAC,MAAM,CAAC,CAAC;YACjB,CAAC,CACF,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,GAAG,GAA4B,CAAC,eAAe,EAAE,EAAE;QACvD,IAAI,MAAM,CAAC,MAAM,GAAG,UAAU,IAAI,IAAI,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACxC,MAAM,CAAC,IAAI,CAAC;gBACV,QAAQ,EAAE,eAAe;gBACzB,OAAO;gBACP,MAAM;aACP,CAAC,CAAC;YACH,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,GAAG;KACJ,CAAC;AACJ,CAAC","sourcesContent":["export interface PromiseBufferOptions {\n // total number of concurrent tasks\n concurrency: number;\n // total number of uncompleted tasks to accept\n size: number;\n}\n\nexport type PromiseProducer<T> = () => PromiseLike<T>;\n\nexport interface PromiseBuffer<T> {\n add(promiseProducer: PromiseProducer<T>): PromiseLike<T>;\n}\n\nexport interface BufferItem<T> {\n producer: PromiseProducer<T>;\n resolve: (value: T) => void;\n reject: (reason?: any) => void;\n}\n\nexport function createPromiseBuffer<T>(options: PromiseBufferOptions): PromiseBuffer<T> {\n const { size, concurrency } = options;\n\n const buffer: Array<BufferItem<T>> = []; // pending, not-yet-started tasks\n let inProgress = 0; // counter for tasks currently in progress\n\n const work = () => {\n // if there's space for a task and buffer is not empty,\n // take one task from buffer and run it\n if (inProgress < concurrency && buffer.length) {\n const { producer, resolve, reject } = buffer.shift()!;\n\n inProgress++;\n\n producer().then(\n (result) => {\n inProgress--;\n\n work();\n\n resolve(result);\n },\n (reason) => {\n inProgress--;\n\n work();\n\n reject(reason);\n }\n );\n }\n };\n\n const add: PromiseBuffer<T>['add'] = (promiseProducer) => {\n if (buffer.length + inProgress >= size) {\n throw new Error('Task buffer full');\n }\n\n return new Promise<T>((resolve, reject) => {\n buffer.push({\n producer: promiseProducer,\n resolve,\n reject,\n });\n work();\n });\n };\n\n return {\n add,\n };\n}\n"]}
|
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Observable = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
class Observable {
|
|
5
|
+
constructor() {
|
|
6
6
|
this.subscribers = [];
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
var _this = this;
|
|
8
|
+
subscribe(subscriber) {
|
|
10
9
|
this.subscribers.push(subscriber);
|
|
11
10
|
return {
|
|
12
|
-
unsubscribe:
|
|
11
|
+
unsubscribe: () => this.unsubscribe(subscriber),
|
|
13
12
|
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
this.subscribers = this.subscribers.filter(
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
this.subscribers.forEach(
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
}
|
|
14
|
+
unsubscribe(subscriber) {
|
|
15
|
+
this.subscribers = this.subscribers.filter((sub) => sub !== subscriber);
|
|
16
|
+
}
|
|
17
|
+
notify(value) {
|
|
18
|
+
this.subscribers.forEach((subscriber) => subscriber(value));
|
|
19
|
+
}
|
|
20
|
+
first() {
|
|
21
|
+
const result = new Observable();
|
|
22
|
+
const internalSubscriber = (data) => {
|
|
24
23
|
result.notify(data);
|
|
25
24
|
subscription.unsubscribe();
|
|
26
25
|
};
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const subscription = this.subscribe(internalSubscriber);
|
|
27
|
+
const resultUnsubscribeFn = result.unsubscribe.bind(result);
|
|
29
28
|
return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
}
|
|
30
|
+
takeWhile(predicate) {
|
|
31
|
+
const result = new Observable();
|
|
32
|
+
const internalSubscriber = (value) => {
|
|
34
33
|
if (predicate(value)) {
|
|
35
34
|
result.notify(value);
|
|
36
35
|
}
|
|
@@ -39,52 +38,46 @@ var Observable = /** @class */ (function () {
|
|
|
39
38
|
}
|
|
40
39
|
};
|
|
41
40
|
this.subscribe(internalSubscriber);
|
|
42
|
-
|
|
41
|
+
const resultUnsubscribeFn = result.unsubscribe.bind(result);
|
|
43
42
|
return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
}
|
|
44
|
+
filter(predicate) {
|
|
45
|
+
const result = new Observable();
|
|
46
|
+
const internalSubscriber = (value) => {
|
|
48
47
|
if (predicate(value)) {
|
|
49
48
|
result.notify(value);
|
|
50
49
|
}
|
|
51
50
|
};
|
|
52
51
|
this.subscribe(internalSubscriber);
|
|
53
|
-
|
|
52
|
+
const resultUnsubscribeFn = result.unsubscribe.bind(result);
|
|
54
53
|
return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var mergerObservable = new Observable();
|
|
62
|
-
var subscriptions = [];
|
|
63
|
-
observables.forEach(function (observable) {
|
|
64
|
-
var subscription = observable.subscribe(function (value) {
|
|
54
|
+
}
|
|
55
|
+
merge(...observables) {
|
|
56
|
+
const mergerObservable = new Observable();
|
|
57
|
+
const subscriptions = [];
|
|
58
|
+
observables.forEach((observable) => {
|
|
59
|
+
const subscription = observable.subscribe((value) => {
|
|
65
60
|
mergerObservable.notify(value);
|
|
66
61
|
});
|
|
67
62
|
subscriptions.push(subscription);
|
|
68
63
|
});
|
|
69
|
-
|
|
70
|
-
mergerObservable.unsubscribe =
|
|
71
|
-
subscriptions.forEach(
|
|
64
|
+
const originalUnsubscribeAll = mergerObservable.unsubscribeAll.bind(mergerObservable);
|
|
65
|
+
mergerObservable.unsubscribe = () => {
|
|
66
|
+
subscriptions.forEach((subscription) => subscription.unsubscribe());
|
|
72
67
|
originalUnsubscribeAll();
|
|
73
68
|
};
|
|
74
69
|
return mergerObservable;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
observable.unsubscribe = function (subscriber) {
|
|
70
|
+
}
|
|
71
|
+
withUnsubscribeOverride(observable, resultUnsubscribeFn, internalSubscriber) {
|
|
72
|
+
observable.unsubscribe = (subscriber) => {
|
|
79
73
|
resultUnsubscribeFn(subscriber);
|
|
80
|
-
|
|
74
|
+
this.unsubscribe(internalSubscriber);
|
|
81
75
|
};
|
|
82
76
|
return observable;
|
|
83
|
-
}
|
|
84
|
-
|
|
77
|
+
}
|
|
78
|
+
unsubscribeAll() {
|
|
85
79
|
this.subscribers = [];
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
}());
|
|
80
|
+
}
|
|
81
|
+
}
|
|
89
82
|
exports.Observable = Observable;
|
|
90
83
|
//# sourceMappingURL=reactive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactive.js","sourceRoot":"","sources":["../../../src/utils/reactive.ts"],"names":[],"mappings":";;;AAMA;
|
|
1
|
+
{"version":3,"file":"reactive.js","sourceRoot":"","sources":["../../../src/utils/reactive.ts"],"names":[],"mappings":";;;AAMA,MAAa,UAAU;IAAvB;QACU,gBAAW,GAAyB,EAAE,CAAC;IA+FjD,CAAC;IA7FC,SAAS,CAAC,UAAyB;QACjC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,OAAO;YACL,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;SAChD,CAAC;IACJ,CAAC;IAED,WAAW,CAAC,UAAyB;QACnC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,UAAU,CAAC,CAAC;IAC1E,CAAC;IAED,MAAM,CAAC,KAAQ;QACb,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK;QAC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Ac;QACpB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;CACF;AAhGD,gCAgGC","sourcesContent":["export type Subscription = {\n unsubscribe: () => void;\n};\n\ntype Subscriber<T> = (value: T) => void;\n\nexport class Observable<T = any> {\n private subscribers: Array<Subscriber<T>> = [];\n\n subscribe(subscriber: Subscriber<T>): Subscription {\n this.subscribers.push(subscriber);\n return {\n unsubscribe: () => this.unsubscribe(subscriber),\n };\n }\n\n unsubscribe(subscriber: Subscriber<T>): void {\n this.subscribers = this.subscribers.filter((sub) => sub !== subscriber);\n }\n\n notify(value: T): void {\n this.subscribers.forEach((subscriber) => subscriber(value));\n }\n\n first(): Observable<T> {\n const result = new Observable<T>();\n\n const internalSubscriber = (data: T): void => {\n result.notify(data);\n subscription.unsubscribe();\n };\n const subscription = this.subscribe(internalSubscriber);\n const resultUnsubscribeFn = result.unsubscribe.bind(result);\n return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);\n }\n\n takeWhile(predicate: (value: T) => boolean): Observable<T> {\n const result = new Observable<T>();\n const internalSubscriber = (value: T): void => {\n if (predicate(value)) {\n result.notify(value);\n } else {\n result.unsubscribe(internalSubscriber);\n }\n };\n this.subscribe(internalSubscriber);\n const resultUnsubscribeFn = result.unsubscribe.bind(result);\n return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);\n }\n\n filter(predicate: (value: T) => boolean): Observable<T> {\n const result = new Observable<T>();\n\n const internalSubscriber = (value: T): void => {\n if (predicate(value)) {\n result.notify(value);\n }\n };\n this.subscribe(internalSubscriber);\n\n const resultUnsubscribeFn = result.unsubscribe.bind(result);\n return this.withUnsubscribeOverride(result, resultUnsubscribeFn, internalSubscriber);\n }\n\n merge(...observables: Array<Observable<T>>): Observable<T> {\n const mergerObservable = new Observable<T>();\n const subscriptions: Subscription[] = [];\n\n observables.forEach((observable) => {\n const subscription = observable.subscribe((value: T) => {\n mergerObservable.notify(value);\n });\n\n subscriptions.push(subscription);\n });\n\n const originalUnsubscribeAll = mergerObservable.unsubscribeAll.bind(mergerObservable);\n\n mergerObservable.unsubscribe = () => {\n subscriptions.forEach((subscription) => subscription.unsubscribe());\n originalUnsubscribeAll();\n };\n\n return mergerObservable;\n }\n\n private withUnsubscribeOverride(\n observable: Observable<T>,\n resultUnsubscribeFn: (subscriber: Subscriber<T>) => void,\n internalSubscriber: Subscriber<T>\n ) {\n observable.unsubscribe = (subscriber: Subscriber<T>) => {\n resultUnsubscribeFn(subscriber);\n this.unsubscribe(internalSubscriber);\n };\n\n return observable;\n }\n\n private unsubscribeAll(): void {\n this.subscribers = [];\n }\n}\n"]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.genShortID = genShortID;
|
|
4
|
-
|
|
5
|
-
function genShortID(length) {
|
|
6
|
-
if (length === void 0) { length = 10; }
|
|
4
|
+
const alphabet = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789';
|
|
5
|
+
function genShortID(length = 10) {
|
|
7
6
|
return Array.from(Array(length))
|
|
8
|
-
.map(
|
|
7
|
+
.map(() => alphabet[Math.floor(Math.random() * alphabet.length)])
|
|
9
8
|
.join('');
|
|
10
9
|
}
|
|
11
10
|
//# sourceMappingURL=shortId.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortId.js","sourceRoot":"","sources":["../../../src/utils/shortId.ts"],"names":[],"mappings":";;AAEA,gCAIC;AAND,
|
|
1
|
+
{"version":3,"file":"shortId.js","sourceRoot":"","sources":["../../../src/utils/shortId.ts"],"names":[],"mappings":";;AAEA,gCAIC;AAND,MAAM,QAAQ,GAAG,6DAA6D,CAAC;AAE/E,SAAgB,UAAU,CAAC,MAAM,GAAG,EAAE;IACpC,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC7B,GAAG,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAE,CAAC;SACjE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC","sourcesContent":["const alphabet = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789';\n\nexport function genShortID(length = 10): string {\n return Array.from(Array(length))\n .map(() => alphabet[Math.floor(Math.random() * alphabet.length)]!)\n .join('');\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBundleId = getBundleId;
|
|
4
|
-
|
|
4
|
+
const globalObject_1 = require("../globalObject");
|
|
5
5
|
function getBundleId(appName) {
|
|
6
|
-
return globalObject_1.globalObject === null || globalObject_1.globalObject === void 0 ? void 0 : globalObject_1.globalObject[
|
|
6
|
+
return globalObject_1.globalObject === null || globalObject_1.globalObject === void 0 ? void 0 : globalObject_1.globalObject[`__faroBundleId_${appName}`];
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=sourceMaps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceMaps.js","sourceRoot":"","sources":["../../../src/utils/sourceMaps.ts"],"names":[],"mappings":";;AAEA,kCAEC;AAJD,
|
|
1
|
+
{"version":3,"file":"sourceMaps.js","sourceRoot":"","sources":["../../../src/utils/sourceMaps.ts"],"names":[],"mappings":";;AAEA,kCAEC;AAJD,kDAA+C;AAE/C,SAAgB,WAAW,CAAC,OAAe;IACzC,OAAQ,2BAAoB,aAApB,2BAAY,uBAAZ,2BAAY,CAAW,kBAAkB,OAAO,EAAE,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import { globalObject } from '../globalObject';\n\nexport function getBundleId(appName: string): string | undefined {\n return (globalObject as any)?.[`__faroBundleId_${appName}`];\n}\n"]}
|
package/dist/cjs/version.js
CHANGED
package/dist/cjs/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '2.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '2.4.0';\n"]}
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '2.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// auto-generated by bin/genVersion.ts\nexport const VERSION = '2.4.0';\n"]}
|
|
@@ -5,7 +5,7 @@ export declare abstract class BaseExtension implements Extension {
|
|
|
5
5
|
abstract readonly name: string;
|
|
6
6
|
abstract readonly version: string;
|
|
7
7
|
unpatchedConsole: Console;
|
|
8
|
-
internalLogger: import("
|
|
8
|
+
internalLogger: import("..").InternalLogger;
|
|
9
9
|
config: Config;
|
|
10
10
|
metas: Metas;
|
|
11
11
|
logDebug(...args: unknown[]): void;
|
|
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
|
|
|
4
4
|
export declare class MockTransport extends BaseTransport implements Transport {
|
|
5
5
|
private ignoreURLs;
|
|
6
6
|
readonly name = "@grafana/transport-mock";
|
|
7
|
-
readonly version = "2.
|
|
7
|
+
readonly version = "2.4.0";
|
|
8
8
|
items: TransportItem[];
|
|
9
9
|
constructor(ignoreURLs?: Patterns);
|
|
10
10
|
send(items: TransportItem[]): void | Promise<void>;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.4.0";
|