ids

Last updated 8 months ago

Allows managing values/IDs which can vary between versions.

API Overview

  • Functions - API calls offered directly by the extension

    • ​new​

  • Methods - API calls which can only be made on an object returned by a constructor

API Documentation

Functions

​new​

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

​

Returns

​

Methods

​currentVersion​

Signature

cp.ids:currentVersion() -> semver

Type

Method

Description

Returns the current version number for the IDs library. May be nil.

Parameters

​

Returns

​

​load​

Signature

cp.ids:load([version]) -> table

Type

Method

Description

Loads and caches IDs for the given version. It will search through previous versions,

Parameters

​

Returns

​

​of​

Signature

cp.ids:of(version, subset) -> function

Type

Method

Description

Returns a function which can be called to retrieve a specific value for the specified version.

Parameters

​

Returns

​

​ofCurrent​

Signature

cp.ids:ofCurrent(subset) -> function

Type

Method

Description

Returns a function which can be called with an ID to retrieve a specific value for the current version.

Parameters

​

Returns

​

​previousVersion​

Signature

cp.ids:previousVersion([version]) -> semver

Type

Method

Description

Returns the previous version number that has stored IDs.

Parameters

​

Returns

​