Upakovka v Electron.JS no po staroy sborke cherez .cjs

This commit is contained in:
Neyra
2026-02-10 19:19:41 +08:00
parent 8e9b7201ed
commit a1bba1d3d1
442 changed files with 19825 additions and 47462 deletions

15
node_modules/onetime/index.js generated vendored
View File

@@ -1,4 +1,5 @@
import mimicFunction from 'mimic-function';
'use strict';
const mimicFn = require('mimic-fn');
const calledFunctions = new WeakMap();
@@ -16,7 +17,7 @@ const onetime = (function_, options = {}) => {
if (callCount === 1) {
returnValue = function_.apply(this, arguments_);
function_ = undefined;
function_ = null;
} else if (options.throw === true) {
throw new Error(`Function \`${functionName}\` can only be called once`);
}
@@ -24,18 +25,20 @@ const onetime = (function_, options = {}) => {
return returnValue;
};
mimicFunction(onetime, function_);
mimicFn(onetime, function_);
calledFunctions.set(onetime, callCount);
return onetime;
};
onetime.callCount = function_ => {
module.exports = onetime;
// TODO: Remove this for the next major release
module.exports.default = onetime;
module.exports.callCount = function_ => {
if (!calledFunctions.has(function_)) {
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
}
return calledFunctions.get(function_);
};
export default onetime;