mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-02-04 14:00:49 +00:00
nhj
more
This commit is contained in:
15
unified-ai-platform/node_modules/promise-retry/.editorconfig
generated
vendored
Normal file
15
unified-ai-platform/node_modules/promise-retry/.editorconfig
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[package.json]
|
||||
indent_size = 2
|
||||
64
unified-ai-platform/node_modules/promise-retry/.jshintrc
generated
vendored
Normal file
64
unified-ai-platform/node_modules/promise-retry/.jshintrc
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"predef": [
|
||||
"console",
|
||||
"require",
|
||||
"define",
|
||||
"describe",
|
||||
"it",
|
||||
"before",
|
||||
"beforeEach",
|
||||
"after",
|
||||
"afterEach",
|
||||
"Promise"
|
||||
],
|
||||
|
||||
"node": true,
|
||||
"devel": true,
|
||||
|
||||
"bitwise": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"forin": false,
|
||||
"immed": true,
|
||||
"latedef": false,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": false,
|
||||
"nonew": true,
|
||||
"plusplus": false,
|
||||
"regexp": true,
|
||||
"undef": true,
|
||||
"unused": true,
|
||||
"quotmark": "single",
|
||||
"strict": true,
|
||||
"trailing": true,
|
||||
|
||||
"asi": false,
|
||||
"boss": false,
|
||||
"debug": false,
|
||||
"eqnull": true,
|
||||
"es5": false,
|
||||
"esnext": false,
|
||||
"evil": false,
|
||||
"expr": true,
|
||||
"funcscope": false,
|
||||
"globalstrict": false,
|
||||
"iterator": false,
|
||||
"lastsemic": false,
|
||||
"laxbreak": false,
|
||||
"laxcomma": false,
|
||||
"loopfunc": true,
|
||||
"multistr": false,
|
||||
"onecase": true,
|
||||
"regexdash": false,
|
||||
"scripturl": false,
|
||||
"smarttabs": false,
|
||||
"shadow": false,
|
||||
"sub": false,
|
||||
"supernew": false,
|
||||
"validthis": false,
|
||||
|
||||
"nomen": false,
|
||||
"onevar": false,
|
||||
"white": true
|
||||
}
|
||||
19
unified-ai-platform/node_modules/promise-retry/LICENSE
generated
vendored
Normal file
19
unified-ai-platform/node_modules/promise-retry/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2014 IndigoUnited
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
52
unified-ai-platform/node_modules/promise-retry/index.js
generated
vendored
Normal file
52
unified-ai-platform/node_modules/promise-retry/index.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
var errcode = require('err-code');
|
||||
var retry = require('retry');
|
||||
|
||||
var hasOwn = Object.prototype.hasOwnProperty;
|
||||
|
||||
function isRetryError(err) {
|
||||
return err && err.code === 'EPROMISERETRY' && hasOwn.call(err, 'retried');
|
||||
}
|
||||
|
||||
function promiseRetry(fn, options) {
|
||||
var temp;
|
||||
var operation;
|
||||
|
||||
if (typeof fn === 'object' && typeof options === 'function') {
|
||||
// Swap options and fn when using alternate signature (options, fn)
|
||||
temp = options;
|
||||
options = fn;
|
||||
fn = temp;
|
||||
}
|
||||
|
||||
operation = retry.operation(options);
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
operation.attempt(function (number) {
|
||||
Promise.resolve()
|
||||
.then(function () {
|
||||
return fn(function (err) {
|
||||
if (isRetryError(err)) {
|
||||
err = err.retried;
|
||||
}
|
||||
|
||||
throw errcode(new Error('Retrying'), 'EPROMISERETRY', { retried: err });
|
||||
}, number);
|
||||
})
|
||||
.then(resolve, function (err) {
|
||||
if (isRetryError(err)) {
|
||||
err = err.retried;
|
||||
|
||||
if (operation.retry(err || new Error())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = promiseRetry;
|
||||
Reference in New Issue
Block a user