'use strict';

const hapiPlugin = module.exports.hapiPlugin = function (decorateName) {
    const configue = this;
    /**
     * Register the <tt>Configue</tt> plugin and process the various steps and hooks
     * @param server - Hapi server to configure
     * @param options - options of the Configue Plugin
     * @param next - plugin continuation
     */
    const plugin = function plugin(server, options, next) {

        if (!configue.resolved) {
            try {
                configue.resolve();
            } catch (err) {
                return next(err);
            }
        }
        server.log(['plugin', 'info'], 'Registering the configue has decoration');
        const configGetter = configue.get.bind(configue);
        configGetter.get = configGetter;
        configGetter.getFirst  = configue.getFirst.bind(configue);
        configGetter.getAll  = configue.getAll.bind(configue);

        server.decorate('server', decorateName || 'configue', configGetter);
        server.decorate('request', decorateName || 'configue', configGetter);
        next();
    };
    plugin.attributes = hapiPlugin.attributes;
    return plugin;
};

hapiPlugin.attributes = {
    pkg: require('../package.json')
};

module.exports = {hapiPlugin};

@@ -8,16 +8,522 @@
 rict';%0A%0A
+function makeConfigGetter(configue) %7B%0A    const configGetter = configue.get.bind(configue);%0A    configGetter.get = configGetter;%0A    configGetter.getFirst  = configue.getFirst.bind(configue);%0A    configGetter.getAll  = configue.getAll.bind(configue);%0A    configGetter.getObject  = configue.getObject.bind(configue);%0A    configGetter.load  = configue.load.bind(configue);%0A    configGetter.template  = configue.template.bind(configue);%0A    configGetter.t = configGetter.template;%0A    return configGetter;%0A%7D%0A%0A
 const ha
@@ -1159,17 +1159,17 @@
 onfigue 
-h
+a
 as decor
@@ -1210,196 +1210,24 @@
 r = 
-configue.get.bind(configue);%0A        configGetter.get = configGetter;%0A        configGetter.getFirst  = configue.getFirst.bind(configue);%0A        configGetter.getAll  = configue.getAll.bind
+makeConfigGetter
 (con
@@ -1234,17 +1234,16 @@
 figue);%0A
-%0A
         
@@ -1381,32 +1381,33 @@
  configGetter);%0A
+%0A
         next();%0A

introduce a makeConfigGetter with new methods to create extension for hapi and express