MCPcopy
hub / github.com/tailwindlabs/tailwindcss / retryAssertion

Function retryAssertion

integrations/utils.ts:662–678  ·  view source on GitHub ↗
(
  fn: () => Promise<T>,
  { timeout = ASSERTION_TIMEOUT, delay = 5 }: { timeout?: number; delay?: number } = {},
)

Source from the content-addressed store, hash-verified

660}
661
662export async function retryAssertion<T>(
663 fn: () => Promise<T>,
664 { timeout = ASSERTION_TIMEOUT, delay = 5 }: { timeout?: number; delay?: number } = {},
665) {
666 let end = Date.now() + timeout
667 let error: any
668 while (Date.now() < end) {
669 try {
670 return await fn()
671 } catch (err) {
672 Error.captureStackTrace(err, retryAssertion)
673 error = err
674 await new Promise((resolve) => setTimeout(resolve, delay))
675 }
676 }
677 throw error
678}
679
680export async function fetchStyles(base: string, path = '/'): Promise<string> {
681 while (base.endsWith('/')) {

Callers 15

next.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90
qwik.test.tsFile · 0.90
resolvers.test.tsFile · 0.90
solidstart.test.tsFile · 0.90
multi-root.test.tsFile · 0.90
nuxt.test.tsFile · 0.90
svelte.test.tsFile · 0.90
config.test.tsFile · 0.90
astro.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected