How to use the @financial-times/polyfill-useragent-normaliser.normalize function in @financial-times/polyfill-useragent-normaliser

To help you get started, we’ve selected a few @financial-times/polyfill-useragent-normaliser 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-library / lib / index.js View on Github external
"use strict";

const toposort = require("toposort").array;
const createAliasResolver = require("./aliases");
const UA = require('@financial-times/polyfill-useragent-normaliser');
const sources = require("./sources");
const appVersion = require("../package.json").version;
const streamFromPromise = require("stream-from-promise");
const streamFromString = require("from2-string");
const mergeStream = require("merge2");
const streamToString = require("stream-to-string");
const normalizeUserAgent = UA.normalize;
const LRUCache = require('mnemonist/lru-cache');
const cache = new LRUCache(1000);

module.exports = {
	listAliases,
	listAllPolyfills,
	describePolyfill,
	getOptions,
	getPolyfills,
	getPolyfillString,
	normalizeUserAgent
};

/**
 * Get a list of all the aliases which exist within the collection of polyfill sources.
 * @returns {Promise} A promise which resolves with an array of all the aliases within the collection.

@financial-times/polyfill-useragent-normaliser

The user-agent normalisation logic behind polyfill-library and polyfill.io

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis

Similar packages