Skip to main content

@boost/common

build status npm version

A collection of common utilities and helpers for general purpose or Boost packages.

import { isObject, toArray } from '@boost/common';

Installation

yarn add @boost/common

Documentation

Index

Type Aliases

AbstractConstructor

AbstractConstructor<T>: abstract new (...args: any[]) => T

Type parameters

  • T

BlueprintFactory

BlueprintFactory<T>: (schemas: Schemas, onConstruction?: boolean) => Blueprint<T>

Type parameters

  • T: object

CommonErrorCode

CommonErrorCode: keyof typeof errors

ConcreteConstructor

ConcreteConstructor<T>: new (...args: any[]) => T

Type parameters

  • T

ConfigSetting

ConfigSetting: Record<string, boolean | number | string | null>

Constructor

Type parameters

  • T

DependencyMap

DependencyMap: SettingMap

FilePath

FilePath: string

InferMergeable

InferMergeable<T>: T extends unknown[] ? MergableArray : T extends object ? MergableObject : never

Type parameters

  • T

LookupType

LookupType: file-system | node-module

MemoizeCache

MemoizeCache<T>: Map<string, { time?: number | null; value: T }>

Type parameters

  • T

MemoizeHasher

MemoizeHasher: (...args: unknown[]) => string

MemoizedFunction

MemoizedFunction<T>: (...args: unknown[]) => T

Type parameters

  • T

MergableArray

MergableArray: unknown[]

MergableObject

MergableObject: Record<string, unknown>

Mergeable

ModuleID

ModuleID: string

ModuleResolver

ModuleResolver: (id: ModuleID, startDir?: FilePath) => FilePath | Promise<FilePath>

PortablePath

PortablePath: FilePath | ModuleID | Pathable

SettingMap

SettingMap<T>: Record<T, string>

Type parameters

  • T: string = string

Variables

constCommonError

CommonError: new (code: PARSE_INVALID_EXT | PATH_REQUIRE_ABSOLUTE | PATH_RESOLVE_LOOKUPS | PROJECT_NO_PACKAGE, params?: unknown[]) => Error & ScopedError<PARSE_INVALID_EXT | PATH_REQUIRE_ABSOLUTE | PATH_RESOLVE_LOOKUPS | PROJECT_NO_PACKAGE> = ...

constMODULE_NAME_PART

MODULE_NAME_PART: RegExp = ...

constMODULE_NAME_PATTERN

MODULE_NAME_PATTERN: RegExp = ...