fischbacher
Advanced tools
Comparing version 2.0.3 to 3.0.0
# Changelog | ||
## [v3.0.0](https://github.com/ruiquelhas/fischbacher/tree/v3.0.0) (2017-11-12) | ||
[Full Changelog](https://github.com/ruiquelhas/fischbacher/compare/v2.0.3...v3.0.0) | ||
**Merged pull requests:** | ||
- Add support for hapi v17 [\#12](https://github.com/ruiquelhas/fischbacher/pull/12) ([ruiquelhas](https://github.com/ruiquelhas)) | ||
## [v2.0.3](https://github.com/ruiquelhas/fischbacher/tree/v2.0.3) (2017-02-21) | ||
@@ -4,0 +11,0 @@ [Full Changelog](https://github.com/ruiquelhas/fischbacher/compare/v2.0.2...v2.0.3) |
@@ -6,6 +6,8 @@ 'use strict'; | ||
exports.register = function (server, options, next) { | ||
const internals = {}; | ||
const plugin = { | ||
register: Supervizor, | ||
internals.register = async function (server, options) { | ||
return await server.register({ | ||
plugin: Supervizor, | ||
options: { | ||
@@ -15,9 +17,8 @@ validator: Lafayette.validate, | ||
} | ||
}; | ||
server.register(plugin, next); | ||
}); | ||
}; | ||
exports.register.attributes = { | ||
pkg: require('../package.json') | ||
module.exports = { | ||
pkg: require('../package.json'), | ||
register: internals.register | ||
}; |
{ | ||
"name": "fischbacher", | ||
"version": "2.0.3", | ||
"version": "3.0.0", | ||
"description": "Server-level lafayette validation for hapi", | ||
@@ -37,15 +37,15 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"code": "4.x.x", | ||
"coveralls": "2.x.x", | ||
"hapi": "16.x.x", | ||
"lab": "12.x.x", | ||
"code": "5.x.x", | ||
"coveralls": "3.x.x", | ||
"hapi": "17.x.x", | ||
"lab": "15.x.x", | ||
"multi-part": "2.x.x" | ||
}, | ||
"dependencies": { | ||
"lafayette": "2.x.x", | ||
"supervizor": "1.x.x" | ||
"lafayette": "4.x.x", | ||
"supervizor": "2.x.x" | ||
}, | ||
"engines": { | ||
"node": ">=4.5.0" | ||
"node": ">=8.9.0" | ||
} | ||
} |
@@ -30,19 +30,7 @@ # fischbacher | ||
const server = new Hapi.Server(); | ||
server.connection({ | ||
// go nuts | ||
}); | ||
try { | ||
const server = new Hapi.Server(); | ||
const plugin = { | ||
register: Fischbacher, | ||
options: { | ||
// Allow png files only | ||
whitelist: ['image/png'] | ||
} | ||
}; | ||
server.register(plugin, (err) => { | ||
server.route({ | ||
config: { | ||
options: { | ||
payload: { | ||
@@ -56,10 +44,19 @@ output: 'file', | ||
server.start(() => { | ||
// go nuts | ||
await server.register({ | ||
plugin: Fischbacher, | ||
options: { | ||
// Allow png files only | ||
whitelist: ['image/png'] | ||
} | ||
}); | ||
}); | ||
await server.start(); | ||
} | ||
catch (err) { | ||
throw err; | ||
} | ||
``` | ||
## Supported File Types | ||
The same as [file-type](https://github.com/sindresorhus/file-type#supported-file-types). | ||
The same as [file-type](https://github.com/sindresorhus/file-type/tree/v7.0.0#supported-file-types). | ||
@@ -66,0 +63,0 @@ [coveralls-img]: https://img.shields.io/coveralls/ruiquelhas/fischbacher.svg?style=flat-square |
8439
17
71
+ Addedboom@7.3.0(transitive)
+ Addedfile-type@7.7.1(transitive)
+ Addedhoek@5.0.46.1.3(transitive)
+ Addedhoudin@5.0.2(transitive)
+ Addedlafayette@4.0.1(transitive)
+ Addedsupervizor@2.1.0(transitive)
+ Addedthurston@4.0.0(transitive)
- Removedboom@5.3.3(transitive)
- Removedfile-type@4.4.0(transitive)
- Removedhoek@4.3.1(transitive)
- Removedhoudin@2.0.10(transitive)
- Removeditems@2.2.1(transitive)
- Removedlafayette@2.0.4(transitive)
- Removedsupervizor@1.0.6(transitive)
- Removedthurston@2.0.6(transitive)
Updatedlafayette@4.x.x
Updatedsupervizor@2.x.x