Overview
Low-level shared types and utilities used throughout core/state/parser packages.
API Reference
Shared runtime and type utilities.
import { Type } from '@rs-x/core';import { Type } from '@rs-x/core';
const instance = new Type(...args);20 members in this class.
public static cast<T>(instance: unknown): TParameters
| Name | Type | Required |
|---|---|---|
| instance | unknown | required |
Returns
T
public static getConstructorName(value: unknown): stringParameters
| Name | Type | Required |
|---|---|---|
| value | unknown | required |
Returns
string
public static getPropertyDescriptor<T>(
root: unknown,
name: keyof T
): IPropertyDescriptorParameters
| Name | Type | Required |
|---|---|---|
| root | unknown | required |
| name | keyof T | required |
Returns
public static getPropertyDescriptorType(
// target: unknown,
// name: string,
propertyDescriptor: PropertyDescriptor
): PropertyDescriptorTypeParameters
| Name | Type | Required |
|---|---|---|
| // target: unknown | unknown | required |
| // name: string | unknown | required |
| propertyDescriptor | PropertyDescriptor | required |
Returns
public static hasOwnPropertyInPrototypeChain(
target: unknown,
key: PropertyKey
): booleanParameters
| Name | Type | Required |
|---|---|---|
| target | unknown | required |
| key | PropertyKey | required |
Returns
boolean
public static hasProperty(
root: unknown,
name: string
): booleanParameters
| Name | Type | Required |
|---|---|---|
| root | unknown | required |
| name | string | required |
Returns
boolean
public static isArrowFunction( object: unknown): object is (...args: unknown[]) => unknownParameters
| Name | Type | Required |
|---|---|---|
| object | unknown | required |
Returns
object is (...args: unknown[]) => unknown
public static isEmpty(value: unknown): booleanParameters
| Name | Type | Required |
|---|---|---|
| value | unknown | required |
Returns
boolean
public static isFunction(value: unknown): value is AnyFunctionParameters
| Name | Type | Required |
|---|---|---|
| value | unknown | required |
Returns
value is AnyFunction
public static isIterableCollection(value: unknown): booleanParameters
| Name | Type | Required |
|---|---|---|
| value | unknown | required |
Returns
boolean
public static isMethod(value: unknown): booleanParameters
| Name | Type | Required |
|---|---|---|
| value | unknown | required |
Returns
boolean
public static isNullOrUndefined(value: unknown): booleanParameters
| Name | Type | Required |
|---|---|---|
| value | unknown | required |
Returns
boolean
public static isPlainObject(value: unknown): value is PlainObjectParameters
| Name | Type | Required |
|---|---|---|
| value | unknown | required |
Returns
value is PlainObject
public static isPositiveInteger(value: unknown): booleanParameters
| Name | Type | Required |
|---|---|---|
| value | unknown | required |
Returns
boolean
public static isPositiveIntegerString(value: unknown): booleanParameters
| Name | Type | Required |
|---|---|---|
| value | unknown | required |
Returns
boolean
public static isReadonlyProperty(
target: unknown,
key: unknown
): booleanParameters
| Name | Type | Required |
|---|---|---|
| target | unknown | required |
| key | unknown | required |
Returns
boolean
public static isString(value: unknown): value is stringParameters
| Name | Type | Required |
|---|---|---|
| value | unknown | required |
Returns
value is string
public static toObject( context: unknown): Record<string, unknown> | undefinedParameters
| Name | Type | Required |
|---|---|---|
| context | unknown | required |
Returns
Record<string, unknown> | undefined
public static walkObjectBottomToTop(
object: object,
visit: (parent: object, key: string, value: unknown) => void,
recursive: boolean
): voidParameters
| Name | Type | Required |
|---|---|---|
| object | object | required |
| visit | (parent: object, key: string, value: unknown) | required |
Returns
void
public static walkObjectTopToBottom(
object: object,
visit: (parent: object, key: string, value: unknown) => void,
recursive: boolean
): voidParameters
| Name | Type | Required |
|---|---|---|
| object | object | required |
| visit | (parent: object, key: string, value: unknown) | required |
Returns
void