Skip to content

Commit

Permalink
chore: revert 17.8.x line
Browse files Browse the repository at this point in the history
  • Loading branch information
Marsup committed Feb 21, 2023
1 parent 04751f1 commit 09cbaaa
Show file tree
Hide file tree
Showing 38 changed files with 96 additions and 175 deletions.
2 changes: 0 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2727,7 +2727,6 @@ Requires the string value to be a valid domain name.
- `options` - optional settings:
- `allowFullyQualified` - if `true`, domains ending with a `.` character are permitted. Defaults to `false`.
- `allowUnicode` - if `true`, Unicode characters are permitted. Defaults to `true`.
- `allowUnderscore` - if `true`, underscores (`_`) are allowed in the domain name. Defaults to `false`.
- `minDomainSegments` - number of segments required for the domain. Defaults to `2`.
- `maxDomainSegments` - maximum number of allowed domain segments. Default to no limit.
- `tlds` - options for TLD (top level domain) validation. By default, the TLD must be a valid
Expand Down Expand Up @@ -2755,7 +2754,6 @@ Requires the string value to be a valid email address.
- `options` - optional settings:
- `allowFullyQualified` - if `true`, domains ending with a `.` character are permitted. Defaults to `false`.
- `allowUnicode` - if `true`, Unicode characters are permitted. Defaults to `true`.
- `allowUnderscore` - if `true`, underscores (`_`) are allowed in the domain name. Defaults to `false`.
- `ignoreLength` - if `true`, ignore invalid email length errors. Defaults to `false`.
- `minDomainSegments` - number of segments required for the domain. The default setting excludes
single segment domains such as `example@io` which is a valid email but very uncommon. Defaults
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const Fs = require('fs');

const Assert = require('@hapi/hoek/assert');
const Assert = require('@hapi/hoek/lib/assert');
const Benchmark = require('benchmark');
const Bossy = require('@hapi/bossy');
const Chalk = require('chalk');
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"full-bench": "npm run bench-update -- --joi @hapi/joi && npm test"
},
"dependencies": {
"@hapi/bossy": "^6.0.1",
"@hapi/hoek": "^11.0.2",
"@hapi/bossy": "^4.0.3",
"@hapi/hoek": "^6.2.4",
"@hapi/joi": "^15.1.0",
"benchmark": "^2.1.4",
"chalk": "^2.4.1",
"cli-table": "^0.3.11",
"cli-table": "^0.3.1",
"d3-format": "^1.3.2",
"joi": "^17.8.1"
"joi": "^17.6.4"
}
}
15 changes: 7 additions & 8 deletions browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@
"test": "karma start"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.20.2",
"@mixer/webpack-bundle-compare": "^0.1.1",
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/preset-env": "^7.4.5",
"assert": "^2.0.0",
"babel-loader": "^9.1.2",
"babel-loader": "^8.0.6",
"karma": "^4.2.0",
"karma-chrome-launcher": "^3.0.0",
"karma-mocha": "^1.3.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^5.0.0",
"mocha": "^6.2.0",
"mocha-loader": "^2.0.1",
"util": "^0.12.5",
"webpack": "^5.75.0",
"util": "^0.12.4",
"webpack": "^5.40.0",
"webpack-bundle-analyzer": "^3.4.1",
"webpack-cli": "^4.10.0"
"webpack-cli": "^4.7.2"
}
}
25 changes: 1 addition & 24 deletions browser/tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ describe('Joi', () => {

it('should be able to create schemas', () => {

Joi.boolean().truthy('true');
Joi.number().min(5).max(10).multiple(2);
Joi.array().items(Joi.number().required());
Joi.object({
key: Joi.string().required()
});
Joi.string().min(5);
});

it('should be able to validate data', () => {
Expand All @@ -34,23 +29,5 @@ describe('Joi', () => {
Assert.ok(!schema.validate('test@example.com').error);
Assert.ok(schema.validate('test@example.com ').error);
Assert.ok(!schema.validate('伊昭傑@郵件.商務').error);

const schema2 = Joi.string().email({ tlds: { allow: false } }).required();
Assert.ok(!schema2.validate('test@example.com').error);
Assert.ok(schema2.validate('test@example.com ').error);
Assert.ok(!schema2.validate('伊昭傑@郵件.商務').error);
});

it('validates domain', () => {

const schema = Joi.string().domain().required();
Assert.ok(!schema.validate('example.com').error);
Assert.ok(schema.validate('example.com ').error);
Assert.ok(!schema.validate('example.商務').error);

const schema2 = Joi.string().domain({ tlds: { allow: false } }).required();
Assert.ok(!schema2.validate('example.com').error);
Assert.ok(schema2.validate('example.com ').error);
Assert.ok(!schema2.validate('example.商務').error);
});
});
17 changes: 2 additions & 15 deletions browser/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const Path = require('path');

const Webpack = require('webpack');
const { BundleComparisonPlugin } = require('@mixer/webpack-bundle-compare');


module.exports = {
Expand All @@ -17,11 +16,6 @@ module.exports = {
plugins: [
new Webpack.DefinePlugin({
Buffer: false
}),
new BundleComparisonPlugin({
file: '../stats.msp.gz',
format: 'msgpack',
gzip: true,
})
],
module: {
Expand All @@ -46,16 +40,10 @@ module.exports = {
]
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-class-properties'
]
}
}
},
{
test: /@(hapi|sideway)\//,
sideEffects: false
}
]
},
Expand All @@ -66,8 +54,7 @@ module.exports = {
[Path.join(__dirname, '../lib/manifest.js')]: false,
[Path.join(__dirname, '../lib/trace.js')]: false,
[Path.join(__dirname, '../lib/types/binary.js')]: false,
[Path.join(__dirname, '../node_modules/@hapi/tlds/esm/index.js')]: false,
[Path.join(__dirname, '../node_modules/@hapi/address/esm/decode.js')]: false,
[Path.join(__dirname, '../node_modules/@sideway/address/lib/tlds.js')]: false,
},
fallback: {
url: false,
Expand Down
2 changes: 1 addition & 1 deletion lib/annotate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Clone = require('@hapi/hoek/clone');
const Clone = require('@hapi/hoek/lib/clone');

const Common = require('./common');

Expand Down
8 changes: 4 additions & 4 deletions lib/base.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Clone = require('@hapi/hoek/clone');
const DeepEqual = require('@hapi/hoek/deepEqual');
const Merge = require('@hapi/hoek/merge');
const Assert = require('@hapi/hoek/lib/assert');
const Clone = require('@hapi/hoek/lib/clone');
const DeepEqual = require('@hapi/hoek/lib/deepEqual');
const Merge = require('@hapi/hoek/lib/merge');

const Cache = require('./cache');
const Common = require('./common');
Expand Down
4 changes: 2 additions & 2 deletions lib/cache.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Clone = require('@hapi/hoek/clone');
const Assert = require('@hapi/hoek/lib/assert');
const Clone = require('@hapi/hoek/lib/clone');

const Common = require('./common');

Expand Down
4 changes: 2 additions & 2 deletions lib/common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const AssertError = require('@hapi/hoek/assertError');
const Assert = require('@hapi/hoek/lib/assert');
const AssertError = require('@hapi/hoek/lib/error');

const Pkg = require('../package.json');

Expand Down
2 changes: 1 addition & 1 deletion lib/compile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Assert = require('@hapi/hoek/lib/assert');

const Common = require('./common');
const Ref = require('./ref');
Expand Down
4 changes: 2 additions & 2 deletions lib/extend.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Clone = require('@hapi/hoek/clone');
const Assert = require('@hapi/hoek/lib/assert');
const Clone = require('@hapi/hoek/lib/clone');

const Common = require('./common');
const Messages = require('./messages');
Expand Down
13 changes: 1 addition & 12 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,6 @@ declare namespace Joi {
* @default true
*/
allowUnicode?: boolean;
/**
* If `true`, underscores (`_`) are allowed in the domain name
*
* @default false
*/
allowUnderscore?: boolean;
/**
* if `true`, ignore invalid email length errors.
*
Expand Down Expand Up @@ -347,12 +341,7 @@ declare namespace Joi {
* @default true
*/
allowUnicode?: boolean;
/**
* If `true`, underscores (`_`) are allowed in the domain name
*
* @default false
*/
allowUnderscore?: boolean;

/**
* Options for TLD (top level domain) validation. By default, the TLD must be a valid name listed on the [IANA registry](http://data.iana.org/TLD/tlds-alpha-by-domain.txt)
*
Expand Down
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Clone = require('@hapi/hoek/clone');
const Assert = require('@hapi/hoek/lib/assert');
const Clone = require('@hapi/hoek/lib/clone');

const Cache = require('./cache');
const Common = require('./common');
Expand Down
4 changes: 2 additions & 2 deletions lib/manifest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Clone = require('@hapi/hoek/clone');
const Assert = require('@hapi/hoek/lib/assert');
const Clone = require('@hapi/hoek/lib/clone');

const Common = require('./common');
const Messages = require('./messages');
Expand Down
4 changes: 2 additions & 2 deletions lib/messages.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Clone = require('@hapi/hoek/clone');
const Assert = require('@hapi/hoek/lib/assert');
const Clone = require('@hapi/hoek/lib/clone');

const Template = require('./template');

Expand Down
2 changes: 1 addition & 1 deletion lib/modify.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Assert = require('@hapi/hoek/lib/assert');

const Common = require('./common');
const Ref = require('./ref');
Expand Down
6 changes: 3 additions & 3 deletions lib/ref.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Clone = require('@hapi/hoek/clone');
const Reach = require('@hapi/hoek/reach');
const Assert = require('@hapi/hoek/lib/assert');
const Clone = require('@hapi/hoek/lib/clone');
const Reach = require('@hapi/hoek/lib/reach');

const Common = require('./common');

Expand Down
4 changes: 2 additions & 2 deletions lib/state.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const Clone = require('@hapi/hoek/clone');
const Reach = require('@hapi/hoek/reach');
const Clone = require('@hapi/hoek/lib/clone');
const Reach = require('@hapi/hoek/lib/reach');

const Common = require('./common');

Expand Down
8 changes: 4 additions & 4 deletions lib/template.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Clone = require('@hapi/hoek/clone');
const EscapeHtml = require('@hapi/hoek/escapeHtml');
const Formula = require('@hapi/formula');
const Assert = require('@hapi/hoek/lib/assert');
const Clone = require('@hapi/hoek/lib/clone');
const EscapeHtml = require('@hapi/hoek/lib/escapeHtml');
const Formula = require('@sideway/formula');

const Common = require('./common');
const Errors = require('./errors');
Expand Down
4 changes: 2 additions & 2 deletions lib/trace.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const DeepEqual = require('@hapi/hoek/deepEqual');
const Pinpoint = require('@hapi/pinpoint');
const DeepEqual = require('@hapi/hoek/lib/deepEqual');
const Pinpoint = require('@sideway/pinpoint');

const Errors = require('./errors');

Expand Down
4 changes: 2 additions & 2 deletions lib/types/alternatives.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Merge = require('@hapi/hoek/merge');
const Assert = require('@hapi/hoek/lib/assert');
const Merge = require('@hapi/hoek/lib/merge');

const Any = require('./any');
const Common = require('../common');
Expand Down
2 changes: 1 addition & 1 deletion lib/types/any.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Assert = require('@hapi/hoek/lib/assert');

const Base = require('../base');
const Common = require('../common');
Expand Down
6 changes: 3 additions & 3 deletions lib/types/array.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const DeepEqual = require('@hapi/hoek/deepEqual');
const Reach = require('@hapi/hoek/reach');
const Assert = require('@hapi/hoek/lib/assert');
const DeepEqual = require('@hapi/hoek/lib/deepEqual');
const Reach = require('@hapi/hoek/lib/reach');

const Any = require('./any');
const Common = require('../common');
Expand Down
2 changes: 1 addition & 1 deletion lib/types/binary.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Assert = require('@hapi/hoek/lib/assert');

const Any = require('./any');
const Common = require('../common');
Expand Down
2 changes: 1 addition & 1 deletion lib/types/boolean.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Assert = require('@hapi/hoek/lib/assert');

const Any = require('./any');
const Common = require('../common');
Expand Down
2 changes: 1 addition & 1 deletion lib/types/date.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Assert = require('@hapi/hoek/lib/assert');

const Any = require('./any');
const Common = require('../common');
Expand Down
2 changes: 1 addition & 1 deletion lib/types/function.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Assert = require('@hapi/hoek/assert');
const Assert = require('@hapi/hoek/lib/assert');

const Keys = require('./keys');

Expand Down

0 comments on commit 09cbaaa

Please sign in to comment.