Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/dxx/src/lib/$shared.ts

๐Ÿš€ (Deno) enhanced executor
Latest
import * as dxx from "https://deno.land/x/dxx@rf/src/lib/$shared.ts";

Classes

A filter transform which uses a predicate(_:LogEntry) function to process and selectively discard entries.

Transform a LogEntry into a human-readable string (ie, for console display).

  • input: LogEntry
  • output: string
  • options?: ... ToDO ...

Logger. This is what we write to.

Semi-structured data accessible to consumers of LogEntry via getData(), getProp...(), etc.

Variables

Default log level properties for the built-in Humane transform.

Default log levels; adds 'trace' to the traditional RFC3164 list.

Host platform is a Windows OS.

Functions

Return the value of the environment variable varName (or undefined if non-existent or not-allowed access).

  • will not panic
  • will not prompt for permission if options.guard is true

Determine if unicode display is supported under the current platform and console constraint.

Remove quotes from text string (s).

Ensure "path" is a valid path/URL-string (by conversion if needed) or panic.

Ensure "path" is a valid URL (by conversion if needed) or panic.

Return the value of the environment variable varName (or undefined if non-existent or not-allowed access).

  • will not panic
  • will not prompt for permission if options.guard is true

Return the current value of the environment variable varName (or undefined if non-existent or not-allowed access).

  • will not panic
  • will not prompt for permission if options.guard is true

Extract the "path" from a path string (as an identity function) or URL.

  • no-throw ~ function returns undefined upon any error

Convert a path string into a standard URL object, relative to an optional base reference URL.

  • no-throw ~ function returns undefined upon any error

Determine if url is a file-type URL (ie, uses the 'file:' protocol), naming a local file resource.

Determine if the supplied text string (s) is a valid URL.

Determine if OS platform is 'Windows Subsystem for Linux'.

Extract the "path" (absolute file path for 'file://' URLs, otherwise the href URL-string) from the url.

  • no-throw ~ function returns undefined upon any error
  • Convert string to a (locale sensitive) known case; useful for case-insensitive comparisons

Determine the traversal path to goal from base.

  • Returned path will be relative to base iff goal shares a common origin/prefix with base, o/w it will be an absolute path
  • Relative goal or base paths are evaluated as relative to the Deno.cwd() directory

Convert the supplied text string (s) into a valid URL (or undefined if s [relative to base] isn't a valid URL).

  • no-throw ~ function returns undefined upon any error

Interfaces

The log entry that Logger creates and forwards to its chained transforms and writers.

Configuration for the Logger

Transform function type; describes a simple generic function to perform data transformation.

Transform function type; describes a simple generic function to perform data transformation. The function takes a context object and an array of input type (I) as rest parameters and which returns an output type (O), undefined, or a promise of either.

Type Aliases

A type defining a function which takes an input string and outputs the string with formatting (eg, bold, red, italics, etc) applied to it.