8000 Merge pull request #48 from actions/code-quality · etn-ccis/github-script@f498913 · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"commit":{"oid":"f498913621f0c5516e7d8a768f63a2dfbfabca87","url":"/etn-ccis/github-script/commit/f498913621f0c5516e7d8a768f63a2dfbfabca87","authoredDate":"2020-05-18T11:34:07.000-04:00","committedDate":"2020-05-18T11:34:07.000-04:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eMerge pull request \u003ca class=\"issue-link js-issue-link\" data-error-text=\"Failed to load title\" data-id=\"620302940\" data-permission-text=\"Title is private\" data-url=\"https://github.com/actions/github-script/issues/48\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"/actions/github-script/pull/48/hovercard\" href=\"https://github.com/actions/github-script/pull/48\"\u003eactions#48\u003c/a\u003e from actions/code-quality\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"Code quality improvements","authors":[{"login":"jclem","displayName":"Jonathan Clem","avatarUrl":"https://avatars.githubusercontent.com/u/412282?v=4","path":"/jclem","isGitHub":false}],"committerAttribution":false,"committer":{"login":"web-flow","displayName":"GitHub","avatarUrl":"https://avatars.githubusercontent.com/u/19864447?v=4","path":"/web-flow","isGitHub":true},"parents":["ca141218759b4d5fc03cc539455467e537c797b9","58f0ff84d66c73a1d126bc9c361f4ab172285db8"],"globalRelayId":"MDY6Q29tbWl0ODI3NDE4MTUzOmY0OTg5MTM2MjFmMGM1NTE2ZTdkOGE3NjhmNjNhMmRmYmZhYmNhODc=","sha1":"ca141218759b4d5fc03cc539455467e537c797b9","sha2":"f498913621f0c5516e7d8a768f63a2dfbfabca87"},"currentUser":null,"repo":{"id":827418153,"defaultBranch":"main","name":"github-script","ownerLogin":"etn-ccis","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2024-07-11T16:00:41.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/83014498?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":0,"text":"@@ -0,0 +1,13 @@","html":"@@ -0,0 +1,13 @@","displayNoNewLineWarning":false,"position":0,"left":null,"right":0},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1,"text":"+root: true","html":"+\u003cspan class=\"pl-ent\"\u003eroot\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":null,"right":1},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2,"text":"+parser: '@typescript-eslint/parser'","html":"+\u003cspan class=\"pl-ent\"\u003eparser\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e@typescript-eslint/parser\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":2,"left":null,"right":2},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":3,"text":"+plugins: ['@typescript-eslint']","html":"+\u003cspan class=\"pl-ent\"\u003eplugins\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e[\u0026#39;@typescript-eslint\u0026#39;]\u003c/span\u003e","displayNoNewLineWarning":false,"position":3,"left":null,"right":3},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":4,"text":"+extends:","html":"+\u003cspan class=\"pl-ent\"\u003eextends\u003c/span\u003e:","displayNoNewLineWarning":false,"position":4,"left":null,"right":4},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":5,"text":"+ - eslint:recommended","html":"+ - \u003cspan class=\"pl-s\"\u003eeslint:recommended\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":null,"right":5},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":6,"text":"+ - plugin:@typescript-eslint/eslint-recommended","html":"+ - \u003cspan class=\"pl-s\"\u003eplugin:@typescript-eslint/eslint-recommended\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":null,"right":6},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":7,"text":"+ - plugin:@typescript-eslint/recommended","html":"+ - \u003cspan class=\"pl-s\"\u003eplugin:@typescript-eslint/recommended\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":null,"right":7},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":8,"text":"+ - prettier/@typescript-eslint","html":"+ - \u003cspan class=\"pl-s\"\u003eprettier/@typescript-eslint\u003c/span\u003e","displayNoNewLineWarning":false,"position":8,"left":null,"right":8},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":9,"text":"+rules:","html":"+\u003cspan class=\"pl-ent\"\u003erules\u003c/span\u003e:","displayNoNewLineWarning":false,"position":9,"left":null,"right":9},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":10,"text":"+ # '@typescript-eslint/explicit-function-return-type': 0","html":"+ \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e \u0026#39;@typescript-eslint/explicit-function-return-type\u0026#39;: 0\u003c/span\u003e","displayNoNewLineWarning":false,"position":10,"left":null,"right":10},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":11,"text":"+ '@typescript-eslint/no-use-before-define':","html":"+ \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003cspan class=\"pl-ent\"\u003e@typescript-eslint/no-use-before-define\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e:","displayNoNewLineWarning":false,"position":11,"left":null,"right":11},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":12,"text":"+ - 2","html":"+ - \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e","displayNoNewLineWarning":false,"position":12,"left":null,"right":12},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":13,"text":"+ - functions: false","html":"+ - \u003cspan class=\"pl-ent\"\u003efunctions\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003efalse\u003c/span\u003e","displayNoNewLineWarning":false,"position":13,"left":null,"right":13}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":13,"linesChanged":13,"newTreeEntry":{"lineCount":13,"path":".eslintrc.yml","mode":100644,"isGenerated":false},"oldTreeEntry":null,"linesAdded":13,"linesDeleted":0,"path":".eslintrc.yml","pathDigest":"9e1ecc14c733bb1ae2e523089f1262ac6ffccbcf950487ee0984403603550e57","status":"ADDED","truncatedReason":null,"oldOid":"ca141218759b4d5fc03cc539455467e537c797b9","newOid":"f498913621f0c5516e7d8a768f63a2dfbfabca87","copilotChatReference":null,"deletedSha":"ca141218759b4d5fc03cc539455467e537c797b9","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":14,"text":"@@ -15,4 +15,5 @@ jobs:","html":"@@ -15,4 +15,5 @@ jobs:","displayNoNewLineWarning":false,"position":0,"left":14,"right":14},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":15,"text":" key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}","html":" \u003cspan class=\"pl-ent\"\u003ekey\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e${{runner.os}}-npm-${{hashFiles(\u0026#39;**/package-lock.json\u0026#39;)}}\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":15,"right":15},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":16,"text":" restore-keys: ${{runner.os}}-npm-","html":" \u003cspan class=\"pl-ent\"\u003erestore-keys\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e${{runner.os}}-npm-\u003c/span\u003e","displayNoNewLineWarning":false,"position":2,"left":16,"right":16},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":17,"text":" - run: npm ci","html":" - \u003cspan class=\"pl-ent\"\u003erun\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003enpm ci\u003c/span\u003e","displayNoNewLineWarning":false,"position":3,"left":17,"right":17},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":18,"text":"+ - run: npm run style:check","html":"+ - \u003cspan class=\"pl-ent\"\u003erun\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003enpm run style:check\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":17,"right":18},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":19,"text":" - run: npm test","html":" - \u003cspan class=\"pl-ent\"\u003erun\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003enpm test\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":18,"right":19}],"diffNumber":1,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":19,"linesChanged":1,"newTreeEntry":{"lineCount":19,"path":".github/workflows/ci.yml","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":".github/workflows/ci.yml","mode":100644},"linesAdded":1,"linesDeleted":0,"path":".github/workflows/ci.yml","pathDigest":"b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f","status":"MODIFIED","truncatedReason":null,"oldOid":"ca141218759b4d5fc03cc539455467e537c797b9","newOid":"f498913621f0c5516e7d8a768f63a2dfbfabca87","copilotChatReference":null,"deletedSha":"ca141218759b4d5fc03cc539455467e537c797b9","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":0,"text":"@@ -1 +1,2 @@","html":"@@ -1 +1,2 @@","displayNoNewLineWarning":false,"position":0,"left":0,"right":0},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1,"text":"-node_modules","html":"-\u003cspan class=\"pl-e\"\u003enode_modules\u003c/span\u003e","displayNoNewLineWarning":true,"position":1,"left":1,"right":0},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1,"text":"+/node_modules/","html":"+/\u003cspan class=\"pl-e\"\u003enode_modules\u003c/span\u003e/","displayNoNewLineWarning":false,"position":3,"left":1,"right":1},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2,"text":"+!/.vscode/","html":"+\u003cspan class=\"pl-k\"\u003e!\u003c/span\u003e/\u003cspan class=\"pl-e\"\u003e.vscode\u003c/span\u003e/","displayNoNewLineWarning":true,"position":4,"left":1,"right":2}],"diffNumber":2,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":2,"linesChanged":3,"newTreeEntry":{"lineCount":2,"path":".gitignore","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":".gitignore","mode":100644},"linesAdded":2,"linesDeleted":1,"path":".gitignore","pathDigest":"bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947","status":"MODIFIED","truncatedReason":null,"oldOid":"ca141218759b4d5fc03cc539455467e537c797b9","newOid":"f498913621f0c5516e7d8a768f63a2dfbfabca87","copilotChatReference":null,"deletedSha":"ca141218759b4d5fc03cc539455467e537c797b9","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":0,"text":"@@ -0,0 +1,5 @@","html":"@@ -0,0 +1,5 @@","displayNoNewLineWarning":false,"position":0,"left":null,"right":0},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1,"text":"+arrowParens: avoid","html":"+\u003cspan class=\"pl-ent\"\u003earrowParens\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003eavoid\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":null,"right":1},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2,"text":"+bracketSpacing: false","html":"+\u003cspan class=\"pl-ent\"\u003ebracketSpacing\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003efalse\u003c/span\u003e","displayNoNewLineWarning":false,"position":2,"left":null,"right":2},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":3,"text":"+semi: false","html":"+\u003cspan class=\"pl-ent\"\u003esemi\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003efalse\u003c/span\u003e","displayNoNewLineWarning":false,"position":3,"left":null,"right":3},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":4,"text":"+singleQuote: true","html":"+\u003cspan class=\"pl-ent\"\u003esingleQuote\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":null,"right":4},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":5,"text":"+trailingComma: none","html":"+\u003cspan class=\"pl-ent\"\u003etrailingComma\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003enone\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":null,"right":5}],"diffNumber":3,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":5,"linesChanged":5,"newTreeEntry":{"lineCount":5,"path":".prettierrc.yml","mode":100644,"isGenerated":false},"oldTreeEntry":null,"linesAdded":5,"linesDeleted":0,"path":".prettierrc.yml","pathDigest":"c1167bf7ca27b627e9d890eddb7e6f595f1327c3346050b6d1a7bec85c3aae2d","status":"ADDED","truncatedReason":null,"oldOid":"ca141218759b4d5fc03cc539455467e537c797b9","newOid":"f498913621f0c5516e7d8a768f63a2dfbfabca87","copilotChatReference":null,"deletedSha":"ca141218759b4d5fc03cc539455467e537c797b9","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":0,"text":"@@ -0,0 +1,10 @@","html":"@@ -0,0 +1,10 @@","displayNoNewLineWarning":false,"position":0,"left":null,"right":0},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1,"text":"+{","html":"+{","displayNoNewLineWarning":false,"position":1,"left":null,"right":1},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2,"text":"+ \"editor.formatOnSave\": true,","html":"+ \u003cspan class=\"pl-ent\"\u003e\u0026quot;editor.formatOnSave\u0026quot;\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e,","displayNoNewLineWarning":false,"position":2,"left":null,"right":2},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":3,"text":"+ \"editor.codeActionsOnSave\": {","html":"+ \u003cspan class=\"pl-ent\"\u003e\u0026quot;editor.codeActionsOnSave\u0026quot;\u003c/span\u003e: {","displayNoNewLineWarning":false,"position":3,"left":null,"right":3},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":4,"text":"+ \"source.organizeImports\": true","html":"+ \u003cspan class=\"pl-ent\"\u003e\u0026quot;source.organizeImports\u0026quot;\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":null,"right":4},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":5,"text":"+ },","html":"+ },","displayNoNewLineWarning":false,"position":5,"left":null,"right":5},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":6,"text":"+ \"files.exclude\": {","html":"+ \u003cspan class=\"pl-ent\"\u003e\u0026quot;files.exclude\u0026quot;\u003c/span\u003e: {","displayNoNewLineWarning":false,"position":6,"left":null,"right":6},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":7,"text":"+ \"**/dist\": true,","html":"+ \u003cspan class=\"pl-ent\"\u003e\u0026quot;**/dist\u0026quot;\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e,","displayNoNewLineWarning":false,"position":7,"left":null,"right":7},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":8,"text":"+ \"**/node_modules\": true","html":"+ \u003cspan class=\"pl-ent\"\u003e\u0026quot;**/node_modules\u0026quot;\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e","displayNoNewLineWarning":false,"position":8,"left":null,"right":8},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":9,"text":"+ }","html":"+ }","displayNoNewLineWarning":false,"position":9,"left":null,"right":9},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":10,"text":"+}","html":"+}","displayNoNewLineWarning":false,"position":10,"left":null,"right":10}],"diffNumber":4,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":10,"linesChanged":10,"newTreeEntry":{"lineCount":10,"path":".vscode/settings.json","mode":100644,"isGenerated":false},"oldTreeEntry":null,"linesAdded":10,"linesDeleted":0,"path":".vscode/settings.json","pathDigest":"a5de3e5871ffcc383a2294845bd3df25d3eeff6c29ad46e3a396577c413bf357","status":"ADDED","truncatedReason":null,"oldOid":"ca141218759b4d5fc03cc539455467e537c797b9","newOid":"f498913621f0c5516e7d8a768f63a2dfbfabca87","copilotChatReference":null,"deletedSha":"ca141218759b4d5fc03cc539455467e537c797b9","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":0,"text":"@@ -1,26 +1,28 @@","html":"@@ -1,26 +1,28 @@","displayNoNewLineWarning":false,"position":0,"left":0,"right":0},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1,"text":"+/* eslint-disable @typescript-eslint/no-explicit-any */","html":"+\u003cspan class=pl-c\u003e/* eslint-disable @typescript-eslint/no-explicit-any */\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":0,"right":1},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2,"text":"+","html":"+","displayNoNewLineWarning":false,"position":2,"left":0,"right":2},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3,"text":" import {callAsyncFunction} from '../src/async-function'","html":" \u003cspan class=pl-k\u003eimport\u003c/span\u003e \u003cspan class=pl-kos\u003e{\u003c/span\u003e\u003cspan class=pl-s1\u003ecallAsyncFunction\u003c/span\u003e\u003cspan class=pl-kos\u003e}\u003c/span\u003e \u003cspan class=pl-k\u003efrom\u003c/span\u003e \u003cspan class=pl-s\u003e\u0026#39;../src/async-function\u0026#39;\u003c/span\u003e","displayNoNewLineWarning":false,"position":3,"left":1,"right":3},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":4,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":4,"left":2,"right":4},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":5,"text":" describe('callAsyncFunction', () =\u003e {","html":" \u003cspan class=pl-en\u003edescribe\u003c/span\u003e\u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-s\u003e\u0026#39;callAsyncFunction\u0026#39;\u003c/span\u003e\u003cspan class=pl-kos\u003e,\u003c/span\u003e \u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u0026gt;\u003c/span\u003e \u003cspan class=pl-kos\u003e{\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":3,"right":5},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":6,"text":" test('calls the function with its arguments', async () =\u003e {","html":" \u003cspan class=pl-en\u003etest\u003c/span\u003e\u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-s\u003e\u0026#39;calls the function with its arguments\u0026#39;\u003c/span\u003e\u003cspan class=pl-kos\u003e,\u003c/span\u003e \u003cspan class=pl-k\u003easync\u003c/span\u003e \u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u0026gt;\u003c/span\u003e \u003cspan class=pl-kos\u003e{\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":4,"right":6},{"stylingDirective":null,"type":"DELETION","blobLineNumber":5,"text":"- const result = await callAsyncFunction({foo: 'bar'}, 'return foo')","html":"- \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eawait\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ecallAsyncFunction\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003efoo\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e'bar'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e'return foo'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":5,"right":6},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":7,"text":"+ const result = await callAsyncFunction({foo: 'bar'} as any, 'return foo')","html":"+ \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eawait\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ecallAsyncFunction\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003efoo\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e'bar'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"x x-first\"\u003e \u003c/span\u003e\u003cspan class=\"pl-k x\"\u003eas\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-smi x x-last\"\u003eany\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e'return foo'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":8,"left":5,"right":7},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":8,"text":" expect(result).toEqual('bar')","html":" \u003cspan class=pl-en\u003eexpect\u003c/span\u003e\u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-s1\u003eresult\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e\u003cspan class=pl-kos\u003e.\u003c/span\u003e\u003cspan class=pl-en\u003etoEqual\u003c/span\u003e\u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-s\u003e\u0026#39;bar\u0026#39;\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":9,"left":6,"right":8},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9,"text":" })","html":" \u003cspan class=pl-kos\u003e}\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":10,"left":7,"right":9},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":11,"left":8,"right":10},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":11,"text":" test('throws on ReferenceError', async () =\u003e {","html":" \u003cspan class=pl-en\u003etest\u003c/span\u003e\u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-s\u003e\u0026#39;throws on ReferenceError\u0026#39;\u003c/span\u003e\u003cspan class=pl-kos\u003e,\u003c/span\u003e \u003cspan class=pl-k\u003easync\u003c/span\u003e \u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u0026gt;\u003c/span\u003e \u003cspan class=pl-kos\u003e{\u003c/span\u003e","displayNoNewLineWarning":false,"position":12,"left":9,"right":11},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":12,"text":" expect.assertions(1)","html":" \u003cspan class=pl-s1\u003eexpect\u003c/span\u003e\u003cspan class=pl-kos\u003e.\u003c/span\u003e\u003cspan class=pl-en\u003eassertions\u003c/span\u003e\u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-c1\u003e1\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":13,"left":10,"right":12},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":13,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":14,"left":11,"right":13},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":14,"text":" try {","html":" \u003cspan class=pl-k\u003etry\u003c/span\u003e \u003cspan class=pl-kos\u003e{\u003c/span\u003e","displayNoNewLineWarning":false,"position":15,"left":12,"right":14},{"stylingDirective":null,"type":"DELETION","blobLineNumber":13,"text":"- await callAsyncFunction({}, 'proces')","html":"- \u003cspan class=\"pl-k\"\u003eawait\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ecallAsyncFunction\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e'proces'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":16,"left":13,"right":14},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":15,"text":"+ await callAsyncFunction({} as any, 'proces')","html":"+ \u003cspan class=\"pl-k\"\u003eawait\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ecallAsyncFunction\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"x x-first\"\u003e \u003c/span\u003e\u003cspan class=\"pl-k x\"\u003eas\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-smi x x-last\"\u003eany\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e'proces'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":17,"left":13,"right":15},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":16,"text":" } catch (err) {","html":" \u003cspan class=pl-kos\u003e}\u003c/span\u003e \u003cspan class=pl-k\u003ecatch\u003c/span\u003e \u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-s1\u003eerr\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e \u003cspan class=pl-kos\u003e{\u003c/span\u003e","displayNoNewLineWarning":false,"position":18,"left":14,"right":16},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":17,"text":" expect(err).toBeInstanceOf(ReferenceError)","html":" \u003cspan class=pl-en\u003eexpect\u003c/span\u003e\u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-s1\u003eerr\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e\u003cspan class=pl-kos\u003e.\u003c/span\u003e\u003cspan class=pl-en\u003etoBeInstanceOf\u003c/span\u003e\u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-v\u003eReferenceError\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":19,"left":15,"right":17},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":18,"text":" }","html":" \u003cspan class=pl-kos\u003e}\u003c/span\u003e","displayNoNewLineWarning":false,"position":20,"left":16,"right":18},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":19,"text":" })","html":" \u003cspan class=pl-kos\u003e}\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":21,"left":17,"right":19},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":20,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":22,"left":18,"right":20},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":21,"text":" test('can access process', async () =\u003e {","html":" \u003cspan class=pl-en\u003etest\u003c/span\u003e\u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-s\u003e\u0026#39;can access process\u0026#39;\u003c/span\u003e\u003cspan class=pl-kos\u003e,\u003c/span\u003e \u003cspan class=pl-k\u003easync\u003c/span\u003e \u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u0026gt;\u003c/span\u003e \u003cspan class=pl-kos\u003e{\u003c/span\u003e","displayNoNewLineWarning":false,"position":23,"left":19,"right":21},{"stylingDirective":null,"type":"DELETION","blobLineNumber":20,"text":"- await callAsyncFunction({}, 'process')","html":"- \u003cspan class=\"pl-k\"\u003eawait\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ecallAsyncFunction\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e'process'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":24,"left":20,"right":21},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":22,"text":"+ await callAsyncFunction({} as any, 'process')","html":"+ \u003cspan class=\"pl-k\"\u003eawait\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ecallAsyncFunction\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"x x-first\"\u003e \u003c/span\u003e\u003cspan class=\"pl-k x\"\u003eas\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-smi x x-last\"\u003eany\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e'process'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":25,"left":20,"right":22},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":23,"text":" })","html":" \u003cspan class=pl-kos\u003e}\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":26,"left":21,"right":23},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":24,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":27,"left":22,"right":24},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":25,"text":" test('can access console', async () =\u003e {","html":" \u003cspan class=pl-en\u003etest\u003c/span\u003e\u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-s\u003e\u0026#39;can access console\u0026#39;\u003c/span\u003e\u003cspan class=pl-kos\u003e,\u003c/span\u003e \u003cspan class=pl-k\u003easync\u003c/span\u003e \u003cspan class=pl-kos\u003e(\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u0026gt;\u003c/span\u003e \u003cspan class=pl-kos\u003e{\u003c/span\u003e","displayNoNewLineWarning":false,"position":28,"left":23,"right":25},{"stylingDirective":null,"type":"DELETION","blobLineNumber":24,"text":"- await callAsyncFunction({}, 'console')","html":"- \u003cspan class=\"pl-k\"\u003eawait\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ecallAsyncFunction\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e'console'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":29,"left":24,"right":25},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":26,"text":"+ await callAsyncFunction({} as any, 'console')","html":"+ \u003cspan class=\"pl-k\"\u003eawait\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ecallAsyncFunction\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"x x-first\"\u003e \u003c/span\u003e\u003cspan class=\"pl-k x\"\u003eas\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-smi x x-last\"\u003eany\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e'console'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":30,"left":24,"right":26},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":27,"text":" })","html":" \u003cspan class=pl-kos\u003e}\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":31,"left":25,"right":27},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":28,"text":" })","html":" \u003cspan class=pl-kos\u003e}\u003c/span\u003e\u003cspan class=pl-kos\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":32,"le 8000 ft":26,"right":28}],"diffNumber":5,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":28,"linesChanged":10,"newTreeEntry":{"lineCount":28,"path":"__test__/async-function.test.ts","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"__test__/async-function.test.ts","mode":100644},"linesAdded":6,"linesDeleted":4,"path":"__test__/async-function.test.ts","pathDigest":"4dab588c3b8b3734c5201d25d4fc0cd1f69cb13f637dcfe752a6f5488d446478","status":"MODIFIED","truncatedReason":null,"oldOid":"ca141218759b4d5fc03cc539455467e537c797b9","newOid":"f498913621f0c5516e7d8a768f63a2dfbfabca87","copilotChatReference":null,"deletedSha":"ca141218759b4d5fc03cc539455467e537c797b9","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":9273,"text":"@@ -9274,7 +9274,7 @@ var core = __webpack_require__(470);","html":"@@ -9274,7 +9274,7 @@ var core = __webpack_require__(470);","displayNoNewLineWarning":false,"position":0,"left":9273,"right":9273},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9274,"text":" var lib_github = __webpack_require__(469);","html":" var lib_github = __webpack_require__(469);","displayNoNewLineWarning":false,"position":1,"left":9274,"right":9274},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9275,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":2,"left":9275,"right":9275},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9276,"text":" // CONCATENATED MODULE: ./src/async-function.ts","html":" // CONCATENATED MODULE: ./src/async-function.ts","displayNoNewLineWarning":false,"position":3,"left":9276,"right":9276},{"stylingDirective":null,"type":"DELETION","blobLineNumber":9277,"text":"-const AsyncFunction = Object.getPrototypeOf(async () =\u003e { }).constructor;","html":"-const AsyncFunction = Object.getPrototypeOf(async () =\u0026gt; \u003cspan class=\"x x-first x-last\"\u003e{ }\u003c/span\u003e).constructor;","displayNoNewLineWarning":false,"position":4,"left":9277,"right":9276},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":9277,"text":"+const AsyncFunction = Object.getPrototypeOf(async () =\u003e null).constructor;","html":"+const AsyncFunction = Object.getPrototypeOf(async () =\u0026gt; \u003cspan class=\"x x-first x-last\"\u003enull\u003c/span\u003e).constructor;","displayNoNewLineWarning":false,"position":5,"left":9277,"right":9277},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9278,"text":" function callAsyncFunction(args, source) {","html":" function callAsyncFunction(args, source) {","displayNoNewLineWarning":false,"position":6,"left":9278,"right":9278},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9279,"text":" const fn = new AsyncFunction(...Object.keys(args), source);","html":" const fn = new AsyncFunction(...Object.keys(args), source);","displayNoNewLineWarning":false,"position":7,"left":9279,"right":9279},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9280,"text":" return fn(...Object.values(args));","html":" return fn(...Object.values(args));","displayNoNewLineWarning":false,"position":8,"left":9280,"right":9280},{"stylingDirective":null,"type":"HUNK","blobLineNumber":9299,"text":"@@ -9300,7 +9300,7 @@ async function main() {","html":"@@ -9300,7 +9300,7 @@ async function main() {","displayNoNewLineWarning":false,"position":9,"left":9299,"right":9299},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9300,"text":" opts.previews = previews.split(',');","html":" opts.previews = previews.split(\u0026#39;,\u0026#39;);","displayNoNewLineWarning":false,"position":10,"left":9300,"right":9300},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9301,"text":" const github = new lib_github.GitHub(token, opts);","html":" const github = new lib_github.GitHub(token, opts);","displayNoNewLineWarning":false,"position":11,"left":9301,"right":9301},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9302,"text":" const script = Object(core.getInput)('script', { required: true });","html":" const script = Object(core.getInput)(\u0026#39;script\u0026#39;, { required: true });","displayNoNewLineWarning":false,"position":12,"left":9302,"right":9302},{"stylingDirective":null,"type":"DELETION","blobLineNumber":9303,"text":"- // Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors.","html":"- // Using property/value shorthand on `require` (e.g. `{require}`) causes \u003cspan class=\"x x-first x-last\"\u003ecompilatin\u003c/span\u003e errors.","displayNoNewLineWarning":false,"position":13,"left":9303,"right":9302},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":9303,"text":"+ // Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.","html":"+ // Using property/value shorthand on `require` (e.g. `{require}`) causes \u003cspan class=\"x x-first x-last\"\u003ecompilation\u003c/span\u003e errors.","displayNoNewLineWarning":false,"position":14,"left":9303,"right":9303},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9304,"text":" const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context, core: core }, script);","html":" const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context, core: core }, script);","displayNoNewLineWarning":false,"position":15,"left":9304,"right":9304},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9305,"text":" let encoding = Object(core.getInput)('result-encoding');","html":" let encoding = Object(core.getInput)(\u0026#39;result-encoding\u0026#39;);","displayNoNewLineWarning":false,"position":16,"left":9305,"right":9305},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9306,"text":" encoding = encoding ? encoding : 'json';","html":" encoding = encoding ? encoding : \u0026#39;json\u0026#39;;","displayNoNewLineWarning":false,"position":17,"left":9306,"right":9306},{"stylingDirective":null,"type":"HUNK","blobLineNumber":9316,"text":"@@ -9317,14 +9317,10 @@ async function main() {","html":"@@ -9317,14 +9317,10 @@ async function main() {","displayNoNewLineWarning":false,"position":18,"left":9316,"right":9316},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9317,"text":" }","html":" }","displayNoNewLineWarning":false,"position":19,"left":9317,"right":9317},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9318,"text":" Object(core.setOutput)('result', output);","html":" Object(core.setOutput)(\u0026#39;result\u0026#39;, output);","displayNoNewLineWarning":false,"position":20,"left":9318,"right":9318},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9319,"text":" }","html":" }","displayNoNewLineWarning":false,"position":21,"left":9319,"right":9319},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":9320,"text":"+// eslint-disable-next-line @typescript-eslint/no-explicit-any","html":"+// eslint-disable-next-line @typescript-eslint/no-explicit-any","displayNoNewLineWarning":false,"position":22,"left":9319,"right":9320},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9321,"text":" function handleError(err) {","html":" function handleError(err) {","displayNoNewLineWarning":false,"position":23,"left":9320,"right":9321},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9322,"text":" console.error(err);","html":" console.error(err);","displayNoNewLineWarning":false,"position":24,"left":9321,"right":9322},{"stylingDirective":null,"type":"DELETION","blobLineNumber":9322,"text":"- if (err \u0026\u0026 err.message) {","html":"- if (err \u0026amp;\u0026amp; err.message) {","displayNoNewLineWarning":false,"position":25,"left":9322,"right":9322},{"stylingDirective":null,"type":"DELETION","blobLineNumber":9323,"text":"- Object(core.setFailed)(err.message);","html":"- Object(core.setFailed)(err.message);","displayNoNewLineWarning":false,"position":26,"left":9323,"right":9322},{"stylingDirective":null,"type":"DELETION","blobLineNumber":9324,"text":"- }","html":"- }","displayNoNewLineWarning":false,"position":27,"left":9324,"right":9322},{"stylingDirective":null,"type":"DELETION","blobLineNumber":9325,"text":"- else {","html":"- else {","displayNoNewLineWarning":false,"position":28,"left":9325,"right":9322},{"stylingDirective":null,"type":"DELETION","blobLineNumber":9326,"text":"- Object(core.setFailed)(`Unhandled error: ${err}`);","html":"- Object(core.setFailed)(`Unhandled error: ${err}`);","displayNoNewLineWarning":false,"position":29,"left":9326,"right":9322},{"stylingDirective":null,"type":"DELETION","blobLineNumber":9327,"text":"- }","html":"- }","displayNoNewLineWarning":false,"position":30,"left":9327,"right":9322},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":9323,"text":"+ Object(core.setFailed)(`Unhandled error: ${err}`);","html":"+ Object(core.setFailed)(`Unhandled error: ${err}`);","displayNoNewLineWarning":false,"position":31,"left":9327,"right":9323},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9324,"text":" }","html":" }","displayNoNewLineWarning":false,"position":32,"left":9328,"right":9324},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9325,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":33,"left":9329,"right":9325},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9326,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":34,"left":9330,"right":9326}],"diffNumber":6,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":25486,"linesChanged":12,"newTreeEntry":{"lineCount":25486,"path":"dist/index.js","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"dist/index.js","mode":100644},"linesAdded":4,"linesDeleted":8,"path":"dist/index.js","pathDigest":"3d2b59189eeedc2d428ddd632e97658fe310f587f7cb63b01f9b98ffc11c0197","status":"MODIFIED","truncatedReason":null,"oldOid":"ca141218759b4d5fc03cc539455467e537c797b9","newOid":"f498913621f0c5516e7d8a768f63a2dfbfabca87","copilotChatReference":null,"deletedSha":"ca141218759b4d5fc03cc539455467e537c797b9","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":14,"text":"@@ -15,7 +15,8 @@ bash\u003e npm run build","html":"@@ -15,7 +15,8 @@ bash\u0026gt; npm run build","displayNoNewLineWarning":false,"position":0,"left":14,"right":14},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":15,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":1,"left":15,"right":15},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":16,"text":" It also has a pre-commit hook configured via","html":" It also has a pre-commit hook configured via","displayNoNewLineWarning":false,"position":2,"left":16,"right":16},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":17,"text":" [husky](https://www.npmjs.com/package/husky) that should run the build script","html":" \u003cspan class=\"pl-s\"\u003e[\u003c/span\u003ehusky\u003cspan class=\"pl-s\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-corl\"\u003ehttps://www.npmjs.com/package/husky\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e)\u003c/span\u003e that should run the build script","displayNoNewLineWarning":false,"position":3,"left":17,"right":17},{"stylingDirective":null,"type":"DELETION","blobLineNumber":18,"text":"-before each commit.","html":"-before each commit.","displayNoNewLineWarning":false,"position":4,"left":18,"right":17},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":18,"text":"+before each commit. Additionally, this hook formats code and lints it, as","html":"+before each commit. Additionally, this hook formats code and lints it, as","displayNoNewLineWarning":false,"position":5,"left":18,"right":18},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":19,"text":"+well.","html":"+well.","displayNoNewLineWarning":false,"position":6,"left":18,"right":19},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":20,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":7,"left":19,"right":20},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":21,"text":" ## Releasing","html":" \u003cspan class=\"pl-mh\"\u003e## \u003cspan class=\"pl-en\"\u003eReleasing\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":8,"left":20,"right":21},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":22,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":9,"left":21,"right":22}],"diffNumber":7,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":28,"linesChanged":3,"newTreeEntry":{"lineCount":28,"path":"docs/development.md","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"docs/development.md","mode":100644},"linesAdded":2,"linesDeleted":1,"path":"docs/development.md","pathDigest":"97db29a7915320e63d41d38a0440360a87055ee8ed03757aa263116dbbb4aabe","status":"MODIFIED","truncatedReason":null,"oldOid":"ca141218759b4d5fc03cc539455467e537c797b9","newOid":"f498913621f0c5516e7d8a768f63a2dfbfabca87","copilotChatReference":null,"deletedSha":"ca141218759b4d5fc03cc539455467e537c797b9","canToggleRichDiff":true,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"path":"package-lock.json","pathDigest":"053150b640a7ce75eff69d1a22cae7f0f94ad64ce9a855db544dda0929316519","status":"MODIFIED"},{"path":"package.json","pathDigest":"7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519","status":"MODIFIED"},{"path":"src/async-function.ts","pathDigest":"dbb29757fc1d2f7daeae34c0c584b90ad4645833e4617e7082762abb2c7724c4","status":"MODIFIED"},{"path":"src/main.ts","pathDigest":"4fab5baaca5c14d2de62d8d2fceef376ddddcc8e9509d86cfa5643f51b89ce3d","status":"MODIFIED"}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjgzMDE0NDk4","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/etn-ccis/github-script/commit/f498913621f0c5516e7d8a768f63a2dfbfabca87","fileTreeExpanded":true,"headerInfo":{"additions":1004,"deletions":73,"filesChanged":12,"filesChangedString":"12"},"moreDiffsToLoad":true,"asyncDiffLoadInfo":{"startIndex":8,"truncated":false,"byteCount":3904,"lineShownCount":121},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"ssYQH517o1FksUINxBOkPCrR26bi4sjTlIPfCKyZj40Dvr50tYGvOL1iUurw-zCgX9Fyr69Jmn78UVaNG0AXvg"},"/users/diffview?diff=unified":{"post":"dV6u9g9jrLwGtlvMcwosWYxC7Omr_fJAt7CDWiHaV5DEJgCdJ5mg1d9lSytH4rjF-UJF4OZWoO3fYgrflgPPow"},"/notifications/thread":{"post":"v6NpS5UNAwzYiLyeYEbH3LeyA9W8_6ivMYiAWiFhbNLpbURzq9KpJ7ztT7XR1VzLY45VmqdhMZxPvh8CYyAalQ"}}},"title":"Merge pull request #48 from actions/code-quality · etn-ccis/github-script@f498913","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}

Commit f498913

Browse files
authored
Merge pull request actions#48 from actions/code-quality
Code quality improvements
2 parents ca14121 + 58f0ff8 commit f498913

File tree

12 files changed

+1004
-73
lines changed

12 files changed

+1004
-73
lines changed

.eslintrc.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root: true
2+
parser: '@typescript-eslint/parser'
3+
plugins: ['@typescript-eslint']
4+
extends:
5+
- eslint:recommended
6+
- plugin:@typescript-eslint/eslint-recommended
7+
- plugin:@typescript-eslint/recommended
8+
- prettier/@typescript-eslint
9+
rules:
10+
# '@typescript-eslint/explicit-function-return-type': 0
11+
'@typescript-eslint/no-use-before-define':
12+
- 2
13+
- functions: false

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ jobs:
1515
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
1616
restore-keys: ${{runner.os}}-npm-
1717
- run: npm ci
18+
- run: npm run style:check
1819
- run: npm test

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
/node_modules/
2+
!/.vscode/

.prettierrc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
arrowParens: avoid
2+
bracketSpacing: false
3+
semi: false
4+
singleQuote: true
5+
trailingComma: none

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.codeActionsOnSave": {
4+
"source.organizeImports": true
5+
},
6+
"files.exclude": {
7+
"**/dist": true,
8+
"**/node_modules": true
9+
}
10+
}

__test__/async-function.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
2+
13
import {callAsyncFunction} from '../src/async-function'
24

35
describe('callAsyncFunction', () => {
46
test('calls the function with its arguments', async () => {
5-
const result = await callAsyncFunction({foo: 'bar'}, 'return foo')
7+
const result = await callAsyncFunction({foo: 'bar'} as any, 'return foo')
68
expect(result).toEqual('bar')
79
})
810

911
test('throws on ReferenceError', async () => {
1012
expect.assertions(1)
1113

1214
try {
13-
await callAsyncFunction({}, 'proces')
15+
await callAsyncFunction({} as any, 'proces')
1416
} catch (err) {
1517
expect(err).toBeInstanceOf(ReferenceError)
1618
}
1719
})
1820

1921
test('can access process', async () => {
20-
await callAsyncFunction({}, 'process')
22+
await callAsyncFunction({} as any, 'process')
2123
})
2224

2325
test('can access console', async () => {
24-
await callAsyncFunction({}, 'console')
26+
await callAsyncFunction({} as any, 'console')
2527
})
2628
})

dist/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9274,7 +9274,7 @@ var core = __webpack_require__(470);
92749274
var lib_github = __webpack_require__(469);
92759275

92769276
// CONCATENATED MODULE: ./src/async-function.ts
9277-
const AsyncFunction = Object.getPrototypeOf(async () => { }).constructor;
9277+
const AsyncFunction = Object.getPrototypeOf(async () => null).constructor;
92789278
function callAsyncFunction(args, source) {
92799279
const fn = new AsyncFunction(...Object.keys(args), source);
92809280
return fn(...Object.values(args));
@@ -9300,7 +9300,7 @@ async function main() {
93009300
opts.previews = previews.split(',');
93019301
const github = new lib_github.GitHub(token, opts);
93029302
const script = Object(core.getInput)('script', { required: true });
9303-
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors.
9303+
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
93049304
const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context, core: core }, script);
93059305
let encoding = Object(core.getInput)('result-encoding');
93069306
encoding = encoding ? encoding : 'json';
@@ -9317,14 +9317,10 @@ async function main() {
93179317
}
93189318
Object(core.setOutput)('result', output);
93199319
}
9320+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
93209321
function handleError(err) {
93219322
console.error(err);
9322-
if (err && err.message) {
9323-
Object(core.setFailed)(err.message);
9324-
}
9325-
else {
9326-
Object(core.setFailed)(`Unhandled error: ${err}`);
9327-
}
9323+
Object(core.setFailed)(`Unhandled error: ${err}`);
93289324
}
93299325

93309326

docs/development.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ bash> npm run build
1515

1616
It also has a pre-commit hook configured via
1717
[husky](https://www.npmjs.com/package/husky) that should run the build script
18-
before each commit.
18+
before each commit. Additionally, this hook formats code and lints it, as
19+
well.
1920

2021
## Releasing
2122

0 commit comments

Comments
 (0)
0