Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@financial-times/polyfill-useragent-normaliser

Financial-Times211.2kMITdeprecated1.10.2

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

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

readme

polyfill.io User Agent normaliser

This is the VCL & JS implementation of the User-Agent normalisation used within the polyfill-service and the polyfill-library.

Usage

For a request which was the user-agent Chrome 71.1:

Example in VCL

import "normalise-user-agent.vcl";

sub vcl_recv {
  call normalise_user_agent_1_0_6;
#   req.http.normalized_user_agent_family = "chrome";
#   req.http.normalized_user_agent_major_version = "71";
#   req.http.normalized_user_agent_minor_version = "1";
#   req.http.normalized_user_agent_patch_version = "0";
#   req.http.Normalized-User-Agent = "chrome/71.1.0";
}

Example in JS

const UA = require('@financial-times/polyfill-useragent-normaliser');

const useragent = new UA(request.headers['user-agent']);
console.log(useragent.isUnknown()); // false
console.log(useragent.satisfies("<50")); // false
console.log(useragent.satisfies(">50")); // true

changelog

1.7.0 (2020-03-19)

Bug Fixes

  • deps: bump semver from 7.1.1 to 7.1.3 (42eec6f)

Features

  • update to 1.5.1 of @financial-times/useragent_parser (e2859cc)

1.6.3 (2020-01-15)

Bug Fixes

  • deps: bump semver from 5.6.0 to 7.1.1 (42cae2c)

1.6.2 (2020-01-15)

Bug Fixes

  • deps: bump @financial-times/useragent_parser from 1.2.1 to 1.4.1 (bfde311)

1.6.1 (2020-01-15)

Bug Fixes

  • deps: [security] bump npm from 6.10.1 to 6.13.6 (f88e774)

1.6.0 (2020-01-13)

Features

  • alias: Continue mapping opera to chrome (db37102)

1.5.1 (2020-01-13)

Bug Fixes

  • Ensure useragent family name is checked for every alias (54ae910)

1.5.0 (2019-11-15)

Features

  • alias: chromium-edge is now chrome (3ae1eaf)

1.4.2 (2019-07-23)

Bug Fixes

  • add a description to package.json (c934413)

1.4.1 (2019-07-23)

Bug Fixes

  • Automatically build new copy of library when the version changes (78eb53b)

1.4.0 (2019-07-19)

Bug Fixes

  • add the commitlint config (e4f5943)
  • run prettier and use "use strict" (7e53d7c)
  • update package-lock.json (5a8d363)

Features

  • automate the releases using semantic release (350d18f)