Socket
Socket
Sign inDemoInstall

@satumjs/async-override

Package Overview
Dependencies
5
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @satumjs/async-override

override async for sandbox


Version published
Maintainers
1
Created

Readme

Source

@satumjs/async-override

NPM version NPM downloads LICENSE Install size

override async for sandbox

Usage

// 用于行内代码,生成 fakeUrl 用于缓存等
getFileFakeUrl(fileName:string, appName?:string): string

// 改写 fetch 方法
satumMicroFetchFactory(
  data: IMicroApp | { system: IActorSystem, appName?: string },
  fetch?: typeof fetch,
): (req: string | RequestInfo, options?: RequestInit) => Promise<Response | undefined>

// 改写 ajax 类
satumMicroFetchFactory(
  data: IMicroApp | { system: IActorSystem, appName?: string },
  customAjaxClass?: typeof XMLHttpRequest,
): XMLHttpRequest

// 改写 document.createElement 方法
satumMicroCreateElementFactory(
  data: IMicroApp | { system: IActorSystem, appName?: string },
  createElement?: typeof document.createElement,
  fakeWinName?: string, // window 对象上 沙箱的 property
): (tagName: keyof HTMLElementTagNameMap, options?: ElementCreationOptions) => HTMLElement | null

FAQs

Last updated on 18 May 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc