1
0
forked from dyf/APP

增加mqtt

This commit is contained in:
微微一笑
2025-07-16 11:16:19 +08:00
parent e42d4af3b2
commit 6257f9d84b
1550 changed files with 5264 additions and 116701 deletions

View File

@ -1,15 +0,0 @@
"use strict";
var ensurePlainFunction = require("../../object/ensure-plain-function")
, ensureThenable = require("../../object/ensure-thenable")
, microtaskDelay = require("../../function/#/microtask-delay");
module.exports = function (callback) {
ensureThenable(this);
ensurePlainFunction(callback);
// Rely on microtaskDelay to escape eventual error swallowing
this.then(
microtaskDelay.call(function (value) { callback(null, value); }),
microtaskDelay.call(function (reason) { callback(reason); })
);
};

View File

@ -1,10 +0,0 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Promise.prototype, "finally", {
value: require("./shim"),
configurable: true,
enumerable: false,
writable: true
});
}

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = require("./is-implemented")() ? Promise.prototype.finally : require("./shim");

View File

@ -1,7 +0,0 @@
"use strict";
module.exports = function () {
if (typeof Promise !== "function") return false;
if (typeof Promise.prototype.finally !== "function") return false;
return true;
};

View File

@ -1,24 +0,0 @@
"use strict";
var ensurePlainFunction = require("../../../object/ensure-plain-function")
, isThenable = require("../../../object/is-thenable")
, ensureThenable = require("../../../object/ensure-thenable");
var resolveCallback = function (callback, next) {
var callbackResult = callback();
if (!isThenable(callbackResult)) return next();
return callbackResult.then(next);
};
module.exports = function (callback) {
ensureThenable(this);
ensurePlainFunction(callback);
return this.then(
function (result) {
return resolveCallback(callback, function () { return result; });
},
function (error) {
return resolveCallback(callback, function () { throw error; });
}
);
};

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = { asCallback: require("./as-callback"), finally: require("./finally") };

View File

@ -1 +0,0 @@
{ "globals": { "Promise": true } }

View File

@ -1,3 +0,0 @@
"use strict";
module.exports = { "#": require("./#"), "lazy": require("./lazy") };

35
node_modules/es5-ext/promise/lazy.js generated vendored
View File

@ -1,35 +0,0 @@
"use strict";
var isFunction = require("../function/is-function");
module.exports = function (executor) {
var Constructor;
if (isFunction(this)) {
Constructor = this;
} else if (typeof Promise === "function") {
Constructor = Promise;
} else {
throw new TypeError("Could not resolve Promise constuctor");
}
var lazyThen;
var promise = new Constructor(function (resolve, reject) {
lazyThen = function (onSuccess, onFailure) {
if (!hasOwnProperty.call(this, "then")) {
// Sanity check
throw new Error("Unexpected (inherited) lazy then invocation");
}
try { executor(resolve, reject); }
catch (reason) { reject(reason); }
delete this.then;
return this.then(onSuccess, onFailure);
};
});
return Object.defineProperty(promise, "then", {
configurable: true,
writable: true,
value: lazyThen
});
};