API Reference

Typeclass

Shared runtime and type utilities.

Overview

Low-level shared types and utilities used throughout core/state/parser packages.
Quick facts
Kind
class
Module
types
Members
20
Package
@rs-x/core

Import

import { Type } from '@rs-x/core';

Example

import { Type } from '@rs-x/core';

const instance = new Type(...args);

Members

20 members in this class.

cast
methodpublic
public static cast<T>(instance: unknown): T

Parameters

Name
Type
Required
instance
unknown
required

Returns

T

getConstructorName
methodpublic
public static getConstructorName(value: unknown): string

Parameters

Name
Type
Required
value
unknown
required

Returns

string

getPropertyDescriptor
methodpublic
public static getPropertyDescriptor<T>(
  root: unknown,
  name: keyof T
): IPropertyDescriptor

Parameters

Name
Type
Required
root
unknown
required
name
keyof T
required
getPropertyDescriptorType
methodpublic
public static getPropertyDescriptorType(
  // target: unknown,
  // name: string,
  propertyDescriptor: PropertyDescriptor
): PropertyDescriptorType

Parameters

Name
Type
Required
// target: unknown
unknown
required
// name: string
unknown
required
propertyDescriptor
PropertyDescriptor
required
hasOwnPropertyInPrototypeChain
methodpublic
public static hasOwnPropertyInPrototypeChain(
  target: unknown,
  key: PropertyKey
): boolean

Parameters

Name
Type
Required
target
unknown
required
key
PropertyKey
required

Returns

boolean

hasProperty
methodpublic
public static hasProperty(
  root: unknown,
  name: string
): boolean

Parameters

Name
Type
Required
root
unknown
required
name
string
required

Returns

boolean

isArrowFunction
methodpublic
public static isArrowFunction( object: unknown): object is (...args: unknown[]) => unknown

Parameters

Name
Type
Required
object
unknown
required

Returns

object is (...args: unknown[]) => unknown

isEmpty
methodpublic
public static isEmpty(value: unknown): boolean

Parameters

Name
Type
Required
value
unknown
required

Returns

boolean

isFunction
methodpublic
public static isFunction(value: unknown): value is AnyFunction

Parameters

Name
Type
Required
value
unknown
required

Returns

value is AnyFunction

isIterableCollection
methodpublic
public static isIterableCollection(value: unknown): boolean

Parameters

Name
Type
Required
value
unknown
required

Returns

boolean

isMethod
methodpublic
public static isMethod(value: unknown): boolean

Parameters

Name
Type
Required
value
unknown
required

Returns

boolean

isNullOrUndefined
methodpublic
public static isNullOrUndefined(value: unknown): boolean

Parameters

Name
Type
Required
value
unknown
required

Returns

boolean

isPlainObject
methodpublic
public static isPlainObject(value: unknown): value is PlainObject

Parameters

Name
Type
Required
value
unknown
required

Returns

value is PlainObject

isPositiveInteger
methodpublic
public static isPositiveInteger(value: unknown): boolean

Parameters

Name
Type
Required
value
unknown
required

Returns

boolean

isPositiveIntegerString
methodpublic
public static isPositiveIntegerString(value: unknown): boolean

Parameters

Name
Type
Required
value
unknown
required

Returns

boolean

isReadonlyProperty
methodpublic
public static isReadonlyProperty(
  target: unknown,
  key: unknown
): boolean

Parameters

Name
Type
Required
target
unknown
required
key
unknown
required

Returns

boolean

isString
methodpublic
public static isString(value: unknown): value is string

Parameters

Name
Type
Required
value
unknown
required

Returns

value is string

toObject
methodpublic
public static toObject( context: unknown): Record<string, unknown> | undefined

Parameters

Name
Type
Required
context
unknown
required

Returns

Record<string, unknown> | undefined

walkObjectBottomToTop
methodpublic
public static walkObjectBottomToTop(
  object: object,
  visit: (parent: object, key: string, value: unknown) => void,
  recursive: boolean
): void

Parameters

Name
Type
Required
object
object
required
visit
(parent: object, key: string, value: unknown)
required

Returns

void

walkObjectTopToBottom
methodpublic
public static walkObjectTopToBottom(
  object: object,
  visit: (parent: object, key: string, value: unknown) => void,
  recursive: boolean
): void

Parameters

Name
Type
Required
object
object
required
visit
(parent: object, key: string, value: unknown)
required

Returns

void