Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis. Learn more
Socket
Log inDemoInstall

@lite-v3/polyfills

Package Overview
Dependencies
6
Maintainers
7
Versions
4
Issues
File Explorer

Advanced tools

@lite-v3/polyfills

A standard polyfill library for tokopedia web services

    0.1.1latest
    npm

Version published
Maintainers
7
Weekly downloads
630
increased by8.81%

Weekly downloads

Readme

Source

@lite-v3/polyfills

A standard polyfill library for tokopedia web services

By Tokopedia Version

This module is only needed for webpack 4+.

Prerequisites

Webpack 4+

Install

# Using npm npm install @lite-v3/polyfills # Using yarn yarn add @lite-v3/polyfills # Using pnpm pnpm install @lite-v3/polyfills

Usage

Add the following to your entry client file:

import requirePolyfills, { definePolyfills } from '@lite-v3/polyfills'; requirePolyfills(condition, function () { runYourService(); });

or if you have additional polyfills

import requirePolyfills from '@lite-v3/polyfills'; const customPolyfills = [ { test: !(window.fetch || window.self.fetch), load: () => { return new Promise(resolve => { resolve(import(/* webpackChunkName: "unfetch-polyfill" */ 'unfetch/polyfill/index')); }); }, }, ]; requirePolyfills(condition, definePolyfills(customPolyfills), function () { runYourService(); });

API

requirePolyfills(condition, callback)

parameter

condition: Boolean callback: () => void

definePolyfills(polyfills)

parameter

polyfills: { test: boolean, load: () => Promise<unknown> }[]}


Code By WPE Team @Tokopedia

FAQs

Last updated on 14 Oct 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • 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