Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
language-range-match
Advanced tools
Matches accepted language ranges to supported locales following rfc4647
Readme
Filtering and lookup for language ranges matched against tags according to rfc4647
A typescript version/slight re-imagining of https://github.com/wooorm/bcp-47-match.
Huge thanks to https://github.com/wooorm for conceptual help and test cases.
console.log(basicFilter(['de-de', 'de-CH-1996', 'en-GB', 'en'], ['fr-FR', 'de-CH', 'en']));
// [
// { matchedRange: 'de-CH', matchingTag: 'de-CH-1996' },
// { matchedRange: 'en', matchingTag: 'en-GB' },
// { matchedRange: 'en', matchingTag: 'en' }
// ]
console.log(extendedFilter(['de-DE-1996', 'de-de', 'en-GB', 'en'], ['*-1996', 'en-*']));
// [
// { matchedRange: '*-1996', matchingTag: 'de-DE-1996' },
// { matchedRange: 'en-*', matchingTag: 'en-GB' },
// { matchedRange: 'en-*', matchingTag: 'en' }
// ]
console.log(basicLookup(['en-GB', 'en', 'zh-Hans', 'zh-Hant', 'zh'], ['zh-Hant-CN-x-private1-private2']));
// {
// matchedRange: 'zh-Hant-CN-x-private1-private2',
// matchingTag: 'zh-Hant'
// }
console.log(extendedLookup(['en-CH-1991', 'de-CH'], ['de-*-1991']));
// {
// matchedRange: 'de-*-1991',
// matchingTag: 'de-CH'
// }
/^(\*|([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})\*))$/
/^([a-zA-Z]{1,8}|\*)(-([a-zA-Z0-9]{1,8}|\*))*$/
*-GB
would match the tag en-GB
but not en
.FAQs
Matches accepted language ranges to supported locales following rfc4647
The npm package language-range-match receives a total of 283 weekly downloads. As such, language-range-match popularity was classified as not popular.
We found that language-range-match 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.