summaryrefslogtreecommitdiff
path: root/node_modules/roarr
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
commit726b81b19251674e149ccfbb1abacbd837fc6db0 (patch)
treefbdbb227dc01357eb76e8222d76185bc124c5ca6 /node_modules/roarr
parent34f0890e175698940d49238097579f44e4d78c89 (diff)
downloadFlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.gz
FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.zst
Removed files that should not have been included in git
Diffstat (limited to 'node_modules/roarr')
-rw-r--r--node_modules/roarr/LICENSE24
-rw-r--r--node_modules/roarr/README.md689
-rw-r--r--node_modules/roarr/dist/constants.js16
-rw-r--r--node_modules/roarr/dist/constants.js.flow10
-rw-r--r--node_modules/roarr/dist/constants.js.map1
-rw-r--r--node_modules/roarr/dist/factories/createLogger.js192
-rw-r--r--node_modules/roarr/dist/factories/createLogger.js.flow197
-rw-r--r--node_modules/roarr/dist/factories/createLogger.js.map1
-rw-r--r--node_modules/roarr/dist/factories/createMockLogger.js44
-rw-r--r--node_modules/roarr/dist/factories/createMockLogger.js.flow46
-rw-r--r--node_modules/roarr/dist/factories/createMockLogger.js.map1
-rw-r--r--node_modules/roarr/dist/factories/createNodeWriter.js25
-rw-r--r--node_modules/roarr/dist/factories/createNodeWriter.js.flow22
-rw-r--r--node_modules/roarr/dist/factories/createNodeWriter.js.map1
-rw-r--r--node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js53
-rw-r--r--node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js.flow43
-rw-r--r--node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js.map1
-rw-r--r--node_modules/roarr/dist/factories/index.js32
-rw-r--r--node_modules/roarr/dist/factories/index.js.flow11
-rw-r--r--node_modules/roarr/dist/factories/index.js.map1
-rw-r--r--node_modules/roarr/dist/log.js42
-rw-r--r--node_modules/roarr/dist/log.js.flow47
-rw-r--r--node_modules/roarr/dist/log.js.map1
-rw-r--r--node_modules/roarr/dist/types.js2
-rw-r--r--node_modules/roarr/dist/types.js.flow81
-rw-r--r--node_modules/roarr/dist/types.js.map1
-rw-r--r--node_modules/roarr/package.json93
27 files changed, 0 insertions, 1677 deletions
diff --git a/node_modules/roarr/LICENSE b/node_modules/roarr/LICENSE
deleted file mode 100644
index 5065086..0000000
--- a/node_modules/roarr/LICENSE
+++ /dev/null
@@ -1,24 +0,0 @@
-Copyright (c) 2019, Gajus Kuizinas (http://gajus.com/)
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Gajus Kuizinas (http://gajus.com/) nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL ANUARY BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/roarr/README.md b/node_modules/roarr/README.md
deleted file mode 100644
index 9f1c267..0000000
--- a/node_modules/roarr/README.md
+++ /dev/null
@@ -1,689 +0,0 @@
-<a name="roarr"></a>
-# Roarr
-
-[![GitSpo Mentions](https://gitspo.com/badges/mentions/gajus/roarr?style=flat-square)](https://gitspo.com/mentions/gajus/roarr)
-[![Travis build status](http://img.shields.io/travis/gajus/roarr/master.svg?style=flat-square)](https://travis-ci.org/gajus/roarr)
-[![Coveralls](https://img.shields.io/coveralls/gajus/roarr.svg?style=flat-square)](https://coveralls.io/github/gajus/roarr)
-[![NPM version](http://img.shields.io/npm/v/roarr.svg?style=flat-square)](https://www.npmjs.org/package/roarr)
-[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)
-[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social&label=Follow)](https://twitter.com/kuizinas)
-
-JSON logger for Node.js and browser.
-
-* [Roarr](#roarr)
- * [Motivation](#roarr-motivation)
- * [Usage](#roarr-usage)
- * [Producing logs](#roarr-usage-producing-logs)
- * [Consuming logs](#roarr-usage-consuming-logs)
- * [Filtering logs](#roarr-usage-filtering-logs)
- * [Log message format](#roarr-log-message-format)
- * [API](#roarr-api)
- * [`adopt`](#roarr-api-adopt)
- * [`child`](#roarr-api-child)
- * [`getContext`](#roarr-api-getcontext)
- * [`trace`](#roarr-api-trace)
- * [`debug`](#roarr-api-debug)
- * [`info`](#roarr-api-info)
- * [`warn`](#roarr-api-warn)
- * [`error`](#roarr-api-error)
- * [`fatal`](#roarr-api-fatal)
- * [Middlewares](#roarr-middlewares)
- * [CLI program](#roarr-cli-program)
- * [Transports](#roarr-transports)
- * [Node.js environment variables](#roarr-node-js-environment-variables)
- * [Conventions](#roarr-conventions)
- * [Context property names](#roarr-conventions-context-property-names)
- * [Using Roarr in an application](#roarr-conventions-using-roarr-in-an-application)
- * [Recipes](#roarr-recipes)
- * [Logging errors](#roarr-recipes-logging-errors)
- * [Using with Elasticsearch](#roarr-recipes-using-with-elasticsearch)
- * [Using with Scalyr](#roarr-recipes-using-with-scalyr)
- * [Documenting use of Roarr](#roarr-recipes-documenting-use-of-roarr)
-
-
-<a name="roarr-motivation"></a>
-## Motivation
-
-For a long time I have been a big fan of using [`debug`](https://github.com/visionmedia/debug). `debug` is simple to use, works in Node.js and browser, does not require configuration and it is fast. However, problems arise when you need to parse logs. Anything but one-line text messages cannot be parsed in a safe way.
-
-To log structured data, I have been using [Winston](https://github.com/winstonjs/winston) and [Bunyan](https://github.com/trentm/node-bunyan). These packages are great for application-level logging. I have preferred Bunyan because of the [Bunyan CLI program](https://github.com/trentm/node-bunyan#cli-usage) used to pretty-print logs. However, these packages require program-level configuration – when constructing an instance of a logger, you need to define the transport and the log-level. This makes them unsuitable for use in code designed to be consumed by other applications.
-
-Then there is [pino](https://github.com/pinojs/pino). pino is fast JSON logger, it has CLI program equivalent to Bunyan, it decouples transports, and it has sane default configuration. Unfortunately, you still need to instantiate logger instance at the application-level. This makes it more suitable for application-level logging just like Winston and Bunyan.
-
-I needed a logger that:
-
-* Does not block the event cycle (=fast).
-* Does not require initialisation.
-* Produces structured data.
-* [Decouples transports](#transports).
-* Has a [CLI program](#cli-program).
-* Works in Node.js and browser.
-* Configurable using environment variables.
-
-In other words,
-
-* a logger that I can use in an application code and in dependencies.
-* a logger that allows to correlate logs between the main application code and the dependency code.
-* a logger that works well with transports in external processes.
-
-Roarr is this logger.
-
-<a name="roarr-usage"></a>
-## Usage
-
-<a name="roarr-usage-producing-logs"></a>
-### Producing logs
-
-Roarr logger API for producing logs is the same in Node.js and browser.
-
-1. Import `roarr`
-2. Use any of the [API](#api) methods to log messages.
-
-Example:
-
-```js
-import log from 'roarr';
-
-log('foo');
-
-```
-
-<a name="roarr-usage-consuming-logs"></a>
-### Consuming logs
-
-Roarr logs are consumed differently in Node.js and browser.
-
-<a name="roarr-usage-consuming-logs-node-js"></a>
-#### Node.js
-
-In Node.js, Roarr logging is disabled by default. To enable logging, you must start program with an environment variable `ROARR_LOG` set to `true`, e.g.
-
-```bash
-ROARR_LOG=true node ./index.js
-
-```
-
-All logs will be written to stdout.
-
-<a name="roarr-usage-consuming-logs-browser"></a>
-#### Browser
-
-In a browser, you must implement `ROARR.write` method to read logs, e.g.
-
-```js
-import {
- ROARR,
-} from 'roarr';
-
-ROARR.write = () => {};
-
-```
-
-The API of the `ROARR.write` is:
-
-```js
-(message: string) => void;
-
-```
-
-Example implementation:
-
-```js
-import {
- ROARR,
-} from 'roarr';
-
-ROARR.write = (message) => {
- console.log(JSON.parse(message));
-};
-
-```
-
-or if you are initializing `ROARR.write` _before_ `roarr` is loaded:
-
-```js
-// Ensure that `globalThis.ROARR` is configured.
-const ROARR = globalThis.ROARR = globalThis.ROARR || {};
-
-ROARR.write = (message) => {
- console.log(JSON.parse(message));
-};
-
-```
-
-If your platform does not support [`globalThis`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis), use [`globalthis` polyfill](https://www.npmjs.com/package/globalthis).
-
-<a name="roarr-usage-filtering-logs"></a>
-### Filtering logs
-
-<a name="roarr-usage-filtering-logs-node-js-1"></a>
-#### Node.js
-
-In Node.js, Roarr prints all or none logs (refer to the [`ROARR_LOG` environment variable](#environment-variables) documentation).
-
-Use [`roarr filter` CLI program](#filter-program) to filter the logs that are written to stdout by the program, e.g.
-
-```bash
-ROARR_LOG=true node ./index.js | roarr filter '{"context.logLevel":{gt:30}}'
-
-```
-
-Alternatively, use a JSON processor such as [jq](https://stedolan.github.io/jq/)
-
-<a name="roarr-usage-filtering-logs-browser-1"></a>
-#### Browser
-
-In a browser, Roarr calls `globalThis.ROARR.write` for every log message. Implement your own custom logic to filter logs, e.g.
-
-```js
-globalThis.ROARR.write = (message) => {
- const payload = JSON.parse(message);
-
- if (payload.context.logLevel > 30) {
- console.log(payload);
- }
-};
-
-```
-
-<a name="roarr-log-message-format"></a>
-## Log message format
-
-|Property name|Contents|
-|---|---|
-|`context`|Arbitrary, user-provided structured data. See [context property names](#context-property-names).|
-|`message`|User-provided message formatted using [printf](https://en.wikipedia.org/wiki/Printf_format_string).|
-|`sequence`|An incremental ID.|
-|`time`|Unix timestamp in milliseconds.|
-|`version`|Roarr log message format version.|
-
-Example:
-
-```js
-{
- "context": {
- "application": "task-runner",
- "hostname": "curiosity.local",
- "instanceId": "01BVBK4ZJQ182ZWF6FK4EC8FEY",
- "taskId": 1
- },
- "message": "starting task ID 1",
- "sequence": 0,
- "time": 1506776210000,
- "version": "1.0.0"
-}
-
-```
-
-<a name="roarr-api"></a>
-## API
-
-`roarr` package exports a function with the following API:
-
-```js
-export type LoggerType =
- (
- context: MessageContextType,
- message: string,
- c?: SprintfArgumentType,
- d?: SprintfArgumentType,
- e?: SprintfArgumentType,
- f?: SprintfArgumentType,
- g?: SprintfArgumentType,
- h?: SprintfArgumentType,
- i?: SprintfArgumentType,
- k?: SprintfArgumentType
- ) => void |
- (
- message: string,
- b?: SprintfArgumentType,
- c?: SprintfArgumentType,
- d?: SprintfArgumentType,
- e?: SprintfArgumentType,
- f?: SprintfArgumentType,
- g?: SprintfArgumentType,
- h?: SprintfArgumentType,
- i?: SprintfArgumentType,
- k?: SprintfArgumentType
- ) => void;
-
-```
-
-To put it into words:
-
-* First parameter can be either a string (message) or an object.
- * If first parameter is an object (context), the second parameter must be a string (message).
-* Arguments after the message parameter are used to enable [printf message formatting](https://en.wikipedia.org/wiki/Printf_format_string).
- * Printf arguments must be of a primitive type (`string | number | boolean | null`).
- * There can be up to 9 printf arguments (or 8 if the first parameter is the context object).
-
-Refer to the [Usage documentation](#usage) for common usage examples.
-
-<a name="roarr-api-adopt"></a>
-### <code>adopt</code>
-
-```js
-<T>(routine: () => Promise<T>, context: MessageContextType) => Promise<T>,
-
-```
-
-`adopt` function uses Node.js [`domain`](https://nodejs.org/api/domain.html) to pass-down context properties.
-
-When using `adopt`, context properties will be added to all _all_ Roarr messages within the same asynchronous context, e.g.
-
-```js
-await log.adopt(
- async () => {
- log('foo 0');
-
- await log.adopt(
- () => {
- log('foo 1');
- },
- {
- baz: 'baz 1',
- },
- );
- },
- {
- bar: 'bar 0',
- },
-);
-
-// {"context":{"bar":"bar 0"},"message":"foo 0","sequence":0,"time":1531914656076,"version":"1.0.0"}
-// {"context":{"bar":"bar 0","baz":"baz 1"},"message":"foo 1","sequence":1,"time":1531914656077,"version":"1.0.0"}]
-
-```
-
-<a name="roarr-api-adopt-requirements"></a>
-#### Requirements
-
-* `adopt` method only works in Node.js.
-* You must shim Node.js using [`domain-parent`](https://github.com/gajus/domain-parent).
-
-<a name="roarr-api-child"></a>
-### <code>child</code>
-
-```js
-(context: TranslateMessageFunctionType | MessageContextType) => LoggerType,
-
-```
-
-The `child` function has two signatures:
-
-1. Accepts an object.
-2. Accepts a function.
-
-<a name="roarr-api-child-object-parameter"></a>
-#### Object parameter
-
-```js
-(context: MessageContextType) => LoggerType;
-
-```
-
-Creates a child logger appending the provided `context` object to the previous logger context.
-
-Example:
-
-```js
-import log from 'roarr';
-
-const childLog = log.child({
- foo: 'bar'
-});
-
-log.debug('foo 1');
-childLog.debug('foo 2');
-
-// {"context":{"logLevel":20},"message":"foo 1","sequence":0,"time":1531914529921,"version":"1.0.0"}
-// {"context":{"foo":"bar","logLevel":20},"message":"foo 2","sequence":1,"time":1531914529922,"version":"1.0.0"}
-
-```
-
-Refer to [middlewares](#middlewares) documentation for use case examples.
-
-<a name="roarr-api-child-function-parameter"></a>
-#### Function parameter
-
-```js
-(translateMessage: TranslateMessageFunctionType) => LoggerType;
-
-```
-
-Creates a child logger where every message is intercepted.
-
-Example:
-
-```js
-import log from 'roarr';
-
-const childLog = log.child((message) => {
- return {
- ...message,
- message: message.message.replace('foo', 'bar'),
- }
-});
-
-log.debug('foo 1');
-childLog.debug('foo 2');
-
-// {"context":{"logLevel":20},"message":"foo 1","sequence":0,"time":1531914656076,"version":"1.0.0"}
-// {"context":{"logLevel":20},"message":"bar 2","sequence":1,"time":1531914656077,"version":"1.0.0"}
-
-```
-
-<a name="roarr-api-getcontext"></a>
-### <code>getContext</code>
-
-Returns the current context.
-
-Example:
-
-```js
-import log from 'roarr';
-
-const childLogger = log.child({
- foo: 'bar'
-});
-
-childLogger.getContext();
-
-// {foo: 'bar'}
-
-```
-
-<a name="roarr-api-trace"></a>
-### <code>trace</code>
-<a name="roarr-api-debug"></a>
-### <code>debug</code>
-<a name="roarr-api-info"></a>
-### <code>info</code>
-<a name="roarr-api-warn"></a>
-### <code>warn</code>
-<a name="roarr-api-error"></a>
-### <code>error</code>
-<a name="roarr-api-fatal"></a>
-### <code>fatal</code>
-
-Convenience methods for logging a message with `logLevel` context property value set to a numeric value representing the [log level](#log-levels), e.g.
-
-```js
-import log from 'roarr';
-
-log.trace('foo');
-log.debug('foo');
-log.info('foo');
-log.warn('foo');
-log.error('foo');
-log.fatal('foo');
-
-```
-
-Produces output:
-
-```
-{"context":{"logLevel":10},"message":"foo","sequence":0,"time":1506776210000,"version":"1.0.0"}
-{"context":{"logLevel":20},"message":"foo","sequence":1,"time":1506776210000,"version":"1.0.0"}
-{"context":{"logLevel":30},"message":"foo","sequence":2,"time":1506776210000,"version":"1.0.0"}
-{"context":{"logLevel":40},"message":"foo","sequence":3,"time":1506776210000,"version":"1.0.0"}
-{"context":{"logLevel":50},"message":"foo","sequence":4,"time":1506776210000,"version":"1.0.0"}
-{"context":{"logLevel":60},"message":"foo","sequence":5,"time":1506776210000,"version":"1.0.0"}
-
-```
-
-<a name="roarr-middlewares"></a>
-## Middlewares
-
-Roarr logger supports middlewares implemented as [`child`](#child) message translate functions, e.g.
-
-```js
-import log from 'roarr';
-import createSerializeErrorMiddleware from '@roarr/middleware-serialize-error';
-
-const childLog = log.child(createSerializeErrorMiddleware());
-
-const error = new Error('foo');
-
-log.debug({error}, 'bar');
-childLog.debug({error}, 'bar');
-
-// {"context":{"logLevel":20,"error":{}},"message":"bar","sequence":0,"time":1531918373676,"version":"1.0.0"}
-// {"context":{"logLevel":20,"error":{"name":"Error","message":"foo","stack":"[REDACTED]"}},"message":"bar","sequence":1,"time":1531918373678,"version":"1.0.0"}
-
-```
-
-Roarr middlwares enable translation of every bit of information that is used to construct a log message.
-
-The following are the official middlewares:
-
-* [`@roarr/middleware-serialize-error`](https://github.com/gajus/roarr-middleware-serialize-error)
-
-Raise an issue to add your middleware of your own creation.
-
-<a name="roarr-cli-program"></a>
-## CLI program
-
-Roarr CLI program provides ability to filter and pretty-print Roarr logs.
-
-![CLI output demo](./.README/cli-output-demo.png)
-
-CLI program has been moved to a separate package [`@roarr/cli`](https://github.com/gajus/roarr-cli).
-
-```bash
-npm install @roarr/cli -g
-
-```
-
-Explore all CLI commands and options using `roarr --help` or refer to [`@roarr/cli`](https://github.com/gajus/roarr-cli) documentation.
-
-<a name="roarr-transports"></a>
-## Transports
-
-A transport in most logging libraries is something that runs in-process to perform some operation with the finalised log line. For example, a transport might send the log line to a standard syslog server after processing the log line and reformatting it.
-
-Roarr does not support in-process transports.
-
-Roarr does not support in-process transports because Node processes are single threaded processes (ignoring some technical details). Given this restriction, Roarr purposefully offloads handling of the logs to external processes so that the threading capabilities of the OS can be used (or other CPUs).
-
-Depending on your configuration, consider one of the following log transports:
-
-* [Beats](https://www.elastic.co/products/beats) for aggregating at a process level (written in Go).
-* [logagent](https://github.com/sematext/logagent-js) for aggregating at a process level (written in JavaScript).
-* [Fluentd](https://www.fluentd.org/) for aggregating logs at a container orchestration level (e.g. Kubernetes) (written in Ruby).
-
-<a name="roarr-node-js-environment-variables"></a>
-## Node.js environment variables
-
-Use environment variables to control `roarr` behaviour.
-
-|Name|Type|Function|Default|
-|---|---|---|---|
-|`ROARR_LOG`|Boolean|Enables/ disables logging.|`false`|
-|`ROARR_STREAM`|`STDOUT`, `STDERR`|Name of the stream where the logs will be written.|`STDOUT`|
-
-When using `ROARR_STREAM=STDERR`, use [`3>&1 1>&2 2>&3 3>&-`](https://stackoverflow.com/a/2381643/368691) to pipe stderr output.
-
-<a name="roarr-conventions"></a>
-## Conventions
-
-<a name="roarr-conventions-context-property-names"></a>
-### Context property names
-
-Roarr does not have reserved context property names. However, I encourage use of the following conventions:
-
-|Context property name|Use case|
-|---|---|
-|`application`|Name of the application (do not use in code intended for distribution; see `package` property instead).|
-|`logLevel`|A numeric value indicating the [log level](#log-levels). See [API](#api) for the build-in loggers with a pre-set log-level.|
-|`namespace`|Namespace within a package, e.g. function name. Treat the same way that you would construct namespaces when using the [`debug`](https://github.com/visionmedia/debug) package.|
-|`package`|Name of the NPM package.|
-
-The `roarr pretty-print` [CLI program](#cli-program) is using the context property names suggested in the conventions to pretty-print the logs for the developer inspection purposes.
-
-<a name="roarr-conventions-context-property-names-log-levels"></a>
-#### Log levels
-
-The `roarr pretty-print` [CLI program](#cli-program) translates `logLevel` values to the following human-readable names:
-
-|`logLevel`|Human-readable name|
-|---|---|
-|10|TRACE|
-|20|DEBUG|
-|30|INFO|
-|40|WARN|
-|50|ERROR|
-|60|FATAL|
-
-<a name="roarr-conventions-using-roarr-in-an-application"></a>
-### Using Roarr in an application
-
-To avoid code duplication, you can use a singleton pattern to export a logger instance with predefined context properties (e.g. describing the application).
-
-I recommend to create a file `Logger.js` in the project directory. Inside this file create and export a child instance of Roarr with context parameters describing the project and the script instance, e.g.
-
-```js
-/**
- * @file Example contents of a Logger.js file.
- */
-
-import log from 'roarr';
-
-const Logger = log.child({
- // .foo property is going to appear only in the logs that are created using
- // the current instance of a Roarr logger.
- foo: 'bar'
-});
-
-export default Logger;
-
-```
-
-Roarr does not have reserved context property names. However, I encourage use of the [conventions](#conventions).
-
-<a name="roarr-recipes"></a>
-## Recipes
-
-<a name="roarr-recipes-logging-errors"></a>
-### Logging errors
-
-This is not specific to Roarr – this suggestion applies to any kind of logging.
-
-If you want to include an instance of [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) in the context, you must serialize the error.
-
-The least-error prone way to do this is to use an existing library, e.g. [`serialize-error`](https://www.npmjs.com/package/serialize-error).
-
-```js
-import log from 'roarr';
-import serializeError from 'serialize-error';
-
-// [..]
-
-send((error, result) => {
- if (error) {
- log.error({
- error: serializeError(error)
- }, 'message not sent due to a remote error');
-
- return;
- }
-
- // [..]
-});
-
-```
-
-Without using serialisation, your errors will be logged without the error name and stack trace.
-
-<a name="roarr-recipes-using-with-elasticsearch"></a>
-### Using with Elasticsearch
-
-If you are using [Elasticsearch](https://www.elastic.co/products/elasticsearch), you will want to create an [index template](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html).
-
-The following serves as the ground work for the index template. It includes the main Roarr log message properties (context, message, time) and the context properties suggested in the [conventions](#conventions).
-
-```json
-{
- "mappings": {
- "log_message": {
- "_source": {
- "enabled": true
- },
- "dynamic": "strict",
- "properties": {
- "context": {
- "dynamic": true,
- "properties": {
- "application": {
- "type": "keyword"
- },
- "hostname": {
- "type": "keyword"
- },
- "instanceId": {
- "type": "keyword"
- },
- "logLevel": {
- "type": "integer"
- },
- "namespace": {
- "type": "text"
- },
- "package": {
- "type": "text"
- }
- }
- },
- "message": {
- "type": "text"
- },
- "time": {
- "format": "epoch_millis",
- "type": "date"
- }
- }
- }
- },
- "template": "logstash-*"
-}
-
-```
-
-<a name="roarr-recipes-using-with-scalyr"></a>
-### Using with Scalyr
-
-If you are using [Scalyr](https://www.scalyr.com/), you will want to create a custom parser `RoarrLogger`:
-
-```js
-{
- patterns: {
- tsPattern: "\\w{3},\\s\\d{2}\\s\\w{3}\\s\\d{4}\\s[\\d:]+",
- tsPattern_8601: "\\d{4}-\\d{2}-\\d{2}T[\\d:.]+Z"
- }
- formats: [
- {format: "${parse=json}$"},
- {format: ".*\"time\":$timestamp=number$,.*"},
- {format: "$timestamp=tsPattern$ GMT $detail$"},
- {format: "$timestamp=tsPattern_8601$ $detail$"}
- ]
-}
-
-```
-
-and configure the individual programs to use `RoarrLogger`. In case of Kubernetes, this means adding a `log.config.scalyr.com/attributes.parser: RoarrLogger` annotation to the associated deployment, pod or container.
-
-<a name="roarr-recipes-documenting-use-of-roarr"></a>
-### Documenting use of Roarr
-
-If your package is using Roarr, include instructions in `README.md` describing how to enable logging, e.g.
-
-```md
-## Logging
-
-This package is using [`roarr`](https://www.npmjs.com/package/roarr) logger to log the program's state.
-
-Export `ROARR_LOG=true` environment variable to enable log printing to stdout.
-
-Use [`roarr-cli`](https://github.com/gajus/roarr-cli) program to pretty-print the logs.
-
-```
diff --git a/node_modules/roarr/dist/constants.js b/node_modules/roarr/dist/constants.js
deleted file mode 100644
index 799cf55..0000000
--- a/node_modules/roarr/dist/constants.js
+++ /dev/null
@@ -1,16 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.logLevels = void 0;
-const logLevels = {
- debug: 20,
- error: 50,
- fatal: 60,
- info: 30,
- trace: 10,
- warn: 40
-};
-exports.logLevels = logLevels;
-//# sourceMappingURL=constants.js.map \ No newline at end of file
diff --git a/node_modules/roarr/dist/constants.js.flow b/node_modules/roarr/dist/constants.js.flow
deleted file mode 100644
index 59116ad..0000000
--- a/node_modules/roarr/dist/constants.js.flow
+++ /dev/null
@@ -1,10 +0,0 @@
-// @flow
-
-export const logLevels = {
- debug: 20,
- error: 50,
- fatal: 60,
- info: 30,
- trace: 10,
- warn: 40,
-};
diff --git a/node_modules/roarr/dist/constants.js.map b/node_modules/roarr/dist/constants.js.map
deleted file mode 100644
index dc45d21..0000000
--- a/node_modules/roarr/dist/constants.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../src/constants.js"],"names":["logLevels","debug","error","fatal","info","trace","warn"],"mappings":";;;;;;AAEO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,KAAK,EAAE,EADgB;AAEvBC,EAAAA,KAAK,EAAE,EAFgB;AAGvBC,EAAAA,KAAK,EAAE,EAHgB;AAIvBC,EAAAA,IAAI,EAAE,EAJiB;AAKvBC,EAAAA,KAAK,EAAE,EALgB;AAMvBC,EAAAA,IAAI,EAAE;AANiB,CAAlB","sourcesContent":["// @flow\n\nexport const logLevels = {\n debug: 20,\n error: 50,\n fatal: 60,\n info: 30,\n trace: 10,\n warn: 40,\n};\n"],"file":"constants.js"} \ No newline at end of file
diff --git a/node_modules/roarr/dist/factories/createLogger.js b/node_modules/roarr/dist/factories/createLogger.js
deleted file mode 100644
index 3936101..0000000
--- a/node_modules/roarr/dist/factories/createLogger.js
+++ /dev/null
@@ -1,192 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = void 0;
-
-var _detectNode = _interopRequireDefault(require("detect-node"));
-
-var _globalthis = _interopRequireDefault(require("globalthis"));
-
-var _jsonStringifySafe = _interopRequireDefault(require("json-stringify-safe"));
-
-var _sprintfJs = require("sprintf-js");
-
-var _constants = require("../constants");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
-
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
-function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
-const globalThis = (0, _globalthis.default)();
-let domain;
-
-if (_detectNode.default) {
- // eslint-disable-next-line global-require
- domain = require('domain');
-}
-
-const getParentDomainContext = () => {
- if (!domain) {
- return {};
- }
-
- const parentRoarrContexts = [];
- let currentDomain = process.domain; // $FlowFixMe
-
- if (!currentDomain || !currentDomain.parentDomain) {
- return {};
- }
-
- while (currentDomain && currentDomain.parentDomain) {
- currentDomain = currentDomain.parentDomain;
-
- if (currentDomain.roarr && currentDomain.roarr.context) {
- parentRoarrContexts.push(currentDomain.roarr.context);
- }
- }
-
- let domainContext = {};
-
- for (const parentRoarrContext of parentRoarrContexts) {
- domainContext = _objectSpread(_objectSpread({}, domainContext), parentRoarrContext);
- }
-
- return domainContext;
-};
-
-const getFirstParentDomainContext = () => {
- if (!domain) {
- return {};
- }
-
- let currentDomain = process.domain; // $FlowFixMe
-
- if (currentDomain && currentDomain.roarr && currentDomain.roarr.context) {
- return currentDomain.roarr.context;
- } // $FlowFixMe
-
-
- if (!currentDomain || !currentDomain.parentDomain) {
- return {};
- }
-
- while (currentDomain && currentDomain.parentDomain) {
- currentDomain = currentDomain.parentDomain;
-
- if (currentDomain.roarr && currentDomain.roarr.context) {
- return currentDomain.roarr.context;
- }
- }
-
- return {};
-};
-
-const createLogger = (onMessage, parentContext) => {
- // eslint-disable-next-line id-length, unicorn/prevent-abbreviations
- const log = (a, b, c, d, e, f, g, h, i, k) => {
- const time = Date.now();
- const sequence = globalThis.ROARR.sequence++;
- let context;
- let message;
-
- if (typeof a === 'string') {
- context = _objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {}); // eslint-disable-next-line id-length, object-property-newline
-
- const args = _extends({}, {
- a,
- b,
- c,
- d,
- e,
- f,
- g,
- h,
- i,
- k
- });
-
- const values = Object.keys(args).map(key => {
- return args[key];
- }); // eslint-disable-next-line unicorn/no-reduce
-
- const hasOnlyOneParameterValued = 1 === values.reduce((accumulator, value) => {
- // eslint-disable-next-line no-return-assign, no-param-reassign
- return accumulator += typeof value === 'undefined' ? 0 : 1;
- }, 0);
- message = hasOnlyOneParameterValued ? (0, _sprintfJs.sprintf)('%s', a) : (0, _sprintfJs.sprintf)(a, b, c, d, e, f, g, h, i, k);
- } else {
- if (typeof b !== 'string') {
- throw new TypeError('Message must be a string.');
- }
-
- context = JSON.parse((0, _jsonStringifySafe.default)(_objectSpread(_objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {}), a)));
- message = (0, _sprintfJs.sprintf)(b, c, d, e, f, g, h, i, k);
- }
-
- onMessage({
- context,
- message,
- sequence,
- time,
- version: '1.0.0'
- });
- };
-
- log.child = context => {
- if (typeof context === 'function') {
- return createLogger(message => {
- if (typeof context !== 'function') {
- throw new TypeError('Unexpected state.');
- }
-
- onMessage(context(message));
- }, parentContext);
- }
-
- return createLogger(onMessage, _objectSpread(_objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext), context));
- };
-
- log.getContext = () => {
- return _objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {});
- };
-
- log.adopt = async (routine, context) => {
- if (!domain) {
- return routine();
- }
-
- const adoptedDomain = domain.create();
- return adoptedDomain.run(() => {
- // $FlowFixMe
- adoptedDomain.roarr = {
- context: _objectSpread(_objectSpread({}, getParentDomainContext()), context)
- };
- return routine();
- });
- };
-
- for (const logLevel of Object.keys(_constants.logLevels)) {
- // eslint-disable-next-line id-length, unicorn/prevent-abbreviations
- log[logLevel] = (a, b, c, d, e, f, g, h, i, k) => {
- return log.child({
- logLevel: _constants.logLevels[logLevel]
- })(a, b, c, d, e, f, g, h, i, k);
- };
- } // @see https://github.com/facebook/flow/issues/6705
- // $FlowFixMe
-
-
- return log;
-};
-
-var _default = createLogger;
-exports.default = _default;
-//# sourceMappingURL=createLogger.js.map \ No newline at end of file
diff --git a/node_modules/roarr/dist/factories/createLogger.js.flow b/node_modules/roarr/dist/factories/createLogger.js.flow
deleted file mode 100644
index 4cd6c27..0000000
--- a/node_modules/roarr/dist/factories/createLogger.js.flow
+++ /dev/null
@@ -1,197 +0,0 @@
-// @flow
-
-import environmentIsNode from 'detect-node';
-import createGlobalThis from 'globalthis';
-import stringify from 'json-stringify-safe';
-import {
- sprintf,
-} from 'sprintf-js';
-import {
- logLevels,
-} from '../constants';
-import type {
- LoggerType,
- MessageContextType,
- MessageEventHandlerType,
- TranslateMessageFunctionType,
-} from '../types';
-
-const globalThis = createGlobalThis();
-
-let domain;
-
-if (environmentIsNode) {
- // eslint-disable-next-line global-require
- domain = require('domain');
-}
-
-const getParentDomainContext = () => {
- if (!domain) {
- return {};
- }
-
- const parentRoarrContexts = [];
-
- let currentDomain = process.domain;
-
- // $FlowFixMe
- if (!currentDomain || !currentDomain.parentDomain) {
- return {};
- }
-
- while (currentDomain && currentDomain.parentDomain) {
- currentDomain = currentDomain.parentDomain;
-
- if (currentDomain.roarr && currentDomain.roarr.context) {
- parentRoarrContexts.push(currentDomain.roarr.context);
- }
- }
-
- let domainContext = {};
-
- for (const parentRoarrContext of parentRoarrContexts) {
- domainContext = {
- ...domainContext,
- ...parentRoarrContext,
- };
- }
-
- return domainContext;
-};
-
-const getFirstParentDomainContext = () => {
- if (!domain) {
- return {};
- }
-
- let currentDomain = process.domain;
-
- // $FlowFixMe
- if (currentDomain && currentDomain.roarr && currentDomain.roarr.context) {
- return currentDomain.roarr.context;
- }
-
- // $FlowFixMe
- if (!currentDomain || !currentDomain.parentDomain) {
- return {};
- }
-
- while (currentDomain && currentDomain.parentDomain) {
- currentDomain = currentDomain.parentDomain;
-
- if (currentDomain.roarr && currentDomain.roarr.context) {
- return currentDomain.roarr.context;
- }
- }
-
- return {};
-};
-
-const createLogger = (onMessage: MessageEventHandlerType, parentContext?: MessageContextType): LoggerType => {
- // eslint-disable-next-line id-length, unicorn/prevent-abbreviations
- const log = (a, b, c, d, e, f, g, h, i, k) => {
- const time = Date.now();
- const sequence = globalThis.ROARR.sequence++;
-
- let context;
- let message;
-
- if (typeof a === 'string') {
- context = {
- ...getFirstParentDomainContext(),
- ...parentContext || {},
- };
- // eslint-disable-next-line id-length, object-property-newline
- const {...args} = {a, b, c, d, e, f, g, h, i, k};
- const values = Object.keys(args).map((key) => {
- return args[key];
- });
- // eslint-disable-next-line unicorn/no-reduce
- const hasOnlyOneParameterValued = 1 === values.reduce((accumulator, value) => {
- // eslint-disable-next-line no-return-assign, no-param-reassign
- return accumulator += typeof value === 'undefined' ? 0 : 1;
- }, 0);
- message = hasOnlyOneParameterValued ? sprintf('%s', a) : sprintf(a, b, c, d, e, f, g, h, i, k);
- } else {
- if (typeof b !== 'string') {
- throw new TypeError('Message must be a string.');
- }
-
- context = JSON.parse(stringify({
- ...getFirstParentDomainContext(),
- ...parentContext || {},
- ...a,
- }));
-
- message = sprintf(b, c, d, e, f, g, h, i, k);
- }
-
- onMessage({
- context,
- message,
- sequence,
- time,
- version: '1.0.0',
- });
- };
-
- log.child = (context: TranslateMessageFunctionType | MessageContextType): LoggerType => {
- if (typeof context === 'function') {
- return createLogger((message) => {
- if (typeof context !== 'function') {
- throw new TypeError('Unexpected state.');
- }
- onMessage(context(message));
- }, parentContext);
- }
-
- return createLogger(onMessage, {
- ...getFirstParentDomainContext(),
- ...parentContext,
- ...context,
- });
- };
-
- log.getContext = (): MessageContextType => {
- return {
- ...getFirstParentDomainContext(),
- ...parentContext || {},
- };
- };
-
- log.adopt = async (routine, context) => {
- if (!domain) {
- return routine();
- }
-
- const adoptedDomain = domain.create();
-
- return adoptedDomain
- .run(() => {
- // $FlowFixMe
- adoptedDomain.roarr = {
- context: {
- ...getParentDomainContext(),
- ...context,
- },
- };
-
- return routine();
- });
- };
-
- for (const logLevel of Object.keys(logLevels)) {
- // eslint-disable-next-line id-length, unicorn/prevent-abbreviations
- log[logLevel] = (a, b, c, d, e, f, g, h, i, k) => {
- return log.child({
- logLevel: logLevels[logLevel],
- })(a, b, c, d, e, f, g, h, i, k);
- };
- }
-
- // @see https://github.com/facebook/flow/issues/6705
- // $FlowFixMe
- return log;
-};
-
-export default createLogger;
diff --git a/node_modules/roarr/dist/factories/createLogger.js.map b/node_modules/roarr/dist/factories/createLogger.js.map
deleted file mode 100644
index 4c8854c..0000000
--- a/node_modules/roarr/dist/factories/createLogger.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../src/factories/createLogger.js"],"names":["globalThis","domain","environmentIsNode","require","getParentDomainContext","parentRoarrContexts","currentDomain","process","parentDomain","roarr","context","push","domainContext","parentRoarrContext","getFirstParentDomainContext","createLogger","onMessage","parentContext","log","a","b","c","d","e","f","g","h","i","k","time","Date","now","sequence","ROARR","message","args","values","Object","keys","map","key","hasOnlyOneParameterValued","reduce","accumulator","value","TypeError","JSON","parse","version","child","getContext","adopt","routine","adoptedDomain","create","run","logLevel","logLevels"],"mappings":"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","sourcesContent":["// @flow\n\nimport environmentIsNode from 'detect-node';\nimport createGlobalThis from 'globalthis';\nimport stringify from 'json-stringify-safe';\nimport {\n sprintf,\n} from 'sprintf-js';\nimport {\n logLevels,\n} from '../constants';\nimport type {\n LoggerType,\n MessageContextType,\n MessageEventHandlerType,\n TranslateMessageFunctionType,\n} from '../types';\n\nconst globalThis = createGlobalThis();\n\nlet domain;\n\nif (environmentIsNode) {\n // eslint-disable-next-line global-require\n domain = require('domain');\n}\n\nconst getParentDomainContext = () => {\n if (!domain) {\n return {};\n }\n\n const parentRoarrContexts = [];\n\n let currentDomain = process.domain;\n\n // $FlowFixMe\n if (!currentDomain || !currentDomain.parentDomain) {\n return {};\n }\n\n while (currentDomain && currentDomain.parentDomain) {\n currentDomain = currentDomain.parentDomain;\n\n if (currentDomain.roarr && currentDomain.roarr.context) {\n parentRoarrContexts.push(currentDomain.roarr.context);\n }\n }\n\n let domainContext = {};\n\n for (const parentRoarrContext of parentRoarrContexts) {\n domainContext = {\n ...domainContext,\n ...parentRoarrContext,\n };\n }\n\n return domainContext;\n};\n\nconst getFirstParentDomainContext = () => {\n if (!domain) {\n return {};\n }\n\n let currentDomain = process.domain;\n\n // $FlowFixMe\n if (currentDomain && currentDomain.roarr && currentDomain.roarr.context) {\n return currentDomain.roarr.context;\n }\n\n // $FlowFixMe\n if (!currentDomain || !currentDomain.parentDomain) {\n return {};\n }\n\n while (currentDomain && currentDomain.parentDomain) {\n currentDomain = currentDomain.parentDomain;\n\n if (currentDomain.roarr && currentDomain.roarr.context) {\n return currentDomain.roarr.context;\n }\n }\n\n return {};\n};\n\nconst createLogger = (onMessage: MessageEventHandlerType, parentContext?: MessageContextType): LoggerType => {\n // eslint-disable-next-line id-length, unicorn/prevent-abbreviations\n const log = (a, b, c, d, e, f, g, h, i, k) => {\n const time = Date.now();\n const sequence = globalThis.ROARR.sequence++;\n\n let context;\n let message;\n\n if (typeof a === 'string') {\n context = {\n ...getFirstParentDomainContext(),\n ...parentContext || {},\n };\n // eslint-disable-next-line id-length, object-property-newline\n const {...args} = {a, b, c, d, e, f, g, h, i, k};\n const values = Object.keys(args).map((key) => {\n return args[key];\n });\n // eslint-disable-next-line unicorn/no-reduce\n const hasOnlyOneParameterValued = 1 === values.reduce((accumulator, value) => {\n // eslint-disable-next-line no-return-assign, no-param-reassign\n return accumulator += typeof value === 'undefined' ? 0 : 1;\n }, 0);\n message = hasOnlyOneParameterValued ? sprintf('%s', a) : sprintf(a, b, c, d, e, f, g, h, i, k);\n } else {\n if (typeof b !== 'string') {\n throw new TypeError('Message must be a string.');\n }\n\n context = JSON.parse(stringify({\n ...getFirstParentDomainContext(),\n ...parentContext || {},\n ...a,\n }));\n\n message = sprintf(b, c, d, e, f, g, h, i, k);\n }\n\n onMessage({\n context,\n message,\n sequence,\n time,\n version: '1.0.0',\n });\n };\n\n log.child = (context: TranslateMessageFunctionType | MessageContextType): LoggerType => {\n if (typeof context === 'function') {\n return createLogger((message) => {\n if (typeof context !== 'function') {\n throw new TypeError('Unexpected state.');\n }\n onMessage(context(message));\n }, parentContext);\n }\n\n return createLogger(onMessage, {\n ...getFirstParentDomainContext(),\n ...parentContext,\n ...context,\n });\n };\n\n log.getContext = (): MessageContextType => {\n return {\n ...getFirstParentDomainContext(),\n ...parentContext || {},\n };\n };\n\n log.adopt = async (routine, context) => {\n if (!domain) {\n return routine();\n }\n\n const adoptedDomain = domain.create();\n\n return adoptedDomain\n .run(() => {\n // $FlowFixMe\n adoptedDomain.roarr = {\n context: {\n ...getParentDomainContext(),\n ...context,\n },\n };\n\n return routine();\n });\n };\n\n for (const logLevel of Object.keys(logLevels)) {\n // eslint-disable-next-line id-length, unicorn/prevent-abbreviations\n log[logLevel] = (a, b, c, d, e, f, g, h, i, k) => {\n return log.child({\n logLevel: logLevels[logLevel],\n })(a, b, c, d, e, f, g, h, i, k);\n };\n }\n\n // @see https://github.com/facebook/flow/issues/6705\n // $FlowFixMe\n return log;\n};\n\nexport default createLogger;\n"],"file":"createLogger.js"} \ No newline at end of file
diff --git a/node_modules/roarr/dist/factories/createMockLogger.js b/node_modules/roarr/dist/factories/createMockLogger.js
deleted file mode 100644
index b25a37b..0000000
--- a/node_modules/roarr/dist/factories/createMockLogger.js
+++ /dev/null
@@ -1,44 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = void 0;
-
-var _constants = require("../constants");
-
-const createMockLogger = (onMessage, parentContext) => {
- // eslint-disable-next-line id-length, unicorn/prevent-abbreviations, no-unused-vars
- const log = (a, b, c, d, e, f, g, h, i, k) => {//
- };
-
- log.adopt = async routine => {
- return routine();
- }; // eslint-disable-next-line no-unused-vars
-
-
- log.child = context => {
- return createMockLogger(onMessage, parentContext);
- };
-
- log.getContext = () => {
- return {};
- };
-
- for (const logLevel of Object.keys(_constants.logLevels)) {
- // eslint-disable-next-line id-length, unicorn/prevent-abbreviations
- log[logLevel] = (a, b, c, d, e, f, g, h, i, k) => {
- return log.child({
- logLevel: _constants.logLevels[logLevel]
- })(a, b, c, d, e, f, g, h, i, k);
- };
- } // @see https://github.com/facebook/flow/issues/6705
- // $FlowFixMe
-
-
- return log;
-};
-
-var _default = createMockLogger;
-exports.default = _default;
-//# sourceMappingURL=createMockLogger.js.map \ No newline at end of file
diff --git a/node_modules/roarr/dist/factories/createMockLogger.js.flow b/node_modules/roarr/dist/factories/createMockLogger.js.flow
deleted file mode 100644
index 37e0912..0000000
--- a/node_modules/roarr/dist/factories/createMockLogger.js.flow
+++ /dev/null
@@ -1,46 +0,0 @@
-// @flow
-
-import {
- logLevels,
-} from '../constants';
-import type {
- LoggerType,
- MessageContextType,
- MessageEventHandlerType,
- TranslateMessageFunctionType,
-} from '../types';
-
-const createMockLogger = (onMessage: MessageEventHandlerType, parentContext?: MessageContextType): LoggerType => {
- // eslint-disable-next-line id-length, unicorn/prevent-abbreviations, no-unused-vars
- const log = (a, b, c, d, e, f, g, h, i, k) => {
- //
- };
-
- log.adopt = async (routine) => {
- return routine();
- };
-
- // eslint-disable-next-line no-unused-vars
- log.child = (context: TranslateMessageFunctionType | MessageContextType): LoggerType => {
- return createMockLogger(onMessage, parentContext);
- };
-
- log.getContext = (): MessageContextType => {
- return {};
- };
-
- for (const logLevel of Object.keys(logLevels)) {
- // eslint-disable-next-line id-length, unicorn/prevent-abbreviations
- log[logLevel] = (a, b, c, d, e, f, g, h, i, k) => {
- return log.child({
- logLevel: logLevels[logLevel],
- })(a, b, c, d, e, f, g, h, i, k);
- };
- }
-
- // @see https://github.com/facebook/flow/issues/6705
- // $FlowFixMe
- return log;
-};
-
-export default createMockLogger;
diff --git a/node_modules/roarr/dist/factories/createMockLogger.js.map b/node_modules/roarr/dist/factories/createMockLogger.js.map
deleted file mode 100644
index a57fe4f..0000000
--- a/node_modules/roarr/dist/factories/createMockLogger.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../src/factories/createMockLogger.js"],"names":["createMockLogger","onMessage","parentContext","log","a","b","c","d","e","f","g","h","i","k","adopt","routine","child","context","getContext","logLevel","Object","keys","logLevels"],"mappings":";;;;;;;AAEA;;AAUA,MAAMA,gBAAgB,GAAG,CAACC,SAAD,EAAqCC,aAArC,KAAwF;AAC/G;AACA,QAAMC,GAAG,GAAG,CAACC,CAAD,EAAIC,CAAJ,EAAOC,CAAP,EAAUC,CAAV,EAAaC,CAAb,EAAgBC,CAAhB,EAAmBC,CAAnB,EAAsBC,CAAtB,EAAyBC,CAAzB,EAA4BC,CAA5B,KAAkC,CAC5C;AACD,GAFD;;AAIAV,EAAAA,GAAG,CAACW,KAAJ,GAAY,MAAOC,OAAP,IAAmB;AAC7B,WAAOA,OAAO,EAAd;AACD,GAFD,CAN+G,CAU/G;;;AACAZ,EAAAA,GAAG,CAACa,KAAJ,GAAaC,OAAD,IAA4E;AACtF,WAAOjB,gBAAgB,CAACC,SAAD,EAAYC,aAAZ,CAAvB;AACD,GAFD;;AAIAC,EAAAA,GAAG,CAACe,UAAJ,GAAiB,MAA0B;AACzC,WAAO,EAAP;AACD,GAFD;;AAIA,OAAK,MAAMC,QAAX,IAAuBC,MAAM,CAACC,IAAP,CAAYC,oBAAZ,CAAvB,EAA+C;AAC7C;AACAnB,IAAAA,GAAG,CAACgB,QAAD,CAAH,GAAgB,CAACf,CAAD,EAAIC,CAAJ,EAAOC,CAAP,EAAUC,CAAV,EAAaC,CAAb,EAAgBC,CAAhB,EAAmBC,CAAnB,EAAsBC,CAAtB,EAAyBC,CAAzB,EAA4BC,CAA5B,KAAkC;AAChD,aAAOV,GAAG,CAACa,KAAJ,CAAU;AACfG,QAAAA,QAAQ,EAAEG,qBAAUH,QAAV;AADK,OAAV,EAEJf,CAFI,EAEDC,CAFC,EAEEC,CAFF,EAEKC,CAFL,EAEQC,CAFR,EAEWC,CAFX,EAEcC,CAFd,EAEiBC,CAFjB,EAEoBC,CAFpB,EAEuBC,CAFvB,CAAP;AAGD,KAJD;AAKD,GA1B8G,CA4B/G;AACA;;;AACA,SAAOV,GAAP;AACD,CA/BD;;eAiCeH,gB","sourcesContent":["// @flow\n\nimport {\n logLevels,\n} from '../constants';\nimport type {\n LoggerType,\n MessageContextType,\n MessageEventHandlerType,\n TranslateMessageFunctionType,\n} from '../types';\n\nconst createMockLogger = (onMessage: MessageEventHandlerType, parentContext?: MessageContextType): LoggerType => {\n // eslint-disable-next-line id-length, unicorn/prevent-abbreviations, no-unused-vars\n const log = (a, b, c, d, e, f, g, h, i, k) => {\n //\n };\n\n log.adopt = async (routine) => {\n return routine();\n };\n\n // eslint-disable-next-line no-unused-vars\n log.child = (context: TranslateMessageFunctionType | MessageContextType): LoggerType => {\n return createMockLogger(onMessage, parentContext);\n };\n\n log.getContext = (): MessageContextType => {\n return {};\n };\n\n for (const logLevel of Object.keys(logLevels)) {\n // eslint-disable-next-line id-length, unicorn/prevent-abbreviations\n log[logLevel] = (a, b, c, d, e, f, g, h, i, k) => {\n return log.child({\n logLevel: logLevels[logLevel],\n })(a, b, c, d, e, f, g, h, i, k);\n };\n }\n\n // @see https://github.com/facebook/flow/issues/6705\n // $FlowFixMe\n return log;\n};\n\nexport default createMockLogger;\n"],"file":"createMockLogger.js"} \ No newline at end of file
diff --git a/node_modules/roarr/dist/factories/createNodeWriter.js b/node_modules/roarr/dist/factories/createNodeWriter.js
deleted file mode 100644
index 731020a..0000000
--- a/node_modules/roarr/dist/factories/createNodeWriter.js
+++ /dev/null
@@ -1,25 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = void 0;
-
-const createBlockingWriter = stream => {
- return {
- write: message => {
- stream.write(message + '\n');
- }
- };
-};
-
-const createNodeWriter = () => {
- // eslint-disable-next-line no-process-env
- const targetStream = (process.env.ROARR_STREAM || 'STDOUT').toUpperCase();
- const stream = targetStream.toUpperCase() === 'STDOUT' ? process.stdout : process.stderr;
- return createBlockingWriter(stream);
-};
-
-var _default = createNodeWriter;
-exports.default = _default;
-//# sourceMappingURL=createNodeWriter.js.map \ No newline at end of file
diff --git a/node_modules/roarr/dist/factories/createNodeWriter.js.flow b/node_modules/roarr/dist/factories/createNodeWriter.js.flow
deleted file mode 100644
index b03d9c3..0000000
--- a/node_modules/roarr/dist/factories/createNodeWriter.js.flow
+++ /dev/null
@@ -1,22 +0,0 @@
-// @flow
-
-import type {
- WriterType,
-} from '../types';
-
-const createBlockingWriter = (stream: stream$Writable): WriterType => {
- return {
- write: (message: string) => {
- stream.write(message + '\n');
- },
- };
-};
-
-export default (): WriterType => {
- // eslint-disable-next-line no-process-env
- const targetStream = (process.env.ROARR_STREAM || 'STDOUT').toUpperCase();
-
- const stream = targetStream.toUpperCase() === 'STDOUT' ? process.stdout : process.stderr;
-
- return createBlockingWriter(stream);
-};
diff --git a/node_modules/roarr/dist/factories/createNodeWriter.js.map b/node_modules/roarr/dist/factories/createNodeWriter.js.map
deleted file mode 100644
index 5f54e92..0000000
--- a/node_modules/roarr/dist/factories/createNodeWriter.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../src/factories/createNodeWriter.js"],"names":["createBlockingWriter","stream","write","message","targetStream","process","env","ROARR_STREAM","toUpperCase","stdout","stderr"],"mappings":";;;;;;;AAMA,MAAMA,oBAAoB,GAAIC,MAAD,IAAyC;AACpE,SAAO;AACLC,IAAAA,KAAK,EAAGC,OAAD,IAAqB;AAC1BF,MAAAA,MAAM,CAACC,KAAP,CAAaC,OAAO,GAAG,IAAvB;AACD;AAHI,GAAP;AAKD,CAND;;+BAQiC;AAC/B;AACA,QAAMC,YAAY,GAAG,CAACC,OAAO,CAACC,GAAR,CAAYC,YAAZ,IAA4B,QAA7B,EAAuCC,WAAvC,EAArB;AAEA,QAAMP,MAAM,GAAGG,YAAY,CAACI,WAAb,OAA+B,QAA/B,GAA0CH,OAAO,CAACI,MAAlD,GAA2DJ,OAAO,CAACK,MAAlF;AAEA,SAAOV,oBAAoB,CAACC,MAAD,CAA3B;AACD,C","sourcesContent":["// @flow\n\nimport type {\n WriterType,\n} from '../types';\n\nconst createBlockingWriter = (stream: stream$Writable): WriterType => {\n return {\n write: (message: string) => {\n stream.write(message + '\\n');\n },\n };\n};\n\nexport default (): WriterType => {\n // eslint-disable-next-line no-process-env\n const targetStream = (process.env.ROARR_STREAM || 'STDOUT').toUpperCase();\n\n const stream = targetStream.toUpperCase() === 'STDOUT' ? process.stdout : process.stderr;\n\n return createBlockingWriter(stream);\n};\n"],"file":"createNodeWriter.js"} \ No newline at end of file
diff --git a/node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js b/node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js
deleted file mode 100644
index 7cc70bd..0000000
--- a/node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js
+++ /dev/null
@@ -1,53 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = void 0;
-
-var _detectNode = _interopRequireDefault(require("detect-node"));
-
-var _semverCompare = _interopRequireDefault(require("semver-compare"));
-
-var _package = require("../../package.json");
-
-var _createNodeWriter = _interopRequireDefault(require("./createNodeWriter"));
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
-function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
-// eslint-disable-next-line flowtype/no-weak-types
-const createRoarrInititialGlobalState = currentState => {
- const versions = (currentState.versions || []).concat();
- versions.sort(_semverCompare.default);
- const currentIsLatestVersion = !versions.length || (0, _semverCompare.default)(_package.version, versions[versions.length - 1]) === 1;
-
- if (!versions.includes(_package.version)) {
- versions.push(_package.version);
- }
-
- versions.sort(_semverCompare.default);
-
- let newState = _objectSpread(_objectSpread({
- sequence: 0
- }, currentState), {}, {
- versions
- });
-
- if (_detectNode.default) {
- if (currentIsLatestVersion || !newState.write) {
- newState = _objectSpread(_objectSpread({}, newState), (0, _createNodeWriter.default)());
- }
- }
-
- return newState;
-};
-
-var _default = createRoarrInititialGlobalState;
-exports.default = _default;
-//# sourceMappingURL=createRoarrInititialGlobalState.js.map \ No newline at end of file
diff --git a/node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js.flow b/node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js.flow
deleted file mode 100644
index 15a1605..0000000
--- a/node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js.flow
+++ /dev/null
@@ -1,43 +0,0 @@
-// @flow
-
-import environmentIsNode from 'detect-node';
-import cmp from 'semver-compare';
-import {
- version,
-} from '../../package.json';
-import type {
- RoarrGlobalStateType,
-} from '../types';
-import createNodeWriter from './createNodeWriter';
-
-// eslint-disable-next-line flowtype/no-weak-types
-export default (currentState: Object): RoarrGlobalStateType => {
- const versions = (currentState.versions || []).concat();
-
- versions.sort(cmp);
-
- const currentIsLatestVersion = !versions.length || cmp(version, versions[versions.length - 1]) === 1;
-
- if (!versions.includes(version)) {
- versions.push(version);
- }
-
- versions.sort(cmp);
-
- let newState = {
- sequence: 0,
- ...currentState,
- versions,
- };
-
- if (environmentIsNode) {
- if (currentIsLatestVersion || !newState.write) {
- newState = {
- ...newState,
- ...createNodeWriter(),
- };
- }
- }
-
- return newState;
-};
diff --git a/node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js.map b/node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js.map
deleted file mode 100644
index 7c221b6..0000000
--- a/node_modules/roarr/dist/factories/createRoarrInititialGlobalState.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../src/factories/createRoarrInititialGlobalState.js"],"names":["currentState","versions","concat","sort","cmp","currentIsLatestVersion","length","version","includes","push","newState","sequence","environmentIsNode","write"],"mappings":";;;;;;;AAEA;;AACA;;AACA;;AAMA;;;;;;;;;;AAEA;wCACgBA,Y,IAA+C;AAC7D,QAAMC,QAAQ,GAAG,CAACD,YAAY,CAACC,QAAb,IAAyB,EAA1B,EAA8BC,MAA9B,EAAjB;AAEAD,EAAAA,QAAQ,CAACE,IAAT,CAAcC,sBAAd;AAEA,QAAMC,sBAAsB,GAAG,CAACJ,QAAQ,CAACK,MAAV,IAAoB,4BAAIC,gBAAJ,EAAaN,QAAQ,CAACA,QAAQ,CAACK,MAAT,GAAkB,CAAnB,CAArB,MAAgD,CAAnG;;AAEA,MAAI,CAACL,QAAQ,CAACO,QAAT,CAAkBD,gBAAlB,CAAL,EAAiC;AAC/BN,IAAAA,QAAQ,CAACQ,IAAT,CAAcF,gBAAd;AACD;;AAEDN,EAAAA,QAAQ,CAACE,IAAT,CAAcC,sBAAd;;AAEA,MAAIM,QAAQ;AACVC,IAAAA,QAAQ,EAAE;AADA,KAEPX,YAFO;AAGVC,IAAAA;AAHU,IAAZ;;AAMA,MAAIW,mBAAJ,EAAuB;AACrB,QAAIP,sBAAsB,IAAI,CAACK,QAAQ,CAACG,KAAxC,EAA+C;AAC7CH,MAAAA,QAAQ,mCACHA,QADG,GAEH,gCAFG,CAAR;AAID;AACF;;AAED,SAAOA,QAAP;AACD,C","sourcesContent":["// @flow\n\nimport environmentIsNode from 'detect-node';\nimport cmp from 'semver-compare';\nimport {\n version,\n} from '../../package.json';\nimport type {\n RoarrGlobalStateType,\n} from '../types';\nimport createNodeWriter from './createNodeWriter';\n\n// eslint-disable-next-line flowtype/no-weak-types\nexport default (currentState: Object): RoarrGlobalStateType => {\n const versions = (currentState.versions || []).concat();\n\n versions.sort(cmp);\n\n const currentIsLatestVersion = !versions.length || cmp(version, versions[versions.length - 1]) === 1;\n\n if (!versions.includes(version)) {\n versions.push(version);\n }\n\n versions.sort(cmp);\n\n let newState = {\n sequence: 0,\n ...currentState,\n versions,\n };\n\n if (environmentIsNode) {\n if (currentIsLatestVersion || !newState.write) {\n newState = {\n ...newState,\n ...createNodeWriter(),\n };\n }\n }\n\n return newState;\n};\n"],"file":"createRoarrInititialGlobalState.js"} \ No newline at end of file
diff --git a/node_modules/roarr/dist/factories/index.js b/node_modules/roarr/dist/factories/index.js
deleted file mode 100644
index 97e8167..0000000
--- a/node_modules/roarr/dist/factories/index.js
+++ /dev/null
@@ -1,32 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-Object.defineProperty(exports, "createLogger", {
- enumerable: true,
- get: function () {
- return _createLogger.default;
- }
-});
-Object.defineProperty(exports, "createMockLogger", {
- enumerable: true,
- get: function () {
- return _createMockLogger.default;
- }
-});
-Object.defineProperty(exports, "createRoarrInititialGlobalState", {
- enumerable: true,
- get: function () {
- return _createRoarrInititialGlobalState.default;
- }
-});
-
-var _createLogger = _interopRequireDefault(require("./createLogger"));
-
-var _createMockLogger = _interopRequireDefault(require("./createMockLogger"));
-
-var _createRoarrInititialGlobalState = _interopRequireDefault(require("./createRoarrInititialGlobalState"));
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/node_modules/roarr/dist/factories/index.js.flow b/node_modules/roarr/dist/factories/index.js.flow
deleted file mode 100644
index b4881ce..0000000
--- a/node_modules/roarr/dist/factories/index.js.flow
+++ /dev/null
@@ -1,11 +0,0 @@
-// @flow
-
-export {
- default as createLogger,
-} from './createLogger';
-export {
- default as createMockLogger,
-} from './createMockLogger';
-export {
- default as createRoarrInititialGlobalState,
-} from './createRoarrInititialGlobalState';
diff --git a/node_modules/roarr/dist/factories/index.js.map b/node_modules/roarr/dist/factories/index.js.map
deleted file mode 100644
index e023a47..0000000
--- a/node_modules/roarr/dist/factories/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../src/factories/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA;;AAGA;;AAGA","sourcesContent":["// @flow\n\nexport {\n default as createLogger,\n} from './createLogger';\nexport {\n default as createMockLogger,\n} from './createMockLogger';\nexport {\n default as createRoarrInititialGlobalState,\n} from './createRoarrInititialGlobalState';\n"],"file":"index.js"} \ No newline at end of file
diff --git a/node_modules/roarr/dist/log.js b/node_modules/roarr/dist/log.js
deleted file mode 100644
index 23036e3..0000000
--- a/node_modules/roarr/dist/log.js
+++ /dev/null
@@ -1,42 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = exports.ROARR = void 0;
-
-var _boolean = require("boolean");
-
-var _detectNode = _interopRequireDefault(require("detect-node"));
-
-var _globalthis = _interopRequireDefault(require("globalthis"));
-
-var _factories = require("./factories");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-const globalThis = (0, _globalthis.default)();
-const ROARR = globalThis.ROARR = (0, _factories.createRoarrInititialGlobalState)(globalThis.ROARR || {});
-exports.ROARR = ROARR;
-let logFactory = _factories.createLogger;
-
-if (_detectNode.default) {
- // eslint-disable-next-line no-process-env
- const enabled = (0, _boolean.boolean)(process.env.ROARR_LOG || '');
-
- if (!enabled) {
- logFactory = _factories.createMockLogger;
- }
-}
-
-var _default = logFactory(message => {
- if (ROARR.write) {
- // Stringify message as soon as it is received to prevent
- // properties of the context from being modified by reference.
- const body = JSON.stringify(message);
- ROARR.write(body);
- }
-});
-
-exports.default = _default;
-//# sourceMappingURL=log.js.map \ No newline at end of file
diff --git a/node_modules/roarr/dist/log.js.flow b/node_modules/roarr/dist/log.js.flow
deleted file mode 100644
index 803ccfc..0000000
--- a/node_modules/roarr/dist/log.js.flow
+++ /dev/null
@@ -1,47 +0,0 @@
-// @flow
-
-import {
- boolean,
-} from 'boolean';
-import environmentIsNode from 'detect-node';
-import createGlobalThis from 'globalthis';
-import {
- createLogger,
- createMockLogger,
- createRoarrInititialGlobalState,
-} from './factories';
-
-const globalThis = createGlobalThis();
-
-const ROARR = globalThis.ROARR = createRoarrInititialGlobalState(globalThis.ROARR || {});
-
-let logFactory = createLogger;
-
-if (environmentIsNode) {
- // eslint-disable-next-line no-process-env
- const enabled = boolean(process.env.ROARR_LOG || '');
-
- if (!enabled) {
- logFactory = createMockLogger;
- }
-}
-
-export type {
- LoggerType,
- MessageType,
- TranslateMessageFunctionType,
-} from './types';
-
-export {
- ROARR,
-};
-
-export default logFactory((message) => {
- if (ROARR.write) {
- // Stringify message as soon as it is received to prevent
- // properties of the context from being modified by reference.
- const body = JSON.stringify(message);
-
- ROARR.write(body);
- }
-});
diff --git a/node_modules/roarr/dist/log.js.map b/node_modules/roarr/dist/log.js.map
deleted file mode 100644
index b72f603..0000000
--- a/node_modules/roarr/dist/log.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../src/log.js"],"names":["globalThis","ROARR","logFactory","createLogger","environmentIsNode","enabled","process","env","ROARR_LOG","createMockLogger","message","write","body","JSON","stringify"],"mappings":";;;;;;;AAEA;;AAGA;;AACA;;AACA;;;;AAMA,MAAMA,UAAU,GAAG,0BAAnB;AAEA,MAAMC,KAAK,GAAGD,UAAU,CAACC,KAAX,GAAmB,gDAAgCD,UAAU,CAACC,KAAX,IAAoB,EAApD,CAAjC;;AAEA,IAAIC,UAAU,GAAGC,uBAAjB;;AAEA,IAAIC,mBAAJ,EAAuB;AACrB;AACA,QAAMC,OAAO,GAAG,sBAAQC,OAAO,CAACC,GAAR,CAAYC,SAAZ,IAAyB,EAAjC,CAAhB;;AAEA,MAAI,CAACH,OAAL,EAAc;AACZH,IAAAA,UAAU,GAAGO,2BAAb;AACD;AACF;;eAYcP,UAAU,CAAEQ,OAAD,IAAa;AACrC,MAAIT,KAAK,CAACU,KAAV,EAAiB;AACf;AACA;AACA,UAAMC,IAAI,GAAGC,IAAI,CAACC,SAAL,CAAeJ,OAAf,CAAb;AAEAT,IAAAA,KAAK,CAACU,KAAN,CAAYC,IAAZ;AACD;AACF,CARwB,C","sourcesContent":["// @flow\n\nimport {\n boolean,\n} from 'boolean';\nimport environmentIsNode from 'detect-node';\nimport createGlobalThis from 'globalthis';\nimport {\n createLogger,\n createMockLogger,\n createRoarrInititialGlobalState,\n} from './factories';\n\nconst globalThis = createGlobalThis();\n\nconst ROARR = globalThis.ROARR = createRoarrInititialGlobalState(globalThis.ROARR || {});\n\nlet logFactory = createLogger;\n\nif (environmentIsNode) {\n // eslint-disable-next-line no-process-env\n const enabled = boolean(process.env.ROARR_LOG || '');\n\n if (!enabled) {\n logFactory = createMockLogger;\n }\n}\n\nexport type {\n LoggerType,\n MessageType,\n TranslateMessageFunctionType,\n} from './types';\n\nexport {\n ROARR,\n};\n\nexport default logFactory((message) => {\n if (ROARR.write) {\n // Stringify message as soon as it is received to prevent\n // properties of the context from being modified by reference.\n const body = JSON.stringify(message);\n\n ROARR.write(body);\n }\n});\n"],"file":"log.js"} \ No newline at end of file
diff --git a/node_modules/roarr/dist/types.js b/node_modules/roarr/dist/types.js
deleted file mode 100644
index 2f0e414..0000000
--- a/node_modules/roarr/dist/types.js
+++ /dev/null
@@ -1,2 +0,0 @@
-"use strict";
-//# sourceMappingURL=types.js.map \ No newline at end of file
diff --git a/node_modules/roarr/dist/types.js.flow b/node_modules/roarr/dist/types.js.flow
deleted file mode 100644
index 18be149..0000000
--- a/node_modules/roarr/dist/types.js.flow
+++ /dev/null
@@ -1,81 +0,0 @@
-// @flow
-
-/* eslint-disable import/exports-last, flowtype/require-types-at-top */
-
-export type SerializableValueType = string | number | boolean | null | {+[key: string]: SerializableValueType, ...} | $ReadOnlyArray<SerializableValueType>;
-
-export type SerializableObjectType = {
- +[key: string]: SerializableValueType,
- ...
-};
-
-export type WriterType = {|
- +write: (message: string) => void,
-|};
-
-export type RoarrGlobalStateType = {|
- sequence: number,
- versions: $ReadOnlyArray<string>,
- ...WriterType,
-|};
-
-export type SprintfArgumentType = string | number | boolean | null;
-
-// eslint-disable-next-line flowtype/no-weak-types
-export type MessageContextType = Object;
-
-export type MessageType = {|
- +context: MessageContextType,
- +message: string,
- +sequence: number,
- +time: number,
- +version: string,
-|};
-
-export type TranslateMessageFunctionType = (message: MessageType) => MessageType;
-
-declare function Logger (
- context: MessageContextType,
- message: string,
- c?: SprintfArgumentType,
- d?: SprintfArgumentType,
- e?: SprintfArgumentType,
- f?: SprintfArgumentType,
- g?: SprintfArgumentType,
- h?: SprintfArgumentType,
- i?: SprintfArgumentType,
- k?: SprintfArgumentType
-): void;
-
-// eslint-disable-next-line no-redeclare
-declare function Logger (
- message: string,
- b?: SprintfArgumentType,
- c?: SprintfArgumentType,
- d?: SprintfArgumentType,
- e?: SprintfArgumentType,
- f?: SprintfArgumentType,
- g?: SprintfArgumentType,
- h?: SprintfArgumentType,
- i?: SprintfArgumentType,
- k?: SprintfArgumentType
-): void;
-
-/**
- * see https://twitter.com/kuizinas/status/914139352908943360
- */
-export type LoggerType = {|
- // eslint-disable-next-line no-undef
- [[call]]: typeof Logger,
- +adopt: <T>(routine: () => Promise<T>, context: MessageContextType) => Promise<T>,
- +child: (context: TranslateMessageFunctionType | MessageContextType) => LoggerType,
- +debug: typeof Logger,
- +error: typeof Logger,
- +fatal: typeof Logger,
- +getContext: () => MessageContextType,
- +info: typeof Logger,
- +trace: typeof Logger,
- +warn: typeof Logger,
-|};
-
-export type MessageEventHandlerType = (message: MessageType) => void;
diff --git a/node_modules/roarr/dist/types.js.map b/node_modules/roarr/dist/types.js.map
deleted file mode 100644
index 036ac15..0000000
--- a/node_modules/roarr/dist/types.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"} \ No newline at end of file
diff --git a/node_modules/roarr/package.json b/node_modules/roarr/package.json
deleted file mode 100644
index 0bfd49e..0000000
--- a/node_modules/roarr/package.json
+++ /dev/null
@@ -1,93 +0,0 @@
-{
- "author": {
- "email": "gajus@gajus.com",
- "name": "Gajus Kuizinas",
- "url": "http://gajus.com"
- },
- "ava": {
- "babel": {
- "compileAsTests": [
- "test/helpers/**/*"
- ]
- },
- "files": [
- "test/roarr/**/*"
- ],
- "require": [
- "@babel/register"
- ]
- },
- "dependencies": {
- "boolean": "^3.0.1",
- "detect-node": "^2.0.4",
- "globalthis": "^1.0.1",
- "json-stringify-safe": "^5.0.1",
- "semver-compare": "^1.0.0",
- "sprintf-js": "^1.1.2"
- },
- "description": "JSON logger for Node.js and browser.",
- "devDependencies": {
- "@ava/babel": "^1.0.1",
- "@babel/cli": "^7.11.6",
- "@babel/core": "^7.11.6",
- "@babel/node": "^7.10.5",
- "@babel/plugin-transform-flow-strip-types": "^7.10.4",
- "@babel/preset-env": "^7.11.5",
- "@babel/register": "^7.11.5",
- "ava": "^3.12.1",
- "babel-plugin-istanbul": "^6.0.0",
- "babel-plugin-transform-export-default-name": "^2.0.4",
- "coveralls": "^3.1.0",
- "domain-parent": "^1.0.0",
- "eslint": "^7.9.0",
- "eslint-config-canonical": "^24.1.1",
- "flow-bin": "^0.133.0",
- "flow-copy-source": "^2.0.9",
- "gitdown": "^3.1.3",
- "husky": "^4.3.0",
- "nyc": "^15.1.0",
- "semantic-release": "^17.1.1"
- },
- "engines": {
- "node": ">=8.0"
- },
- "husky": {
- "hooks": {
- "pre-commit": "npm run lint && npm run test && npm run build",
- "pre-push": "gitdown ./.README/README.md --output-file ./README.md --check"
- }
- },
- "keywords": [
- "log",
- "logger",
- "json"
- ],
- "main": "./dist/log.js",
- "name": "roarr",
- "nyc": {
- "include": [
- "src/**/*.js"
- ],
- "instrument": false,
- "reporter": [
- "text-lcov"
- ],
- "require": [
- "@babel/register"
- ],
- "sourceMap": false
- },
- "license": "BSD-3-Clause",
- "repository": {
- "type": "git",
- "url": "git@github.com:gajus/roarr.git"
- },
- "scripts": {
- "build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist",
- "create-readme": "gitdown ./.README/README.md --output-file ./README.md",
- "dev": "NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --watch",
- "lint": "eslint ./src ./test && flow",
- "test": "NODE_ENV=test ava --serial --verbose"
- },
- "version": "2.15.4"
-}