underscript.constants

by feildmaster (October 11, 2026)

Helpers for working with items, priorities and rarities when you are not sure what you were given. They accept an item, priority or rarity, or the text for one, like 'gold', 'high' or 'DT'.

Syntax

underscript.constants.getItem(value);
underscript.constants.isItem(value);
underscript.constants.getPriority(value);
underscript.constants.isPriority(value);
underscript.constants.getRarity(value);
underscript.constants.isRarity(value);

getItem
Returns the matching underscript.item, or undefined if there isn’t one.
isItem
true if the value is an item, or the text for one.
getPriority
Returns the matching underscript.priority, or undefined if there isn’t one.
isPriority
true if the value is a priority, or the text for one.
getRarity
Returns the matching underscript.rarity, or undefined if there isn’t one.
isRarity
true if the value is a rarity, or the text for one.

Examples

const { constants, item } = underscript;

constants.getItem('gold') === item.GOLD; // true
constants.isItem('not an item'); // false

constants.getPriority('high') === underscript.priority.HIGH; // true

constants.getRarity('DT') === underscript.rarity.DETERMINATION; // true