Skip to content

Feature: Type

Аниса edited this page Sep 9, 2022 · 9 revisions

━ What's the Objective?

Set of native and custom type helpers to increase your productivity w/o bothering unnecessary JS nuisance!

━ APIs

━ vKit.isType() (Shared)

@Objective: Verifies data's type.
const bool: state = vKit.isType(
  ~: data,
  string: type
)

━ vKit.isNull() (Shared)

@Objective: Verifies whether the data is a null value.
const bool: state = vKit.isNull(
  ~: data
)

━ vKit.isBool() (Shared)

@Objective: Verifies whether the data is a boolean value.
const bool: state = vKit.isBool(
  ~: data
)

━ vKit.isString() (Shared)

@Objective: Verifies whether the data is a string value.
const bool: state = vKit.isString(
  ~: data
)

━ vKit.isNumber() (Shared)

@Objective: Verifies whether the data is a numeric value.
const bool: state = vKit.isNumber(
  ~: data
)

━ vKit.isObject() (Shared)

@Objective: Verifies whether the data is a object.
const bool: state = vKit.isObject(
  ~: data,
  bool: isArray // (Optional): If enabled, it also verifies whether the object is an array
)

━ vKit.isArray() (Shared)

@Objective: Verifies whether the data is an array.
const bool: state = vKit.isArray(
  ~: data
)

━ vKit.isClass() (Shared)

@Objective: Verifies whether the data is a class.
const bool: state = vKit.isClass(
  ~: data
)

━ vKit.clone() (Shared)

@Objective: Creates a clone of existing data.
const bool: state = vKit.clone(
  ~: data,
  bool: isRecursive // (Optional): Enabling this recursively clones all nested indexes for objects, classes etc
)