How to use the polyfill-library.describePolyfill function in polyfill-library

To help you get started, we’ve selected a few polyfill-library examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Financial-Times / polyfill-service / src / data / polyfills.js View on Github external
polyfills: aliases[alias]
						});
					}
				}
			}
		}
		for (const polyfill of await polyfillLibrary.listAllPolyfills()) {
			// Polyfills which start with _ are internal functions used by other polyfills, they should not be displayed on the website.
			if (!polyfill.startsWith("_") && !polyfill.startsWith("Intl.~locale")) {
				const polyfillInfo = Object.assign(
					{
						name: polyfill,
						labelID: `${snakeCase(polyfill)}_label`,
						license: "MIT"
					},
					await polyfillLibrary.describePolyfill(polyfill)
				);
				polyfillInfo.licenseLowerCase = polyfillInfo.license.toLowerCase();
				polyfills.push(polyfillInfo);
			}
		}
	}
	return {
		polyfills,
		polyfillAliases
	};
};