Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/utils"

See collect_resolutions for the essential entry point.

Index

Variables

Const fetch

fetch: fetch = node_fetch.default
internal

Const fsp

fsp: "fs/promises" = fs.promises
internal

Const today

today: string = new Date().toISOString().split('T')[0]

(Calculated) constant for today's date in ISO format

Functions

DEBUG

  • DEBUG(preamble: string, obj?: any): void
  • Print a debug statement if the DO_DEBUG flag is set to true.

    Parameters

    • preamble: string

      "Preamble" text to be printed first

    • Default value obj: any = undefined

      An object, converted to JSON before printed, together with the preamble. This value may be undefined, in which case only the preamble is printed.

    Returns void

LOG

  • LOG(preamble: string, obj?: any): void
  • Print a log statement if the DO_LOG flag is set to true.

    Parameters

    • preamble: string

      "Preamble" text to be printed first

    • Default value obj: any = undefined

      An object, converted to JSON before printed, together with the preamble. This value may be undefined, in which case only the preamble is printed.

    Returns void

filter_resolutions

  • Check whether the resolutions for minutes have already been handled in a previous run. Used to avoid unnecessary regeneration of data.

    Parameters

    • refs: string[]

      Array of minute references (i.e., file names)

    • current: MinuteProcessing

      Array of current resolution data objects

    Returns string[]

    • Array of minute references that must be handled

flatten

  • flatten<T>(accumulator: T[], currentValue: T[]): T[]
  • Helper function to "flatten" arrays of arrays into a single array. This method should be used as the callback for a reduce.

    Type parameters

    • T

    Parameters

    • accumulator: T[]

      Accumulated array in a reduce

    • currentValue: T[]

      The next array to be considered

    Returns T[]

get_credentials

  • Get the credential structure from the local file system (ie, github id, SMTP data, etc)

    Returns Promise<Credentials>

get_schema

  • get_schema(lines: string[]): any
  • Extract the schema.org data from the minutes' preamble, and turn it into a bona fide Javascript object.

    Parameters

    • lines: string[]

      The minutes, broken into an array of individual strings

    Returns any

json_conf_file

  • json_conf_file(file_name: string, local: boolean, group?: string): Promise<Repo>
  • Read a configuration file and generate the final combination.

    The full configuration file may have optional parts for extra calls and may also be used to refer to "local" (as opposed to be on the Web) versions of such files like the nickname collection. The function access the full configuration file and generates a version based on the core values, possibly modified by the information in the optional parts.

    throws
    • not-found error

    Parameters

    • file_name: string

      file name

    • local: boolean

      whether certain files are to be extracted from the local repository (as opposed to be retrieved from github)

    • Default value group: string = undefined

      group name (necessary if the call is an extra call rather than the 'base' one)

    Returns Promise<Repo>

    the parsed JSON content