Skip to content

Latest commit

 

History

History
69 lines (57 loc) · 6.7 KB

cp.ids.md

File metadata and controls

69 lines (57 loc) · 6.7 KB

docs » cp.ids


Allows managing values/IDs which can vary between versions.

API Overview

API Documentation

Functions

Signature cp.ids.new(path[, currentVersionFn]) -> cp.ids
Type Function
Description Creates a new ids instance with the specified path to the version files and
Parameters
  • * path - The path to the version files.
  • * currentVersionFn - An optional function that will return the current version as a string or semver.
Returns
  • * A new cp.ids instance.

Methods

Signature cp.ids:currentVersion() -> semver
Type Method
Description Returns the current version number for the IDs library. May be nil.
Parameters
  • None
Returns
  • A semver with the version number or nil if none is available.
Signature cp.ids:load([version]) -> table
Type Method
Description Loads and caches IDs for the given version. It will search through previous versions,
Parameters
  • version - The version number you want to load as a string (i.e. "10.4.0"). If not provided, the current version is loaded.
Returns
  • A table containing all the IDs
Signature cp.ids:of(version, subset) -> table
Type Method
Description Returns a table of the IDs of the specified version and subset.
Parameters
  • version - The version number you want to load as a string (i.e. "10.4.0")
  • subset - A string containing the subset of data you want to load
Returns
  • A table containing the subset of IDs for the selected version. Will never be nil.
Signature cp.ids:ofCurrent(subset) -> table
Type Method
Description Returns a table of IDs for a current version and specified subset
Parameters
  • subset - A string containing the subset of data you want to load
Returns
  • A table containing the subset of IDs for the current version
Signature cp.ids:previousVersion([version]) -> semver
Type Method
Description Returns the previous version number that has stored IDs.
Parameters
  • version - The version number you want to load as a string (i.e. "10.4.0") or a semver, or nil to use the current version.
Returns
  • A semver instance for the previous version.