initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
34
github/codeql-action-v2/node_modules/twirp-ts/build/twirp/interceptors.js
generated
vendored
Normal file
34
github/codeql-action-v2/node_modules/twirp-ts/build/twirp/interceptors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.chainInterceptors = void 0;
|
||||
// chains multiple Interceptors into a single Interceptor.
|
||||
// The first interceptor wraps the second one, and so on.
|
||||
// Returns null if interceptors is empty.
|
||||
function chainInterceptors(...interceptors) {
|
||||
if (interceptors.length === 0) {
|
||||
return;
|
||||
}
|
||||
if (interceptors.length === 1) {
|
||||
return interceptors[0];
|
||||
}
|
||||
const first = interceptors[0];
|
||||
return (ctx, request, handler) => __awaiter(this, void 0, void 0, function* () {
|
||||
let next = handler;
|
||||
for (let i = interceptors.length - 1; i > 0; i--) {
|
||||
next = ((next) => (ctx, typedRequest) => {
|
||||
return interceptors[i](ctx, typedRequest, next);
|
||||
})(next);
|
||||
}
|
||||
return first(ctx, request, next);
|
||||
});
|
||||
}
|
||||
exports.chainInterceptors = chainInterceptors;
|
||||
Loading…
Add table
Add a link
Reference in a new issue