Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@kartotherian/babel
Advanced tools
Tile source to restructure vector PBFs for multilingual usecases, such as convert a single JSON object into multiple key/values, or to replace all language key/value names with a single one.
Tile is generated with 'name_' field set a JSON-encoded key-value object. Babel can be used to convert that tile to a tile, with each value in the object becoming a tag of its own, e.g. 'name_en', 'name_fr', ... . Also, babel can be used to replace multiple 'name_lang' tags with a single 'name_' tag right before rendering it, choosing the best language based on the fallback rules, but only if it is different from the 'name' tag.
# Process tiles from 'gen' source, expanding json string into multiple tags
json2tags:
uri: json2tags://
params:
source: {ref: gen}
tag: name # optional, 'name' is the default
# Process tiles from 'store' source, replacing all 'name_*' tags with a single 'name' tag
babel:
uri: babel://
params:
source: {ref: store}
# optional, 'name' is the default
tag: name
# optional, used by default if no 'lang' code is passed to getAsync()
defaultLanguage: 'en'
# optional map of fallback values. Can be a json file or an object value
languageMap: '/my/path/fallback.json'
# -- OR --
languageMap:
en: ['fr', 'es', 'de']
ru: ['be']
For babel://
, the language of the name_
is chosen based on these rules:
getAsync({z,x,y, lang:'xx')
:
name_xx
name_yy-Script
where Script
is the script of xx
. E.g. if lang=ru
, pick any lang_yy-Cyrl
.xx
uses the Latin script, use any name_zz_rm
name
Babel gets the CLDR defined script name (Latn, Cyrl, ... ) based on the language code. It also uses a few overrides from the overrides.json
. This file should be updated with any language IDs found in OSM data.
FAQs
Tile source to support multilingual maps
We found that @kartotherian/babel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.