mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
26 lines
664 B
TypeScript
26 lines
664 B
TypeScript
// https://github.com/opentable/accept-language-parser/blob/v1.4.1/index.js
|
|
|
|
import * as AcceptLanguageParser from 'accept-language-parser';
|
|
|
|
const l1: AcceptLanguageParser.Language = {
|
|
code: 'en',
|
|
script: 'Latn',
|
|
region: 'GB',
|
|
quality: 0.9
|
|
};
|
|
|
|
const l2: AcceptLanguageParser.Language = {
|
|
code: 'en',
|
|
quality: 0.9
|
|
};
|
|
|
|
const l3: AcceptLanguageParser.Language = {
|
|
code: 'en',
|
|
script: null,
|
|
quality: 0.9
|
|
};
|
|
|
|
const parsed1: AcceptLanguageParser.Language[] = AcceptLanguageParser.parse('');
|
|
const pick1: string | null = AcceptLanguageParser.pick([''], '');
|
|
const pick2: string | null = AcceptLanguageParser.pick([''], [l1, l2, l3]);
|