MCPcopy
hub / github.com/formatjs/formatjs / ResolvePlural

Function ResolvePlural

packages/ecma402-abstract/PluralRules/ResolvePlural.ts:114–132  ·  view source on GitHub ↗
(
  pl: Intl.PluralRules,
  n: Decimal,
  {
    getInternalSlots,
    PluralRuleSelect,
  }: {
    getInternalSlots(pl: Intl.PluralRules): PluralRulesInternal
    PluralRuleSelect: (
      locale: string,
      type: 'cardinal' | 'ordinal',
      n: Decimal,
      operands: OperandsRecord
    ) => LDMLPluralRule
  }
)

Source from the content-addressed store, hash-verified

112 * @param PluralRuleSelect Has to pass in bc it's implementation-specific
113 */
114export function ResolvePlural(
115 pl: Intl.PluralRules,
116 n: Decimal,
117 {
118 getInternalSlots,
119 PluralRuleSelect,
120 }: {
121 getInternalSlots(pl: Intl.PluralRules): PluralRulesInternal
122 PluralRuleSelect: (
123 locale: string,
124 type: 'cardinal' | 'ordinal',
125 n: Decimal,
126 operands: OperandsRecord
127 ) => LDMLPluralRule
128 }
129): LDMLPluralRule {
130 return ResolvePluralInternal(pl, n, {getInternalSlots, PluralRuleSelect})
131 .pluralCategory
132}

Callers 1

selectMethod · 0.85

Calls 1

ResolvePluralInternalFunction · 0.85

Tested by

no test coverage detected