Skip to main content

@boost/common

Build Status npm version npm deps

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>: Function & { prototype?: T }

Type parameters

  • T

BlueprintFactory

BlueprintFactory<T>: (predicates: Predicates, onConstruction?: boolean) => Blueprint<T>

Type parameters

  • T: object

CommonErrorCode

CommonErrorCode: keyof typeof errors

ConcreteConstructor

ConcreteConstructor<T>: new (...args: unknown[]) => 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

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

ModuleName

ModuleName: string

ModuleResolver

ModuleResolver: (path: ModuleName) => FilePath

PortablePath

PortablePath: FilePath | Path

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 = ...