Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

format-bcp-47

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

format-bcp-47

Validates BCP-47 Language Tags using the npm package 'bcp-47' and formats them in a unique way to ensure consistency.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28
decreased by-37.78%
Maintainers
1
Weekly downloads
 
Created
Source

format-bcp-47

Validates BCP-47 Language Tags using the npm package bcp-47 and formats them in a unique way to ensure consistency.

Install

npm i format-bcp-47

Usage

const formatBcp47 = require('format-bcp-47');
console.log(formatBcp47('de-ch'));
console.log(formatBcp47('de-ch') === formatBcp47('DE-ch'));
console.log(formatBcp47(6757547547546754653));
/* CONSOLE:
de-CH
true
null
*/

Returns null if the valdiation fails, otherwise it returns a valid and formatted BCP-47 language tag.

What does it exactly?

It validates using bcp-47 and does some uppercase / lowercase formatting.

Keywords

FAQs

Package last updated on 27 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc