
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
format-bcp-47
Advanced tools
Validates BCP-47 Language Tags using the npm package 'bcp-47' and formats them in a unique way to ensure consistency.
Validates BCP-47 Language Tags using the npm package bcp-47 and formats them in a unique way to ensure consistency.
npm i format-bcp-47
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.
It validates using bcp-47
and does some uppercase / lowercase formatting.
FAQs
Validates BCP-47 Language Tags using the npm package 'bcp-47' and formats them in a unique way to ensure consistency.
We found that format-bcp-47 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.