UNPKG

hydrate-mongodb

Version:
20 lines (19 loc) 451 B
"use strict"; /*! * async * https://github.com/caolan/async * * Copyright 2010-2014 Caolan McMahon * Released under the MIT license */ Object.defineProperty(exports, "__esModule", { value: true }); function onlyOnce(callback) { var called = false; return function (err) { if (called) throw new Error("Callback was already called."); called = true; callback(err); }; } exports.onlyOnce = onlyOnce;