{"_id":"bcp-47-match","_rev":"3549991","name":"bcp-47-match","description":"Match BCP 47 language tags with language ranges per RFC 4647","dist-tags":{"latest":"2.0.3"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"time":{"modified":"2024-09-19T02:40:31.000Z","created":"2018-07-20T22:13:57.628Z","2.0.3":"2022-11-15T11:44:43.396Z","2.0.2":"2022-03-30T12:38:40.691Z","2.0.1":"2021-11-04T14:55:24.780Z","2.0.0":"2021-04-01T10:13:58.758Z","1.0.3":"2020-10-26T12:16:21.011Z","1.0.2":"2020-01-19T08:33:42.549Z","1.0.1":"2019-05-14T08:58:20.698Z","1.0.0":"2018-07-20T22:13:57.628Z"},"users":{},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"repository":{"type":"git","url":"git+https://github.com/wooorm/bcp-47-match.git"},"versions":{"2.0.3":{"name":"bcp-47-match","version":"2.0.3","description":"Match BCP 47 language tags with language ranges per RFC 4647","license":"MIT","keywords":["bcp","47","bcp47","bcp-47","language","tag","match","matching","check","rfc","4647"],"repository":{"type":"git","url":"git+https://github.com/wooorm/bcp-47-match.git"},"bugs":{"url":"https://github.com/wooorm/bcp-47-match/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/node":"^18.0.0","c8":"^7.0.0","chalk":"^5.0.0","prettier":"^2.0.0","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.52.0"},"scripts":{"prepack":"npm run build && npm run format","build":"tsc --build --clean && tsc --build && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test.js","test-coverage":"c8 --check-coverage --100 --reporter lcov npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true},"remarkConfig":{"plugins":["preset-wooorm",["gfm",{"tablePipeAlign":false}],["lint-table-pipe-alignment",false]]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"59d8bf28481e990aa7b38807270d76d2fad98606","homepage":"https://github.com/wooorm/bcp-47-match#readme","_id":"bcp-47-match@2.0.3","_nodeVersion":"19.0.0","_npmVersion":"8.19.2","dist":{"shasum":"603226f6e5d3914a581408be33b28a53144b09d0","size":5846,"noattachment":false,"key":"/bcp-47-match/-/bcp-47-match-2.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/bcp-47-match/download/bcp-47-match-2.0.3.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bcp-47-match_2.0.3_1668512683219_0.19405738384641746"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-11-15T12:24:36.045Z","publish_time":1668512683396,"_cnpm_publish_time":1668512683396},"2.0.2":{"name":"bcp-47-match","version":"2.0.2","description":"Match BCP 47 language tags with language ranges per RFC 4647","license":"MIT","keywords":["bcp","47","bcp47","bcp-47","language","tag","match","matching","check","rfc","4647"],"repository":{"type":"git","url":"git+https://github.com/wooorm/bcp-47-match.git"},"bugs":{"url":"https://github.com/wooorm/bcp-47-match/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","chalk":"^5.0.0","prettier":"^2.0.0","remark-cli":"^10.0.0","remark-preset-wooorm":"^9.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.48.0"},"scripts":{"prepublishOnly":"npm run build && npm run format","build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true},"remarkConfig":{"plugins":["preset-wooorm",["gfm",{"tablePipeAlign":false}],["lint-table-pipe-alignment",false]]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"bc7b65b153985ca1ad5c8722911acac52eb297fb","homepage":"https://github.com/wooorm/bcp-47-match#readme","_id":"bcp-47-match@2.0.2","_nodeVersion":"17.4.0","_npmVersion":"8.5.5","dist":{"shasum":"3323e221eb5b40ddc3b91ed29d847ab459d549c4","size":5657,"noattachment":false,"key":"/bcp-47-match/-/bcp-47-match-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/bcp-47-match/download/bcp-47-match-2.0.2.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bcp-47-match_2.0.2_1648643920570_0.5600580228782444"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-30T12:45:04.543Z","publish_time":1648643920691,"_cnpm_publish_time":1648643920691},"2.0.1":{"name":"bcp-47-match","version":"2.0.1","description":"Match BCP 47 language tags with language ranges per RFC 4647","license":"MIT","keywords":["bcp","47","bcp47","bcp-47","language","tag","match","matching","check","rfc","4647"],"repository":{"type":"git","url":"git+https://github.com/wooorm/bcp-47-match.git"},"bugs":{"url":"https://github.com/wooorm/bcp-47-match/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","chalk":"^4.0.0","prettier":"^2.0.0","remark-cli":"^10.0.0","remark-preset-wooorm":"^9.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.46.0"},"scripts":{"prepublishOnly":"npm run build && npm run format","build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true},"remarkConfig":{"plugins":["preset-wooorm",["gfm",{"tablePipeAlign":false}],["lint-table-pipe-alignment",false]]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"94c31cb95f2ed22a37714bd978952de19a2a1d13","homepage":"https://github.com/wooorm/bcp-47-match#readme","_id":"bcp-47-match@2.0.1","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"shasum":"aa8e045386dd4356be07b1fd79d614c108459f4e","size":5666,"noattachment":false,"key":"/bcp-47-match/-/bcp-47-match-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/bcp-47-match/download/bcp-47-match-2.0.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bcp-47-match_2.0.1_1636037724616_0.9162208532704388"},"_hasShrinkwrap":false,"publish_time":1636037724780,"_cnpm_publish_time":1636037724780,"_cnpmcore_publish_time":"2021-12-16T18:35:22.737Z"},"2.0.0":{"name":"bcp-47-match","version":"2.0.0","description":"Match BCP 47 language tags with language ranges per RFC 4647","license":"MIT","keywords":["bcp","47","bcp47","bcp-47","language","tag","match","matching","check","rfc","4647"],"repository":{"type":"git","url":"git+https://github.com/wooorm/bcp-47-match.git"},"bugs":{"url":"https://github.com/wooorm/bcp-47-match/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","chalk":"^4.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.38.0"},"scripts":{"prepack":"npm run build && npm run format","build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"import/no-mutable-exports":"off","no-var":"off","prefer-arrow-callback":"off"}},"remarkConfig":{"plugins":["preset-wooorm",["gfm",{"tablePipeAlign":false}],["lint-table-pipe-alignment",false]]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true},"gitHead":"1f4efb75bf89e51a5c5d757adb3893701eb00bde","homepage":"https://github.com/wooorm/bcp-47-match#readme","_id":"bcp-47-match@2.0.0","_nodeVersion":"15.11.0","_npmVersion":"7.6.2","dist":{"shasum":"d0481051d51608cb5f5d7f75f5f5668e273dc469","size":5236,"noattachment":false,"key":"/bcp-47-match/-/bcp-47-match-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/bcp-47-match/download/bcp-47-match-2.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bcp-47-match_2.0.0_1617272038610_0.8150288982946172"},"_hasShrinkwrap":false,"publish_time":1617272038758,"_cnpm_publish_time":1617272038758,"_cnpmcore_publish_time":"2021-12-16T18:35:23.010Z"},"1.0.3":{"name":"bcp-47-match","version":"1.0.3","description":"Match BCP 47 language tags with language ranges per RFC 4647","license":"MIT","keywords":["bcp","47","bcp47","bcp-47","language","tag","match","matching","check","rfc","4647"],"repository":{"type":"git","url":"git+https://github.com/wooorm/bcp-47-match.git"},"bugs":{"url":"https://github.com/wooorm/bcp-47-match/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{},"devDependencies":{"browserify":"^17.0.0","chalk":"^4.0.0","nyc":"^15.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","tape":"^5.0.0","tinyify":"^3.0.0","xo":"^0.34.0"},"scripts":{"format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","build-bundle":"browserify index.js -s bcp47Match -o bcp-47-match.js","build-mangle":"browserify index.js -s bcp47Match -p tinyify -o bcp-47-match.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"eqeqeq":["error","always",{"null":"ignore"}],"no-eq-null":"off","unicorn/prefer-includes":"off"}},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"plugins":["preset-wooorm",["gfm",{"tablePipeAlign":false}],["lint-table-pipe-alignment",false]]},"gitHead":"5f5137a8ab63a28000823e8254a0809090dc6b3d","homepage":"https://github.com/wooorm/bcp-47-match#readme","_id":"bcp-47-match@1.0.3","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"shasum":"cb8d03071389a10aff2062b862d6575ffd7cd7ef","size":4659,"noattachment":false,"key":"/bcp-47-match/-/bcp-47-match-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/bcp-47-match/download/bcp-47-match-1.0.3.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bcp-47-match_1.0.3_1603714580871_0.35249739150205883"},"_hasShrinkwrap":false,"publish_time":1603714581011,"_cnpm_publish_time":1603714581011,"_cnpmcore_publish_time":"2021-12-16T18:35:23.258Z"},"1.0.2":{"name":"bcp-47-match","version":"1.0.2","description":"Match BCP 47 language tags with language ranges per RFC 4647","license":"MIT","keywords":["bcp","47","bcp47","bcp-47","language","tag","match","matching","check","rfc","4647"],"repository":{"type":"git","url":"git+https://github.com/wooorm/bcp-47-match.git"},"bugs":{"url":"https://github.com/wooorm/bcp-47-match/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","chalk":"^3.0.0","nyc":"^15.0.0","prettier":"^1.0.0","remark-cli":"^7.0.0","remark-preset-wooorm":"^6.0.0","tape":"^4.0.0","tinyify":"^2.0.0","xo":"^0.25.0"},"scripts":{"format":"remark . -qfo && prettier --write \"**/*.js\" && xo --fix","build-bundle":"browserify index.js -s bcp47Match > bcp-47-match.js","build-mangle":"browserify index.js -s bcp47Match -p tinyify > bcp-47-match.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"unicorn/prefer-includes":"off"}},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"settings":{"paddedTable":false},"plugins":["preset-wooorm",["toc",{"heading":"contents"}],["lint-table-pipe-alignment",false]]},"gitHead":"1a9d0541d991923ca6c0d07fb5f86db8422972de","homepage":"https://github.com/wooorm/bcp-47-match#readme","_id":"bcp-47-match@1.0.2","_nodeVersion":"13.0.1","_npmVersion":"6.13.6","dist":{"shasum":"a222ff4a34d2b91615e306d3a7352f809ca676ca","size":4644,"noattachment":false,"key":"/bcp-47-match/-/bcp-47-match-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/bcp-47-match/download/bcp-47-match-1.0.2.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bcp-47-match_1.0.2_1579422822371_0.9926722468173448"},"_hasShrinkwrap":false,"publish_time":1579422822549,"_cnpm_publish_time":1579422822549,"_cnpmcore_publish_time":"2021-12-16T18:35:23.486Z"},"1.0.1":{"name":"bcp-47-match","version":"1.0.1","description":"Match BCP 47 language tags with language ranges per RFC 4647","license":"MIT","keywords":["bcp","47","bcp47","bcp-47","language","tag","match","matching","check","rfc","4647"],"repository":{"type":"git","url":"git+https://github.com/wooorm/bcp-47-match.git"},"bugs":{"url":"https://github.com/wooorm/bcp-47-match/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","chalk":"^2.4.1","nyc":"^14.0.0","prettier":"^1.11.0","remark-cli":"^6.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.0.0","tinyify":"^2.4.3","xo":"^0.24.0"},"scripts":{"format":"remark . -qfo && prettier --write \"**/*.js\" && xo --fix","build-bundle":"browserify index.js -s bcp47Match > bcp-47-match.js","build-mangle":"browserify index.js -s bcp47Match -p tinyify > bcp-47-match.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"50d641411eb35e01259995646653f7943cf4e28f","homepage":"https://github.com/wooorm/bcp-47-match#readme","_id":"bcp-47-match@1.0.1","_nodeVersion":"11.9.0","_npmVersion":"6.9.0","dist":{"shasum":"1c7fdf17a589e02bc89f534012bf3395b6779b8d","size":4592,"noattachment":false,"key":"/bcp-47-match/-/bcp-47-match-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/bcp-47-match/download/bcp-47-match-1.0.1.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bcp-47-match_1.0.1_1557824300466_0.21818265133591308"},"_hasShrinkwrap":false,"publish_time":1557824300698,"_cnpm_publish_time":1557824300698,"_cnpmcore_publish_time":"2021-12-16T18:35:23.749Z"},"1.0.0":{"name":"bcp-47-match","version":"1.0.0","description":"Match BCP 47 language tags with language ranges per RFC 4647","license":"MIT","keywords":["bcp","47","bcp47","bcp-47","language","tag","match","matching","check","rfc","4647"],"repository":{"type":"git","url":"git+https://github.com/wooorm/bcp-47-match.git"},"bugs":{"url":"https://github.com/wooorm/bcp-47-match/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"files":["index.js"],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","chalk":"^2.4.1","nyc":"^12.0.0","prettier":"^1.11.0","remark-cli":"^5.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.0.0","tinyify":"^2.4.3","xo":"^0.21.0"},"scripts":{"format":"remark . -qfo && prettier --write '**/*.js' && xo --fix","build-bundle":"browserify index.js -s bcp47Match > bcp-47-match.js","build-mangle":"browserify index.js -s bcp47Match -p tinyify > bcp-47-match.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"7f726bc9ed245b63c87b597952135d4d00981e3b","homepage":"https://github.com/wooorm/bcp-47-match#readme","_id":"bcp-47-match@1.0.0","_npmVersion":"6.2.0","_nodeVersion":"10.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"shasum":"24e1ffc4b6905177e299c21756b6c9f347fe573e","size":4496,"noattachment":false,"key":"/bcp-47-match/-/bcp-47-match-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/bcp-47-match/download/bcp-47-match-1.0.0.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bcp-47-match_1.0.0_1532124837544_0.3006539440057172"},"_hasShrinkwrap":false,"publish_time":1532124837628,"_cnpm_publish_time":1532124837628,"_cnpmcore_publish_time":"2021-12-16T18:35:23.978Z"}},"readme":"<!--lint disable no-html-->\n\n# bcp-47-match\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n\nMatch BCP 47 language tags with language ranges per RFC 4647.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`basicFilter(tags[, ranges='*'])`](#basicfiltertags-ranges)\n    *   [`extendedFilter(tags[, ranges='*'])`](#extendedfiltertags-ranges)\n    *   [`lookup(tags, ranges)`](#lookuptags-ranges)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package can match [BCP 47][spec] language tags with “language ranges” per\n[RFC 4647][match].\nThis is done by the `:lang()` pseudo class in CSS, the `Accept-Language` HTTP\nheader, and a few other places.\n\n## When should I use this?\n\nYou can use this package if you want to choose a certain document based on\nlanguage tags.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 14.14+, 16.0+), install with [npm][]:\n\n```sh\nnpm install bcp-47-match\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport * as bcp47Match from 'https://esm.sh/bcp-47-match@2'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import * as bcp47Match from 'https://esm.sh/bcp-47-match@2?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {basicFilter, extendedFilter, lookup} from 'bcp-47-match'\n\nconst tags = ['en-GB', 'de-CH', 'en', 'de']\n\nconsole.log(basicFilter(tags, '*')) // => [ 'en-GB', 'de-CH', 'en', 'de' ]\nconsole.log(basicFilter(tags, 'en')) // => [ 'en-GB', 'en' ]\nconsole.log(basicFilter(tags, 'en-GB')) // => [ 'en-GB' ]\nconsole.log(basicFilter(tags, ['en-GB', 'en'])) // => [ 'en-GB', 'en' ]\nconsole.log(basicFilter(tags, 'jp')) // => []\n\nconsole.log(extendedFilter(tags, '*')) // => [ 'en-GB', 'de-CH', 'en', 'de' ]\nconsole.log(extendedFilter(tags, 'en')) // => [ 'en-GB', 'en' ]\nconsole.log(extendedFilter(tags, 'en-GB')) // => [ 'en-GB' ]\nconsole.log(extendedFilter(tags, '*-GB')) // => [ 'en-GB' ]\nconsole.log(extendedFilter(tags, ['en-GB', 'en'])) // => [ 'en-GB', 'en' ]\nconsole.log(extendedFilter(tags, 'jp')) // => []\n\nconsole.log(lookup(tags, 'en')) // => 'en'\nconsole.log(lookup(tags, 'en-GB')) // => 'en-GB'\nconsole.log(lookup(tags, ['en-GB', 'en'])) // => 'en-GB'\nconsole.log(lookup(tags, ['en', 'en-GB'])) // => 'en'\nconsole.log(lookup(tags, 'jp')) // => undefined\n```\n\n## API\n\nThis package exports the identifier `basicFilter`, `extendedFilter`, and\n`lookup`.\nThere is no default export.\n\n### `basicFilter(tags[, ranges='*'])`\n\n> ???? **Note**: See\n> [Basic Filtering spec](https://tools.ietf.org/html/rfc4647#section-3.3.1)\n\nMatch language tags to a list of simple ranges.\nSearches for matches between the first range and all tags, and continues\nwith further ranges.\nReturns a list of matching tags in the order they matched.\n\n<details><summary>View matching table</summary>\n\n| Basic Filter | `*` | `de` | `de-CH` | `de-DE` | `de-*-DE` | `*-CH` |\n| - | - | - | - | - | - | - |\n| `de` | ✔︎ | ✔︎ | | | | |\n| `de-CH` | ✔︎ | ✔︎ | ✔︎ | | | |\n| `de-CH-1996` | ✔︎ | ✔︎ | ✔︎ | | | |\n| `de-DE` | ✔︎ | ✔︎ | | ✔︎ | | |\n| `de-DE-1996` | ✔︎ | ✔︎ | | ✔︎ | | |\n| `de-DE-x-goethe` | ✔︎ | ✔︎ | | ✔︎ | | |\n| `de-Deva` | ✔︎ | ✔︎ | | | | |\n| `de-Deva-DE` | ✔︎ | ✔︎ | | | | |\n| `de-Latf-DE` | ✔︎ | ✔︎ | | | | |\n| `de-Latn-DE` | ✔︎ | ✔︎ | | | | |\n| `de-Latn-DE-1996` | ✔︎ | ✔︎ | | | | |\n| `de-x-DE` | ✔︎ | ✔︎ | | | | |\n| `en` | ✔︎ | | | | | |\n| `en-GB` | ✔︎ | | | | | |\n| `zh` | ✔︎ | | | | | |\n| `zh-Hans` | ✔︎ | | | | | |\n| `zh-Hant` | ✔︎ | | | | | |\n\n</details>\n\n###### Parameters\n\n*   `tags` (`string` or `Array<string>`)\n    — list of BCP 47 tags\n*   `ranges` (`string` or `Array<string>`, default: `'*'`)\n    — list of RFC 4647\n    [basic ranges][basic-range]\n    (aka, matching `/^(\\*|[a-z]{1,8}(-[a-z0-9]{1,8})*)$/i`)\n\n###### Returns\n\nPossibly empty list of matching tags in the order they matched\n(`Array<string>`).\n\n### `extendedFilter(tags[, ranges='*'])`\n\n> ???? **Note**: See\n> [Extended Filtering spec](https://tools.ietf.org/html/rfc4647#section-3.3.2)\n\nMatch language tags to a list of extended ranges.\nSearches for matches between the first range and all tags, and continues\nwith further ranges.\n\n<details><summary>View matching table</summary>\n\n| Extended Filter | `*` | `de` | `de-CH` | `de-DE` | `de-*-DE` | `*-CH` |\n| - | - | - | - | - | - | - |\n| `de` | ✔︎ | ✔︎ | | | | |\n| `de-CH` | ✔︎ | ✔︎ | ✔︎ | | | ✔︎ |\n| `de-CH-1996` | ✔︎ | ✔︎ | ✔︎ | | | ✔︎ |\n| `de-DE` | ✔︎ | ✔︎ | | ✔︎ | ✔︎ | |\n| `de-DE-1996` | ✔︎ | ✔︎ | | ✔︎ | ✔︎ | |\n| `de-DE-x-goethe` | ✔︎ | ✔︎ | | ✔︎ | ✔︎ | |\n| `de-Deva` | ✔︎ | ✔︎ | | | | |\n| `de-Deva-DE` | ✔︎ | ✔︎ | | ✔︎ | ✔︎ | |\n| `de-Latf-DE` | ✔︎ | ✔︎ | | ✔︎ | ✔︎ | |\n| `de-Latn-DE` | ✔︎ | ✔︎ | | ✔︎ | ✔︎ | |\n| `de-Latn-DE-1996` | ✔︎ | ✔︎ | | ✔︎ | ✔︎ | |\n| `de-x-DE` | ✔︎ | ✔︎ | | | | |\n| `en` | ✔︎ | | | | | |\n| `en-GB` | ✔︎ | | | | | |\n| `zh` | ✔︎ | | | | | |\n| `zh-Hans` | ✔︎ | | | | | |\n| `zh-Hant` | ✔︎ | | | | | |\n\n</details>\n\n###### Parameters\n\n*   `tags` (`string` or `Array<string>`)\n    — list of BCP 47 tags\n*   `ranges` (`string` or `Array<string>`, default: `'*'`)\n    — list of RFC 4647 [extended ranges][extended-range]\n    (aka, matching `/^(\\*|[a-z]{1,8})(-(\\*|[a-z0-9]{1,8}))*$/i`)\n\n###### Returns\n\nPossibly empty list of matching tags in the order they matched\n(`Array<string>`).\n\n### `lookup(tags, ranges)`\n\n> ???? **Note**: See\n> [Lookup spec](https://tools.ietf.org/html/rfc4647#section-3.4)\n\nFind the best language tag that matches a list of ranges.\nSearches for a match between the first range and all tags, and continues\nwith further ranges.\nReturns the first match, if any.\n\n<details><summary>View matching table</summary>\n\n| Lookup | `*` | `de` | `de-CH` | `de-DE` | `de-*-DE` | `*-CH` |\n| - | - | - | - | - | - | - |\n| `de` | | ✔︎︎ | ✔︎︎ | ✔︎ | ✔︎ | ✔︎ |\n| `de-CH` | | | ✔︎ | | | ✔︎ |\n| `de-CH-1996` | | | | | | ✔︎ |\n| `de-DE` | | | | ✔︎ | | ✔︎ |\n| `de-DE-1996` | | | | | | ✔︎ |\n| `de-DE-x-goethe` | | | | | | ✔︎ |\n| `de-Deva` | | | | | | ✔︎ |\n| `de-Deva-DE` | | | | | | ✔︎ |\n| `de-Latf-DE` | | | | | | ✔︎ |\n| `de-Latn-DE` | | | | | | ✔︎ |\n| `de-Latn-DE-1996` | | | | | | ✔︎ |\n| `de-x-DE` | | | | | | ✔︎ |\n| `en` | | | | | | ✔︎ |\n| `en-GB` | | | | | | ✔︎ |\n| `zh` | | | | | | ✔︎ |\n| `zh-Hans` | | | | | | ✔︎ |\n| `zh-Hant` | | | | | | ✔︎ |\n\n</details>\n\n###### Parameters\n\n*   `tags` (`string` or `Array<string>`)\n    — list of BCP 47 tags\n*   `ranges` (`string` or `Array<string>`)\n    — list of RFC 4647 basic ranges (but `*` is ignored)\n\n###### Returns\n\nFirst matching tag in `tags`, `undefined` otherwise (`string?`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nThis package is at least compatible with all maintained versions of Node.js.\nAs of now, that is Node.js 14.14+ and 16.0+.\nIt also works in Deno and modern browsers.\n\n## Security\n\nThis package is safe.\n\n## Related\n\n*   [`wooorm/bcp-47`](https://github.com/wooorm/bcp-47)\n    — parse and serialize BCP 47 language tags\n*   [`wooorm/bcp-47-normalize`](https://github.com/wooorm/bcp-47-normalize)\n    — normalize, canonicalize, and format BCP 47 tags\n*   [`wooorm/iso-3166`](https://github.com/wooorm/iso-3166)\n    — ISO 3166 codes\n*   [`wooorm/iso-639-2`](https://github.com/wooorm/iso-639-2)\n    — ISO 639-2 codes\n*   [`wooorm/iso-639-3`](https://github.com/wooorm/iso-639-3)\n    — ISO 639-3 codes\n*   [`wooorm/iso-15924`](https://github.com/wooorm/iso-15924)\n    — ISO 15924 codes\n*   [`wooorm/un-m49`](https://github.com/wooorm/un-m49)\n    — UN M49 codes\n\n## Contribute\n\nYes please!\nSee [How to Contribute to Open Source][contribute].\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/wooorm/bcp-47-match/workflows/main/badge.svg\n\n[build]: https://github.com/wooorm/bcp-47-match/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/bcp-47-match.svg\n\n[coverage]: https://codecov.io/github/wooorm/bcp-47-match\n\n[downloads-badge]: https://img.shields.io/npm/dm/bcp-47-match.svg\n\n[downloads]: https://www.npmjs.com/package/bcp-47-match\n\n[size-badge]: https://img.shields.io/bundlephobia/minzip/bcp-47-match.svg\n\n[size]: https://bundlephobia.com/result?p=bcp-47-match\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esmsh]: https://esm.sh\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[typescript]: https://www.typescriptlang.org\n\n[contribute]: https://opensource.guide/how-to-contribute/\n\n[spec]: https://tools.ietf.org/html/bcp47\n\n[match]: https://tools.ietf.org/html/rfc4647\n\n[basic-range]: https://tools.ietf.org/html/rfc4647#section-2.1\n\n[extended-range]: https://tools.ietf.org/html/rfc4647#section-2.2\n","_attachments":{},"homepage":"https://github.com/wooorm/bcp-47-match#readme","bugs":{"url":"https://github.com/wooorm/bcp-47-match/issues"},"license":"MIT"}