1 | /*
|
2 | * Copyright (c) 2014, Yahoo Inc. All rights reserved.
|
3 | * Copyrights licensed under the New BSD License.
|
4 | * See the accompanying LICENSE file for terms.
|
5 | */
|
6 |
|
7 | ;
|
8 |
|
9 | exports.assign = Object.assign || require("object.assign");
|
10 | exports.passError = passError;
|
11 | exports.passValue = passValue;
|
12 |
|
13 | // -----------------------------------------------------------------------------
|
14 |
|
15 | function passError (callback) {
|
16 | return function (reason) {
|
17 | setImmediate(function () {
|
18 | callback(reason);
|
19 | });
|
20 | };
|
21 | }
|
22 |
|
23 | function passValue (callback) {
|
24 | return function (value) {
|
25 | setImmediate(function () {
|
26 | callback(null, value);
|
27 | });
|
28 | };
|
29 | }
|