aboutsummaryrefslogtreecommitdiff
path: root/node_modules/express-handlebars/lib/utils.js
blob: a16da39fdca07c9b7943b77d4bcd407844fe948c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (c) 2014, Yahoo Inc. All rights reserved.
 * Copyrights licensed under the New BSD License.
 * See the accompanying LICENSE file for terms.
 */

'use strict';

exports.assign    = Object.assign || require('object.assign');
exports.passError = passError;
exports.passValue = passValue;

// -----------------------------------------------------------------------------

function passError(callback) {
    return function (reason) {
        setImmediate(function () {
            callback(reason);
        });
    };
}

function passValue(callback) {
    return function (value) {
        setImmediate(function () {
            callback(null, value);
        });
    };
}