MCPcopy Index your code
hub / github.com/browserless/browserless / toSetContentOptions

Function toSetContentOptions

src/utils.ts:797–815  ·  view source on GitHub ↗
(
  options?: GoToOptions,
)

Source from the content-addressed store, hash-verified

795 * (they were always no-ops for `setContent`, which fires no network).
796 */
797export const toSetContentOptions = (
798 options?: GoToOptions,
799): SetContentWaitForOptions | undefined => {
800 if (!options) return options;
801 const { waitUntil, ...rest } = options;
802 if (waitUntil === undefined) return rest;
803 const events = Array.isArray(waitUntil) ? waitUntil : [waitUntil];
804 const supported = events.filter(
805 (
806 e,
807 ): e is Exclude<PuppeteerLifeCycleEvent, 'networkidle0' | 'networkidle2'> =>
808 e !== 'networkidle0' && e !== 'networkidle2',
809 );
810 if (supported.length === 0) return rest;
811 return {
812 ...rest,
813 waitUntil: Array.isArray(waitUntil) ? supported : supported[0],
814 };
815};
816
817export const parseBooleanParam = (
818 params: URLSearchParams,

Callers 5

utils.spec.tsFile · 0.85
handlerMethod · 0.85
handlerMethod · 0.85
handlerMethod · 0.85
handlerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected