Skip to content

Commit

Permalink
Version 1.1.0 - Dependency Updates August 2022 (#7)
Browse files Browse the repository at this point in the history
* August 2022 dependency updates, Joi 16.x + 17.x testing added, Migrated peer dependency to joi from @hapi/joi

* Version bump to 1.1.0
  • Loading branch information
tjdavey authored Sep 6, 2022
1 parent a26efa0 commit 5a8b287
Show file tree
Hide file tree
Showing 7 changed files with 7,766 additions and 796 deletions.
3 changes: 3 additions & 0 deletions .tav.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
joi:
versions: ">=16.1.8"
commands: NODE_ENV=test mocha --recursive
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
arch: amd64
os: linux
dist: focal
language: node_js
script:
- npm test
- npm run cov:tests && npm run cov:coveralls
node_js:
- "8"
- "10"
- "12"
- "14"
- "16"
- "18"
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# joi-bcp47
# joi-bcp47 - Joi BCP47 IETF Language Tag Validation

[![Build Status](https://travis-ci.org/tjdavey/joi-bcp47.svg?branch=master)](https://travis-ci.org/tjdavey/joi-bcp47)
[![Build Status](https://travis-ci.com/tjdavey/joi-bcp47.svg?branch=master)](https://travis-ci.com/tjdavey/joi-bcp47)
[![Coverage Status](https://coveralls.io/repos/github/tjdavey/joi-bcp47/badge.svg)](https://coveralls.io/github/tjdavey/joi-bcp47)
[![Known Vulnerabilities](https://snyk.io/test/github/tjdavey/joi-bcp47/badge.svg?targetFile=package.json)](https://snyk.io/test/github/tjdavey/joi-bcp47?targetFile=package.json)
[![npm version](https://badge.fury.io/js/joi-bcp47.svg)](https://badge.fury.io/js/joi-bcp47)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftjdavey%2Fjoi-bcp47.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftjdavey%2Fjoi-bcp47?ref=badge_shield)

Provides a Joi rule to validate and parse BCP47 language tags (eg. `en-US`, `ur-PK`, `zh-Hant-TW`).
Provides a Joi rule to validate and parse BCP47 language tags (eg. `en-US`, `ur-PK`, `zh-Hant-TW`).

Note: Only supports Joi 16.x or higher. Does not validate the components of the BCP47 tag (eg. language or region codes)
Note: Only supports Joi 16.x or higher. Does not validate the components of the BCP47 tag (eg. language or region codes), only the structure and syntax.

## Installation:

Expand Down Expand Up @@ -61,6 +61,15 @@ Joi.bcp47().parse().validate('hy-Latn-IT-arevela');
*/
```

## Compatibility

This library is tested for compatibility, and contains peer dependencies with the following versions.

| Version | @hapi/joi 16.x | joi 16.x | joi 17.x |
|-------------------------------------------------------------------|----------------|----------|----------|
| [1.1.0](https://github.com/tjdavey/joi-bcp47/releases/tag/v1.1.0) | |||
| [1.0.0](https://github.com/tjdavey/joi-bcp47/releases/tag/v1.0.0) || | |


## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftjdavey%2Fjoi-bcp47.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftjdavey%2Fjoi-bcp47?ref=badge_large)
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const Joi = require('@hapi/joi');
const Joi = require('joi');
const bcp47 = require('bcp47');

module.exports = {
type: 'bcp47',
base: Joi.string(),
messages: {
invalidSyntax: '"{{#label}}" must be a valid BCP47 language tag'
invalidSyntax: '{{#label}} must be a valid BCP47 language tag'
},
rules: {
parse: {
Expand Down
Loading

0 comments on commit 5a8b287

Please sign in to comment.