Call as
Functions.values.isin(array, value)
Record it as a dependency named Functions.values.isin (accepting the completion does this), then call it by that name.
Also accepted under the former namespace utils.
What it does
Check whether a table has a non-nil value at a key. A stored false value still counts as present; this does not scan table values.
Arguments
| Name | Type | What it does |
|---|---|---|
array | table | Table to inspect. |
value | any | Lookup key. |
Returns
| 1 | boolean | True when array[value] is non-nil. |
|---|
Editions
Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.
It reads no game API directly.
How the addon calls it
- Any Spell Charges (valid)
return (value.operator ~= nil and Functions.values.isin(addon.operators, value.operator) and - Any Spell Cooldown (valid)
return (value.operator ~= nil and Functions.values.isin(addon.operators, value.operator) and - Any Spell Recharge Time (valid)
return (value.operator ~= nil and Functions.values.isin(addon.operators, value.operator) and - Attackable (valid)
return value.unit ~= nil and Functions.values.isin(addon.units, value.unit); - Buff Present (valid)
return (value.unit ~= nil and Functions.values.isin(addon.units, value.unit) and value.spell ~= nil) - Buff Time Remaining (valid)
return (value.unit ~= nil and Functions.values.isin(addon.units, value.unit) and value.spell ~= nil and - Buff Stacks (valid)
return (value.unit ~= nil and Functions.values.isin(addon.units, value.unit) and value.spell ~= nil and - Have Item In Bags (valid)
value.operator ~= nil and Functions.values.isin(addon.operators, value.operator) and
and 95 more: Casting (valid), Cast Progress (valid), Cast Time Remaining (valid), Specific Spell Casting (valid), Cast Interruptible (valid), Channeling (valid), Channel Progress (valid), Channel Time Remaining (valid), Specific Spell Channeling (valid), Channel Interruptible (valid), Class (valid), Unit Classification (valid), Class In Group (valid), In Combat (valid), Combat Action History (valid), Combat Action History Time (valid), Creature Type (valid), Is Dead or Ghost (valid), Debuff Present (valid), Debuff Time Remaining (valid), Debuff Stacks (valid), Debuff Type Present (valid), Distance (valid), Distance Count (valid), Eclipse (valid), Extended Character Stat (valid), Extended Character Stat Percentage (valid), Hostile (valid), Is Friendly (valid), In Group (evaluate), Group Count (valid), Health (valid), Health Percentage (valid), Immune (valid), Instance (valid), Is Same As (valid), Item Cooldown (valid), Level (valid), Loss Of Control Blocked (valid), Loss Of Control Type (valid), Mana (valid), Mana Percentage (valid), Raid Mark (valid), Raid Mark Count (valid), Pet Spell Charges (valid), Pet Spell Cooldown (valid), Pet Spell Cast History (valid), Pet Spell Cast History Time (valid), Pet Spell Recharge Time (valid), Pet Happiness (valid), Player State (valid), Points (valid), Power (valid), Power Percentage (valid), Allies Within Range (valid), Health Within Range (valid), Health Percentage Within Range (valid), Health Percentage Count Within Range (valid), Health Count Within Range (valid), Mana Within Range (valid), Mana Percentage Within Range (valid), Mana Percentage Count Within Range (valid), Mana Count Within Range (valid), PVP Flagged (valid), Resistant (valid), Role (valid), Runes (valid), Rune Cooldown (valid), Runner (valid), Level (valid), Item Set Pieces Equipped (valid), Spell Charges (valid), Spell Cooldown (valid), Spell Cast History (valid), Spell Cast History Time (valid), Spell Recharge Time (valid), Character Stat (valid), Has Stealable Buff (valid), Weapon Swing Time (valid), Weapon Swing Time Remaining (valid), Talent (valid), Talent Tree Points (valid), Threat (valid), Threat Count (valid), Time Since Combat Start (valid), Time Until Health (valid), Time Until Health Percentage (valid), Unit Exists (valid), Weapon Enchant Time Remaining (valid), Weapon Enchant Stacks (valid), Zone PVP (valid), Conditions.bossmod.validCompare, Conditions.edition_state.validCompare, Conditions.encounter_state.validCompare, Conditions.group_state.validCompare
Source
Functions/values.lua, line 46. Read only in game; Duplicate makes an editable copy.
Functions.values.isin(array, value)
return array[value] ~= nil