Skip to content
This repository was archived by the owner on Feb 14, 2021. It is now read-only.
This repository was archived by the owner on Feb 14, 2021. It is now read-only.

lookup return value #1

Description

@tregusti

Hi,

I'm using 1.0.1 and when I'm using basicFilter like this:

const { basicFilter } = require("accept-language-negotiator")
const code = basicFilter('sv', ['sv-SE', 'en-UK'])[0]

code becomes sv-SE like I assumed. However when I'm trying to use lookup like this:

const { lookup } = require("accept-language-negotiator")
const code = lookup('sv', ['sv-SE', 'en-UK'], null)

I would assume that code would become sv-SE. But it is what I sent in instead, sv. I read section 3.4 in the lookup information in the RFC but can't really see that this is how it should be.

The first matching tag found, according to the user's priority, is considered the closest match and is the item returned.

Is this a bug in lookup?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions