Wondering what’s next for npm?Check out our public roadmap! »

is-language-codeTypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

is-language-code

Is given string a language code (as per IANA)

Install

npm i is-language-code

Quick Take

import { strict as assert } from "assert";
import { isLangCode } from "dist/is-language-code.esm";

assert.deepEqual(isLangCode("de-419-DE"), {
  res: false,
  message: 'Two region subtags, "419" and "de".',
});

assert.deepEqual(isLangCode("sr-Latn"), {
  res: true,
  message: null,
});

Documentation

Please visit codsen.com for a full description of the API and examples.

Licence

MIT License

Copyright (c) 2010-2021 Roy Revelt and other contributors

ok codsen star

Install

npm i is-language-code

DownloadsWeekly Downloads

48,538

Version

3.0.0

License

MIT

Unpacked Size

382 kB

Total Files

14

Last publish

Collaborators

  • avatar