MCPcopy Index your code
hub / github.com/formatjs/formatjs / format

Method format

packages/intl-listformat/index.ts:272–287  ·  view source on GitHub ↗
(elements: Iterable<string>)

Source from the content-addressed store, hash-verified

270 )
271 }
272 format(elements: Iterable<string>): string {
273 validateInstance(this, 'format')
274 let result = ''
275 const parts = createPartsFromList(
276 ListFormat.__INTERNAL_SLOT_MAP__,
277 this,
278 stringListFromIterable(elements)
279 )
280 if (!Array.isArray(parts)) {
281 return parts.value
282 }
283 for (const p of parts) {
284 result += p.value
285 }
286 return result
287 }
288 formatToParts(elements: Iterable<string>): Part[] {
289 validateInstance(this, 'format')
290 const parts = createPartsFromList(

Callers

nothing calls this directly

Calls 3

createPartsFromListFunction · 0.85
stringListFromIterableFunction · 0.85
validateInstanceFunction · 0.70

Tested by

no test coverage detected