Skip to content

Commit

Permalink
Bump joi to 17.x + Bump lab, code (#75)
Browse files Browse the repository at this point in the history
* Bump joi to 17.x + Bump lab, code

* Add a test with path true but no nesting

* Add a github workflow
  • Loading branch information
chiragjn authored Jul 20, 2024
1 parent 694527d commit 7758778
Show file tree
Hide file tree
Showing 7 changed files with 1,798 additions and 1,164 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "eslint-config-hapi"
"extends": "plugin:@hapi/module"
}
28 changes: 28 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test with coverage

on:
push:
branches:
- master
pull_request:
branches:
- master

defaults:
run:
# GitHub Actions run without a TTY device. This is a workaround to get one,
# based on https://github.com/actions/runner/issues/241#issuecomment-2019042651
shell: 'script --return --quiet --log-out /dev/null --command "bash -e {0}"'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- run: npm ci
- run: FORCE_COLOR=1 npm test
4 changes: 2 additions & 2 deletions bin/purdy.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ internals.initalizeBossy = function () {



internals.parseStream = function (stream){
internals.parseStream = function (stream) {

let buf = '';
stream.setEncoding('utf8');
Expand All @@ -95,7 +95,7 @@ internals.parseStream = function (stream){
};


internals.logparse = function (stream){
internals.logparse = function (stream) {

stream.setEncoding('utf8');

Expand Down
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ const internals = {
path: 'blue',
json: 'green'
},
defaults: {
defaults: Joi.object({
depth: Joi.number().min(0).allow(null).default(2),
plain: Joi.boolean().default(false),
json: Joi.boolean().default(false),
path: Joi.boolean().default(false),
proto: Joi.boolean().default(false).description('include the prototype chain and print all inherited properties'),
indent: Joi.number().default(4),
align: Joi.string().valid(['left', 'right']).default('left'),
align: Joi.string().valid('left', 'right').default('left'),
arrayIndex: Joi.boolean().default(true),
pathPrefix: Joi.string().default('// ')
}
})
};

internals.purdy = function (options) {
Expand Down
Loading

0 comments on commit 7758778

Please sign in to comment.