'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _argsarray = require('argsarray');
var _argsarray2 = _interopRequireDefault(_argsarray);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function once(fun) {
var called = false;
return (0, _argsarray2.default)(function (args) {
/* istanbul ignore if */
if (called) {
// this is a smoke test and should never actually happen
throw new Error('once called more than once');
} else {
called = true;
fun.apply(this, args);
}
});
}
exports.default = once;
module.exports = exports['default']; |