Socket
Socket
Sign inDemoInstall

danger

Package Overview
Dependencies
Maintainers
3
Versions
320
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

danger - npm Package Compare versions

Comparing version 12.3.1 to 12.3.2

8

distribution/api/fetch.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -36,3 +40,3 @@ if (k2 === undefined) k2 = k;

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -39,0 +43,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

/** A json object that represents the outer ENV */
export declare type Env = any;
export type Env = any;
/** The shape of an object that represents an individual CI */

@@ -4,0 +4,0 @@ export interface CISource {

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -36,3 +40,3 @@ if (k2 === undefined) k2 = k;

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -39,0 +43,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -36,3 +40,3 @@ if (k2 === undefined) k2 = k;

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -39,0 +43,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

import { SharedCLI } from "../utils/sharedDangerfileArgs";
import { RunnerConfig } from "./runner";
export declare const runRunner: (app: SharedCLI, config?: RunnerConfig | undefined) => Promise<void>;
export declare const runRunner: (app: SharedCLI, config?: RunnerConfig) => Promise<void>;

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -12,2 +12,2 @@ import { Platform } from "../../platforms/platform";

}
export declare const runRunner: (app: SharedCLI, config?: Partial<RunnerConfig> | undefined) => Promise<void>;
export declare const runRunner: (app: SharedCLI, config?: Partial<RunnerConfig>) => Promise<void>;

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -5,3 +5,7 @@ #! /usr/bin/env node

if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -38,3 +42,3 @@ if (k2 === undefined) k2 = k;

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -41,0 +45,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -29,3 +29,3 @@ #! /usr/bin/env node

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -32,0 +32,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -5,3 +5,7 @@ #! /usr/bin/env node

if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -8,0 +12,0 @@ if (k2 === undefined) k2 = k;

@@ -18,3 +18,3 @@ #! /usr/bin/env node

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -21,0 +21,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -15,3 +15,7 @@ "use strict";

if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -18,0 +22,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -36,3 +40,3 @@ if (k2 === undefined) k2 = k;

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -39,0 +43,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -1,13 +0,13 @@

export declare type Pattern = string;
export declare type Path = string;
export declare type KeyedPatterns<T> = {
export type Pattern = string;
export type Path = string;
export type KeyedPatterns<T> = {
readonly [K in keyof T]: Pattern[];
};
export declare type KeyedPaths<T> = {
export type KeyedPaths<T> = {
readonly [K in keyof T]: Path[];
};
export declare type _MatchResult<T> = {
export type _MatchResult<T> = {
readonly [K in keyof T]: boolean;
};
export declare type MatchResult<T> = _MatchResult<T> & {
export type MatchResult<T> = _MatchResult<T> & {
/** Returns an object containing arrays of matched files instead of the usual boolean values. */

@@ -17,3 +17,3 @@ getKeyedPaths(): KeyedPaths<T>;

/** A vendored copy of the Chainsmoker module on NPM */
export declare type Chainsmoker<T> = (...patterns: Pattern[]) => MatchResult<T>;
export type Chainsmoker<T> = (...patterns: Pattern[]) => MatchResult<T>;
export default function chainsmoker<T>(keyedPaths: KeyedPaths<T>): Chainsmoker<T>;

@@ -16,2 +16,8 @@ "use strict";

}
if ((0, fs_1.existsSync)("dangerfile.mts")) {
return "dangerfile.mts";
}
if ((0, fs_1.existsSync)("dangerfile.mjs")) {
return "dangerfile.mjs";
}
if ((0, fs_1.existsSync)("dangerfile.ts")) {

@@ -23,2 +29,8 @@ return "dangerfile.ts";

}
if ((0, fs_1.existsSync)("Dangerfile.mts")) {
return "Dangerfile.mts";
}
if ((0, fs_1.existsSync)("Dangerfile.mjs")) {
return "Dangerfile.mjs";
}
if ((0, fs_1.existsSync)("Dangerfile.ts")) {

@@ -25,0 +37,0 @@ return "Dangerfile.ts";

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

import { DangerResults } from "../../dsl/DangerResults";
export declare const markdownCode: (string: string) => string;
export declare const resultsWithFailure: (failure: string, moreMarkdown?: string | undefined) => DangerResults;
export declare const resultsWithFailure: (failure: string, moreMarkdown?: string) => DangerResults;
export declare const mergeResults: (left: DangerResults, right: DangerResults) => DangerResults;

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -1635,14 +1635,14 @@ //

declare const results: DangerRuntimeContainer
export declare type Pattern = string
export declare type Path = string
export declare type KeyedPatterns<T> = {
type Pattern = string
type Path = string
type KeyedPatterns<T> = {
readonly [K in keyof T]: Pattern[]
}
export declare type KeyedPaths<T> = {
type KeyedPaths<T> = {
readonly [K in keyof T]: Path[]
}
export declare type _MatchResult<T> = {
type _MatchResult<T> = {
readonly [K in keyof T]: boolean
}
export declare type MatchResult<T> = _MatchResult<T> & {
type MatchResult<T> = _MatchResult<T> & {
/** Returns an object containing arrays of matched files instead of the usual boolean values. */

@@ -1652,2 +1652,2 @@ getKeyedPaths(): KeyedPaths<T>

/** A vendored copy of the Chainsmoker module on NPM */
export declare type Chainsmoker<T> = (...patterns: Pattern[]) => MatchResult<T>
type Chainsmoker<T> = (...patterns: Pattern[]) => MatchResult<T>

@@ -1,1 +0,1 @@

export declare type MarkdownString = string;
export type MarkdownString = string;

@@ -75,3 +75,3 @@ import { RepoMetaData } from "./RepoMetaData";

}
export declare type BitBucketCloudLinks<Names extends string> = {
export type BitBucketCloudLinks<Names extends string> = {
[key in Names]: {

@@ -78,0 +78,0 @@ href: string;

@@ -230,3 +230,3 @@ import { RepoMetaData } from "./RepoMetaData";

}
export declare type BitBucketServerLinks<Names> = {
export type BitBucketServerLinks<Names> = {
[key in keyof Names]: {

@@ -301,2 +301,2 @@ href: string;

}
export declare type BitBucketServerChangesValue = BitBucketServerChangesValueAddCopyModifyDelete | BitBucketServerChangesValueMove;
export type BitBucketServerChangesValue = BitBucketServerChangesValueAddCopyModifyDelete | BitBucketServerChangesValueMove;

@@ -80,3 +80,3 @@ import { GitCommit } from "./Commit";

/** The shape of the Chainsmoker response */
declare type GitMatchResult = {
type GitMatchResult = {
/** Did any file paths match from the git modified list? */

@@ -83,0 +83,0 @@ modified: any;

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -7,3 +7,3 @@ import * as node_fetch from "node-fetch";

import { RepoMetaData } from "../../dsl/RepoMetaData";
export declare type BitBucketCloudCredentials = {
export type BitBucketCloudCredentials = {
/** Unique ID for this user, must be wrapped with brackets */

@@ -47,3 +47,3 @@ uuid?: string;

getPullRequestActivities: () => Promise<BitBucketCloudPRActivity[]>;
getFileContents: (filePath: string, repoSlug?: string | undefined, ref?: string | undefined) => Promise<string>;
getFileContents: (filePath: string, repoSlug?: string, ref?: string) => Promise<string>;
getDangerMainComments: (dangerID: string) => Promise<BitBucketCloudPRComment[]>;

@@ -64,4 +64,4 @@ getDangerInlineComments: (dangerID: string) => Promise<Comment[]>;

private performAPI;
get: (url: string, headers?: any, suppressErrors?: boolean | undefined) => Promise<node_fetch.Response>;
post: (url: string, headers?: any, body?: any, suppressErrors?: boolean | undefined) => Promise<node_fetch.Response>;
get: (url: string, headers?: any, suppressErrors?: boolean) => Promise<node_fetch.Response>;
post: (url: string, headers?: any, body?: any, suppressErrors?: boolean) => Promise<node_fetch.Response>;
put: (url: string, headers?: any, body?: any) => Promise<node_fetch.Response>;

@@ -68,0 +68,0 @@ delete: (url: string, headers?: any, body?: any) => Promise<node_fetch.Response>;

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -33,3 +33,3 @@ import * as node_fetch from "node-fetch";

getDangerInlineComments: (dangerID: string) => Promise<Comment[]>;
getFileContents: (filePath: string, repoSlug?: string | undefined, refspec?: string | undefined) => Promise<string>;
getFileContents: (filePath: string, repoSlug?: string, refspec?: string) => Promise<string>;
postBuildStatus: (commitId: string, payload: {

@@ -53,6 +53,6 @@ state: string;

private api;
get: (path: string, headers?: any, suppressErrors?: boolean | undefined) => Promise<node_fetch.Response>;
post: (path: string, headers?: any, body?: any, suppressErrors?: boolean | undefined) => Promise<node_fetch.Response>;
get: (path: string, headers?: any, suppressErrors?: boolean) => Promise<node_fetch.Response>;
post: (path: string, headers?: any, body?: any, suppressErrors?: boolean) => Promise<node_fetch.Response>;
put: (path: string, headers?: any, body?: any) => Promise<node_fetch.Response>;
delete: (path: string, headers?: any, body?: any) => Promise<node_fetch.Response>;
}

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -56,5 +56,5 @@ import { GitJSONDSL, GitDSL } from "../dsl/GitDSL";

deleteInlineComment: (commentId: string) => Promise<boolean>;
updateStatus: (passed: boolean | "pending", message: string, url?: string | undefined, dangerID?: string | undefined, ciCommitHash?: string | undefined) => Promise<boolean>;
updateStatus: (passed: boolean | "pending", message: string, url?: string, dangerID?: string, ciCommitHash?: string) => Promise<boolean>;
getFileContents: (filePath: string, repoSlug?: string | undefined, ref?: string | undefined) => Promise<string>;
}
export declare const bitbucketCloudJSONToBitBucketCloudDSL: (bitbucket: BitBucketCloudJSONDSL, api: BitBucketCloudAPI) => BitBucketCloudDSL;

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -31,3 +31,3 @@ import { GitJSONDSL, GitDSL } from "../dsl/GitDSL";

*/
updateStatus: (passed: boolean | "pending", message: string, url?: string | undefined, dangerID?: string | undefined, ciCommitHash?: string | undefined) => Promise<boolean>;
updateStatus: (passed: boolean | "pending", message: string, url?: string, dangerID?: string, ciCommitHash?: string) => Promise<boolean>;
/**

@@ -34,0 +34,0 @@ * Returns the `bitBucket_server` object on the Danger DSL

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -18,4 +18,4 @@ import parseDiff from "parse-diff";

}
export declare type GitStructuredDiff = Pick<parseDiff.File, "chunks" | "from" | "to">[];
export declare type Changes = parseDiff.Change[];
export type GitStructuredDiff = Pick<parseDiff.File, "chunks" | "from" | "to">[];
export type Changes = parseDiff.Change[];
export declare const gitJSONToGitDSL: (gitJSONRep: GitJSONDSL, config: GitJSONToGitDSLConfig) => GitDSL;
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -36,3 +40,3 @@ if (k2 === undefined) k2 = k;

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -39,0 +43,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -13,3 +13,3 @@ declare const fieldMap: {

};
export declare type GitLogOptions = {
export type GitLogOptions = {
number: number;

@@ -19,3 +19,3 @@ branch: string;

};
export declare type GitLogCommit = {
export type GitLogCommit = {
hash: string;

@@ -22,0 +22,0 @@ treeHash: string;

@@ -6,3 +6,3 @@ import { GitHubDSL, GitHubJSONDSL } from "../dsl/GitHubDSL";

/** Handles conforming to the Platform Interface for GitHub, API work is handle by GitHubAPI */
export declare type GitHubType = Platform & {
export type GitHubType = Platform & {
api: GitHubAPI;

@@ -9,0 +9,0 @@ };

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -36,3 +40,3 @@ if (k2 === undefined) k2 = k;

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -39,0 +43,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -39,2 +39,2 @@ import { DangerResults } from "../../../../dsl/DangerResults";

}
export declare const resultsToCheck: (results: DangerResults, options: ExecutorOptions, pr: GitHubPRDSL, api: GitHubNodeAPI, ciCommitHash?: string | undefined, name?: string) => Promise<CheckOptions>;
export declare const resultsToCheck: (results: DangerResults, options: ExecutorOptions, pr: GitHubPRDSL, api: GitHubNodeAPI, ciCommitHash?: string, name?: string) => Promise<CheckOptions>;

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -19,4 +19,4 @@ import { GitHubAPI } from "../GitHubAPI";

export declare const GitHubChecksCommenter: (api: GitHubAPI) => {
platformResultsPreMapper: (results: DangerResults, options: ExecutorOptions, ciCommitHash?: string | undefined) => Promise<DangerResults>;
platformResultsPreMapper: (results: DangerResults, options: ExecutorOptions, ciCommitHash?: string) => Promise<DangerResults>;
} | undefined;
export declare const tweetSizedResultsFromResults: (results: DangerResults, checksResponse: any) => DangerResults;

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -22,3 +22,3 @@ import { GitDSL } from "../../../dsl/GitDSL";

*/
updateStatus: (passed: boolean | "pending", message: string, url?: string | undefined, dangerID?: string | undefined) => Promise<boolean>;
updateStatus: (passed: boolean | "pending", message: string, url?: string, dangerID?: string) => Promise<boolean>;
/**

@@ -25,0 +25,0 @@ * Gets inline comments for current PR

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -25,5 +25,5 @@ /// <reference types="node" />

export declare function getGitHubFileContents(token: string, repoSlug: string, path: string, ref: string | null, showError?: boolean): Promise<string>;
export declare const shouldUseGitHubOverride: (request: string, parent?: NodeModule | undefined) => boolean;
export declare const shouldUseGitHubOverride: (request: string, parent?: NodeModule) => boolean;
export declare const customGitHubResolveRequest: (token: string) => (request: string, parent: {
filename: string;
}) => Promise<any>;

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -7,3 +7,3 @@ import { Octokit as GitHubNodeAPI } from "@octokit/rest";

import { CheckOptions } from "./comms/checks/resultsToCheck";
export declare type APIToken = string;
export type APIToken = string;
export interface GitHubFile {

@@ -28,3 +28,3 @@ filename: string;

*/
getExternalAPI: (accessTokenForApp?: string | undefined) => GitHubNodeAPI;
getExternalAPI: (accessTokenForApp?: string) => GitHubNodeAPI;
/**

@@ -38,3 +38,3 @@ * Grabs the contents of an individual file on GitHub

*/
fileContents: (path: string, repoSlug?: string | undefined, ref?: string | undefined) => Promise<string>;
fileContents: (path: string, repoSlug?: string, ref?: string) => Promise<string>;
getDangerCommentIDs: (dangerID: string) => Promise<string[]>;

@@ -74,8 +74,8 @@ updateCommentWithID: (id: string, comment: string) => Promise<any>;

getIssue: () => Promise<any>;
updateStatus: (passed: boolean | "pending", message: string, url?: string | undefined, dangerID?: string | undefined, ciCommitHash?: string | undefined) => Promise<any>;
updateStatus: (passed: boolean | "pending", message: string, url?: string, dangerID?: string, ciCommitHash?: string) => Promise<any>;
postCheckRun: (check: CheckOptions, token: string) => Promise<any>;
private api;
get: (path: string, headers?: any) => Promise<node_fetch.Response>;
post: (path: string, headers?: any, body?: any, suppressErrors?: boolean | undefined) => Promise<node_fetch.Response>;
patch: (path: string, headers?: any, body?: any, suppressErrors?: boolean | undefined) => Promise<node_fetch.Response>;
post: (path: string, headers?: any, body?: any, suppressErrors?: boolean) => Promise<node_fetch.Response>;
patch: (path: string, headers?: any, body?: any, suppressErrors?: boolean) => Promise<node_fetch.Response>;
}

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -5,3 +5,3 @@ import { GitDSL, GitJSONDSL } from "../../dsl/GitDSL";

export default function gitDSLForGitHub(api: GitHubAPI): Promise<GitJSONDSL>;
export declare const gitHubGitDSL: (github: GitHubDSL, json: GitJSONDSL, githubAPI?: GitHubAPI | undefined) => GitDSL;
export declare const gitHubGitDSL: (github: GitHubDSL, json: GitJSONDSL, githubAPI?: GitHubAPI) => GitDSL;
export declare const emptyGitJSON: () => GitJSONDSL;

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

import { components as OctokitOpenApiTypes } from "@octokit/openapi-types";
import { GitHubPRDSL, GitHubUtilsDSL } from "./../../dsl/GitHubDSL";
export declare type GetContentResponseData = OctokitOpenApiTypes["schemas"]["content-file"] | OctokitOpenApiTypes["schemas"]["content-symlink"] | OctokitOpenApiTypes["schemas"]["content-submodule"];
export type GetContentResponseData = OctokitOpenApiTypes["schemas"]["content-file"] | OctokitOpenApiTypes["schemas"]["content-symlink"] | OctokitOpenApiTypes["schemas"]["content-submodule"];
export declare function isFileContents(response: GetContentResponseData): response is OctokitOpenApiTypes["schemas"]["content-file"];

@@ -8,3 +8,3 @@ import { Octokit as GitHub } from "@octokit/rest";

/** Generates the fileContents function, needed so that Peril can re-create this func for an event */
export declare const fileContentsGenerator: (api: GitHub, defaultRepoSlug: string | undefined, defaultRef: string | undefined) => (path: string, repoSlug?: string | undefined, ref?: string | undefined) => Promise<string>;
export declare const fileContentsGenerator: (api: GitHub, defaultRepoSlug: string | undefined, defaultRef: string | undefined) => (path: string, repoSlug?: string, ref?: string) => Promise<string>;
/** Generates the createUpdatedIssueWithID function, needed so that Peril can re-create this func for an event */

@@ -33,3 +33,3 @@ export declare const createUpdatedIssueWithIDGenerator: (api: GitHub) => (id: string, content: string, settings: {

}
export declare const createOrUpdatePR: (pr: GitHubPRDSL | undefined, api: GitHub) => (config: PRCreationConfig, fileMap: any) => Promise<import("@octokit/plugin-paginate-rest/dist-types/types").OctokitResponse<{
export declare const createOrUpdatePR: (pr: GitHubPRDSL | undefined, api: GitHub) => (config: PRCreationConfig, fileMap: any) => Promise<import("@octokit/types").OctokitResponse<{
url: string;

@@ -586,3 +586,3 @@ id: number;

changed_files: number;
}, 200> | import("@octokit/plugin-paginate-rest/dist-types/types").OctokitResponse<{
}, 200> | import("@octokit/types").OctokitResponse<{
url: string;

@@ -1148,3 +1148,3 @@ id: number;

id: number;
} | undefined) => Promise<void>;
}) => Promise<void>;
export default utils;

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

import type * as Types from "@gitbeaker/rest";
import { Env } from "../../ci_source/ci_source";
import { RepoMetaData } from "../../dsl/RepoMetaData";
export declare type GitLabAPIToken = string;
export declare type GitLabOAuthToken = string;
export type GitLabAPIToken = string;
export type GitLabOAuthToken = string;
export interface RootGitLabAPICredentials {

@@ -15,3 +15,3 @@ host: string;

}
export declare type GitLabAPICredentials = GitLabAPICredentialsOptionsWithAccessToken | GitLabAPICredentialsOptionsWithOAuthToken;
export type GitLabAPICredentials = GitLabAPICredentialsOptionsWithAccessToken | GitLabAPICredentialsOptionsWithOAuthToken;
export declare function getGitLabHostFromEnv(env: Env): string;

@@ -40,4 +40,4 @@ export declare function getGitLabAPICredentialsFromEnv(env: Env): GitLabAPICredentials;

createMergeRequestDiscussion: (content: string, options?: {
position?: Types.DiscussionNotePositionOptions | undefined;
} | undefined) => Promise<Types.DiscussionSchema>;
position?: Types.DiscussionNotePositionOptions;
}) => Promise<Types.DiscussionSchema>;
createMergeRequestNote: (body: string) => Promise<Types.MergeRequestNoteSchema>;

@@ -48,4 +48,4 @@ updateMergeRequestDiscussionNote: (discussionId: string, noteId: number, body: string) => Promise<Types.MergeRequestDiscussionNoteSchema>;

deleteMergeRequestNote: (id: number) => Promise<boolean>;
getFileContents: (path: string, slug?: string | undefined, ref?: string | undefined) => Promise<string>;
getCompareChanges: (base?: string | undefined, head?: string | undefined) => Promise<Types.CommitDiffSchema[]>;
getFileContents: (path: string, slug?: string, ref?: string) => Promise<string>;
getCompareChanges: (base?: string, head?: string) => Promise<Types.CommitDiffSchema[]>;
addLabels: (...labels: string[]) => Promise<boolean>;

@@ -52,0 +52,0 @@ removeLabels: (...labels: string[]) => Promise<boolean>;

@@ -28,3 +28,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -7,5 +7,5 @@ import { CISource, Env } from "../ci_source/ci_source";

/** A type that represents the downloaded metadata about a code review session */
export declare type Metadata = any;
export type Metadata = any;
/** A type that represents a comment */
export declare type Comment = {
export type Comment = {
/**

@@ -12,0 +12,0 @@ * UUID for the comment

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -5,3 +5,3 @@ import { DangerRuntimeContainer } from "../dsl/DangerResults";

/** A function with a callback function, which Danger wraps in a Promise */
export declare type CallbackableFn = (callback: (done: any) => void) => void;
export type CallbackableFn = (callback: (done: any) => void) => void;
/**

@@ -12,3 +12,3 @@ * Types of things which Danger will schedule for you, it's recommended that you

*/
export declare type Scheduleable = Promise<any> | Promise<void> | CallbackableFn;
export type Scheduleable = Promise<any> | Promise<void> | CallbackableFn;
export interface DangerContext {

@@ -15,0 +15,0 @@ /**

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

@@ -17,3 +17,3 @@ "use strict";

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -20,0 +20,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -36,3 +40,3 @@ if (k2 === undefined) k2 = k;

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -39,0 +43,0 @@ if (y = 0, t) op = [op[0] & 2, t.value];

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -36,3 +40,3 @@ if (k2 === undefined) k2 = k;

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -64,2 +68,3 @@ if (y = 0, t) op = [op[0] & 2, t.value];

var fs = __importStar(require("fs"));
var path = __importStar(require("path"));
var debug_1 = require("../../debug");

@@ -121,3 +126,3 @@ var require_from_string_1 = __importDefault(require("require-from-string"));

var runDangerfileEnvironment = function (filenames, originalContents, environment, injectedObjectToExport, moduleHandler) { return __awaiter(void 0, void 0, void 0, function () {
var customModuleHandler, customRequire, index, _a, filename, remote, fn, originalContent, content, compiled, key, element, optionalExport, error_1, errorResults, results;
var customModuleHandler, customRequire, index, _a, filename, remote, fn, originalContent, content, compiled, key, element, optionalExport, tmpFileName, error_1, errorResults, results;
return __generator(this, function (_b) {

@@ -135,3 +140,3 @@ switch (_b.label) {

customRequire = moduleHandler || customModuleHandler;
// Tell all these filetypes to ge the custom compilation
// Tell all these filetypes to get the custom compilation
require.extensions[".ts"] = customRequire;

@@ -144,3 +149,3 @@ require.extensions[".tsx"] = customRequire;

case 1:
if (!(index < filenames.length)) return [3 /*break*/, 8];
if (!(index < filenames.length)) return [3 /*break*/, 13];
_a = filenames[index], filename = _a[0], remote = _a[1];

@@ -157,3 +162,3 @@ fn = filename;

case 2:
_b.trys.push([2, 6, , 7]);
_b.trys.push([2, 11, , 12]);
// Move all the DSL attributes into the global scope

@@ -167,10 +172,29 @@ for (key in environment) {

d("Started parsing Dangerfile: ", filename);
optionalExport = void 0;
if (!filename.endsWith(".mts")) return [3 /*break*/, 4];
tmpFileName = path.join(process.cwd(), "._dangerfile.mjs");
fs.writeFileSync(tmpFileName, compiled);
return [4 /*yield*/, import(tmpFileName)];
case 3:
// tried but data urls have trouble with imports and I don't know how to fix
// optionalExport = (await import(`data:text/javascript;base64,${btoa(compiled)}`));
optionalExport = _b.sent();
return [3 /*break*/, 7];
case 4:
if (!filename.endsWith(".mjs")) return [3 /*break*/, 6];
return [4 /*yield*/, import(path.join(process.cwd(), filename))];
case 5:
optionalExport = _b.sent();
return [3 /*break*/, 7];
case 6:
optionalExport = (0, require_from_string_1.default)(compiled, filename, {});
if (!(typeof optionalExport.default === "function")) return [3 /*break*/, 4];
_b.label = 7;
case 7:
if (!(typeof optionalExport.default === "function")) return [3 /*break*/, 9];
d("Running default export from Dangerfile", filename);
return [4 /*yield*/, optionalExport.default(injectedObjectToExport)];
case 3:
case 8:
_b.sent();
_b.label = 4;
case 4:
_b.label = 9;
case 9:
d("Finished running dangerfile: ", filename);

@@ -181,3 +205,3 @@ // Don't stop all current async code from breaking,

return [4 /*yield*/, runAllScheduledTasks(environment.results)];
case 5:
case 10:
// Don't stop all current async code from breaking,

@@ -187,4 +211,4 @@ // however new code (without Peril support) can run

_b.sent();
return [3 /*break*/, 7];
case 6:
return [3 /*break*/, 12];
case 11:
error_1 = _b.sent();

@@ -196,7 +220,7 @@ console.log("Unable to evaluate the Dangerfile\n", error_1);

environment.fail(errorResults.fails[0].message);
return [3 /*break*/, 7];
case 7:
return [3 /*break*/, 12];
case 12:
index++;
return [3 /*break*/, 1];
case 8:
case 13:
results = environment.results;

@@ -203,0 +227,0 @@ return [2 /*return*/, {

@@ -1,2 +0,1 @@

declare const _default: (contents: string) => string;
/**

@@ -7,2 +6,3 @@ * Updates a Dangerfile to remove the import for Danger

*/
declare const _default: (contents: string) => string;
export default _default;
export declare const checkForNodeModules: () => void;
export declare const dirContains: (rootDir: string, dir: string) => boolean;
export declare const lookupTSConfig: (dir: string) => string | null;
export declare const typescriptify: (content: string, dir: string) => string;
export declare const typescriptify: (content: string, dir: string, esm?: boolean) => string;
export declare const babelify: (content: string, filename: string, extraPlugins: string[]) => string;
declare const _default: (code: string, filename: string, remoteFile?: boolean) => string;
export default _default;
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -52,3 +56,3 @@ if (k2 === undefined) k2 = k;

// By default assume Babel 7 is used
var babelPackagePrefix = "@babel/" /* V7 */;
var babelPackagePrefix = "@babel/" /* BabelPackagePrefix.V7 */;
var d = (0, debug_1.debug)("transpiler:setup");

@@ -76,3 +80,3 @@ // Yes, lots of linter disables, but I want to support TS/Babel/Neither correctly

// Check for Babel 7
checkForBabel("@babel/" /* V7 */);
checkForBabel("@babel/" /* BabelPackagePrefix.V7 */);
}

@@ -82,3 +86,3 @@ catch (e) {

// Check for older Babel versions
checkForBabel("babel-" /* BEFORE_V7 */);
checkForBabel("babel-" /* BabelPackagePrefix.BEFORE_V7 */);
}

@@ -147,3 +151,4 @@ catch (e) {

exports.lookupTSConfig = lookupTSConfig;
var typescriptify = function (content, dir) {
var typescriptify = function (content, dir, esm) {
if (esm === void 0) { esm = false; }
var ts = require("typescript");

@@ -159,7 +164,8 @@ // Support custom TSC options, but also fallback to defaults

}
var result = ts.transpileModule(content, sanitizeTSConfig(compilerOptions));
var result = ts.transpileModule(content, sanitizeTSConfig(compilerOptions, esm));
return result.outputText;
};
exports.typescriptify = typescriptify;
var sanitizeTSConfig = function (config) {
var sanitizeTSConfig = function (config, esm) {
if (esm === void 0) { esm = false; }
if (!config.compilerOptions) {

@@ -176,5 +182,8 @@ return config;

//
if (safeConfig.compilerOptions.module) {
if (!esm && safeConfig.compilerOptions.module) {
safeConfig.compilerOptions.module = "commonjs";
}
else {
safeConfig.compilerOptions.module = "es6";
}
return safeConfig;

@@ -225,5 +234,5 @@ };

var result = code;
if (hasNativeTypeScript && filetype.startsWith(".ts")) {
if (hasNativeTypeScript && (filetype.startsWith(".ts") || filetype.startsWith(".mts"))) {
d("compiling with typescript");
result = (0, exports.typescriptify)(code, path.dirname(filename));
result = (0, exports.typescriptify)(code, path.dirname(filename), filename.endsWith(".mts"));
}

@@ -230,0 +239,0 @@ else if (hasBabel && hasBabelTypeScript && filetype.startsWith(".ts")) {

@@ -9,3 +9,3 @@ import { DangerResults } from "../../dsl/DangerResults";

*/
export declare const dangerSignaturePostfix: (results: DangerResults, commitID?: string | undefined) => string;
export declare const dangerSignaturePostfix: (results: DangerResults, commitID?: string) => string;
/**

@@ -12,0 +12,0 @@ * A template function for creating a GitHub issue comment from Danger Results

@@ -8,3 +8,3 @@ import { DangerResults } from "../../dsl/DangerResults";

*/
export declare const dangerSignaturePostfix: (results: DangerResults, commitID?: string | undefined) => string;
export declare const dangerSignaturePostfix: (results: DangerResults, commitID?: string) => string;
/**

@@ -11,0 +11,0 @@ * Comment to add when updating the PR status when issues are found

@@ -8,3 +8,3 @@ import { DangerResults } from "../../dsl/DangerResults";

*/
export declare const dangerSignaturePostfix: (results: DangerResults, commitID?: string | undefined) => string;
export declare const dangerSignaturePostfix: (results: DangerResults, commitID?: string) => string;
/**

@@ -11,0 +11,0 @@ * Comment to add when updating the PR status when issues are found

{
"name": "danger",
"version": "12.3.1",
"version": "12.3.2",
"description": "Unit tests for Team Culture",

@@ -143,3 +143,3 @@ "main": "distribution/danger.js",

"typedoc": "0.9.0",
"typescript": "^4.5.5",
"typescript": "^4.9.5",
"typescript-json-schema": "^0.53.0"

@@ -146,0 +146,0 @@ },

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc