Skip to content

Commit ade2748

Browse files
authored
Merge pull request #2919 from hapijs/chore/revert-17.8
chore: revert 17.8.x line
2 parents 04751f1 + 09cbaaa commit ade2748

38 files changed

Lines changed: 96 additions & 175 deletions

API.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,7 +2727,6 @@ Requires the string value to be a valid domain name.
27272727
- `options` - optional settings:
27282728
- `allowFullyQualified` - if `true`, domains ending with a `.` character are permitted. Defaults to `false`.
27292729
- `allowUnicode` - if `true`, Unicode characters are permitted. Defaults to `true`.
2730-
- `allowUnderscore` - if `true`, underscores (`_`) are allowed in the domain name. Defaults to `false`.
27312730
- `minDomainSegments` - number of segments required for the domain. Defaults to `2`.
27322731
- `maxDomainSegments` - maximum number of allowed domain segments. Default to no limit.
27332732
- `tlds` - options for TLD (top level domain) validation. By default, the TLD must be a valid
@@ -2755,7 +2754,6 @@ Requires the string value to be a valid email address.
27552754
- `options` - optional settings:
27562755
- `allowFullyQualified` - if `true`, domains ending with a `.` character are permitted. Defaults to `false`.
27572756
- `allowUnicode` - if `true`, Unicode characters are permitted. Defaults to `true`.
2758-
- `allowUnderscore` - if `true`, underscores (`_`) are allowed in the domain name. Defaults to `false`.
27592757
- `ignoreLength` - if `true`, ignore invalid email length errors. Defaults to `false`.
27602758
- `minDomainSegments` - number of segments required for the domain. The default setting excludes
27612759
single segment domains such as `example@io` which is a valid email but very uncommon. Defaults

benchmarks/bench.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const Fs = require('fs');
44

5-
const Assert = require('@hapi/hoek/assert');
5+
const Assert = require('@hapi/hoek/lib/assert');
66
const Benchmark = require('benchmark');
77
const Bossy = require('@hapi/bossy');
88
const Chalk = require('chalk');

benchmarks/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"full-bench": "npm run bench-update -- --joi @hapi/joi && npm test"
88
},
99
"dependencies": {
10-
"@hapi/bossy": "^6.0.1",
11-
"@hapi/hoek": "^11.0.2",
10+
"@hapi/bossy": "^4.0.3",
11+
"@hapi/hoek": "^6.2.4",
1212
"@hapi/joi": "^15.1.0",
1313
"benchmark": "^2.1.4",
1414
"chalk": "^2.4.1",
15-
"cli-table": "^0.3.11",
15+
"cli-table": "^0.3.1",
1616
"d3-format": "^1.3.2",
17-
"joi": "^17.8.1"
17+
"joi": "^17.6.4"
1818
}
1919
}

browser/package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,21 @@
77
"test": "karma start"
88
},
99
"devDependencies": {
10-
"@babel/core": "^7.20.12",
11-
"@babel/plugin-proposal-class-properties": "^7.18.6",
12-
"@babel/preset-env": "^7.20.2",
13-
"@mixer/webpack-bundle-compare": "^0.1.1",
10+
"@babel/core": "^7.4.5",
11+
"@babel/plugin-proposal-class-properties": "^7.7.4",
12+
"@babel/preset-env": "^7.4.5",
1413
"assert": "^2.0.0",
15-
"babel-loader": "^9.1.2",
14+
"babel-loader": "^8.0.6",
1615
"karma": "^4.2.0",
1716
"karma-chrome-launcher": "^3.0.0",
1817
"karma-mocha": "^1.3.0",
1918
"karma-sourcemap-loader": "^0.3.7",
2019
"karma-webpack": "^5.0.0",
2120
"mocha": "^6.2.0",
2221
"mocha-loader": "^2.0.1",
23-
"util": "^0.12.5",
24-
"webpack": "^5.75.0",
22+
"util": "^0.12.4",
23+
"webpack": "^5.40.0",
2524
"webpack-bundle-analyzer": "^3.4.1",
26-
"webpack-cli": "^4.10.0"
25+
"webpack-cli": "^4.7.2"
2726
}
2827
}

browser/tests/index.js

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ describe('Joi', () => {
77

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

10-
Joi.boolean().truthy('true');
11-
Joi.number().min(5).max(10).multiple(2);
12-
Joi.array().items(Joi.number().required());
13-
Joi.object({
14-
key: Joi.string().required()
15-
});
10+
Joi.string().min(5);
1611
});
1712

1813
it('should be able to validate data', () => {
@@ -34,23 +29,5 @@ describe('Joi', () => {
3429
Assert.ok(!schema.validate('test@example.com').error);
3530
Assert.ok(schema.validate('test@example.com ').error);
3631
Assert.ok(!schema.validate('伊昭傑@郵件.商務').error);
37-
38-
const schema2 = Joi.string().email({ tlds: { allow: false } }).required();
39-
Assert.ok(!schema2.validate('test@example.com').error);
40-
Assert.ok(schema2.validate('test@example.com ').error);
41-
Assert.ok(!schema2.validate('伊昭傑@郵件.商務').error);
42-
});
43-
44-
it('validates domain', () => {
45-
46-
const schema = Joi.string().domain().required();
47-
Assert.ok(!schema.validate('example.com').error);
48-
Assert.ok(schema.validate('example.com ').error);
49-
Assert.ok(!schema.validate('example.商務').error);
50-
51-
const schema2 = Joi.string().domain({ tlds: { allow: false } }).required();
52-
Assert.ok(!schema2.validate('example.com').error);
53-
Assert.ok(schema2.validate('example.com ').error);
54-
Assert.ok(!schema2.validate('example.商務').error);
5532
});
5633
});

browser/webpack.config.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
const Path = require('path');
44

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

87

98
module.exports = {
@@ -17,11 +16,6 @@ module.exports = {
1716
plugins: [
1817
new Webpack.DefinePlugin({
1918
Buffer: false
20-
}),
21-
new BundleComparisonPlugin({
22-
file: '../stats.msp.gz',
23-
format: 'msgpack',
24-
gzip: true,
2519
})
2620
],
2721
module: {
@@ -46,16 +40,10 @@ module.exports = {
4640
]
4741
],
4842
plugins: [
49-
'@babel/plugin-proposal-class-properties',
50-
'@babel/plugin-proposal-optional-chaining',
51-
'@babel/plugin-proposal-nullish-coalescing-operator',
43+
'@babel/plugin-proposal-class-properties'
5244
]
5345
}
5446
}
55-
},
56-
{
57-
test: /@(hapi|sideway)\//,
58-
sideEffects: false
5947
}
6048
]
6149
},
@@ -66,8 +54,7 @@ module.exports = {
6654
[Path.join(__dirname, '../lib/manifest.js')]: false,
6755
[Path.join(__dirname, '../lib/trace.js')]: false,
6856
[Path.join(__dirname, '../lib/types/binary.js')]: false,
69-
[Path.join(__dirname, '../node_modules/@hapi/tlds/esm/index.js')]: false,
70-
[Path.join(__dirname, '../node_modules/@hapi/address/esm/decode.js')]: false,
57+
[Path.join(__dirname, '../node_modules/@sideway/address/lib/tlds.js')]: false,
7158
},
7259
fallback: {
7360
url: false,

lib/annotate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const Clone = require('@hapi/hoek/clone');
3+
const Clone = require('@hapi/hoek/lib/clone');
44

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

lib/base.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
22

3-
const Assert = require('@hapi/hoek/assert');
4-
const Clone = require('@hapi/hoek/clone');
5-
const DeepEqual = require('@hapi/hoek/deepEqual');
6-
const Merge = require('@hapi/hoek/merge');
3+
const Assert = require('@hapi/hoek/lib/assert');
4+
const Clone = require('@hapi/hoek/lib/clone');
5+
const DeepEqual = require('@hapi/hoek/lib/deepEqual');
6+
const Merge = require('@hapi/hoek/lib/merge');
77

88
const Cache = require('./cache');
99
const Common = require('./common');

lib/cache.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

3-
const Assert = require('@hapi/hoek/assert');
4-
const Clone = require('@hapi/hoek/clone');
3+
const Assert = require('@hapi/hoek/lib/assert');
4+
const Clone = require('@hapi/hoek/lib/clone');
55

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

lib/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

3-
const Assert = require('@hapi/hoek/assert');
4-
const AssertError = require('@hapi/hoek/assertError');
3+
const Assert = require('@hapi/hoek/lib/assert');
4+
const AssertError = require('@hapi/hoek/lib/error');
55

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

0 commit comments

Comments
 (0)