exiftool-vendored
Version:
Efficient, cross-platform access to ExifTool
25 lines • 628 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.lazy = lazy;
const ErrorsAndWarnings_1 = require("./ErrorsAndWarnings");
function lazy(thunk) {
let invoked = false;
let result;
let error;
return () => {
if (!invoked) {
try {
invoked = true;
result = thunk();
}
catch (e) {
error = (0, ErrorsAndWarnings_1.toError)(e);
throw e;
}
}
if (error != null)
throw error;
return result;
};
}
//# sourceMappingURL=Lazy.js.map
;