Skip to content

Commit

Permalink
rename: unsupported REST API inputs constant name (#1872)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored Jan 18, 2024
1 parent 6c9dcea commit cbd5907
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/constant.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Inputs} from './inputs'

export const UNSUPPORTED_REST_API_INPUTS: Partial<Inputs> = {
export const DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS: Partial<Inputs> = {
sha: '',
baseSha: '',
since: '',
Expand Down
10 changes: 6 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {createInterface} from 'readline'
import {parseDocument} from 'yaml'
import {ChangedFiles, ChangeTypeEnum} from './changedFiles'
import {DiffResult} from './commitSha'
import {UNSUPPORTED_REST_API_INPUTS} from './constant'
import {DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS} from './constant'
import {Inputs} from './inputs'

const MINIMUM_GIT_VERSION = '2.18.0'
Expand Down Expand Up @@ -1520,12 +1520,14 @@ export const warnUnsupportedRESTAPIInputs = async ({
}: {
inputs: Inputs
}): Promise<void> => {
for (const key of Object.keys(UNSUPPORTED_REST_API_INPUTS)) {
for (const key of Object.keys(DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS)) {
const defaultValue = Object.hasOwnProperty.call(
UNSUPPORTED_REST_API_INPUTS,
DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS,
key
)
? UNSUPPORTED_REST_API_INPUTS[key as keyof Inputs]?.toString()
? DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS[
key as keyof Inputs
]?.toString()
: ''

if (defaultValue !== inputs[key as keyof Inputs]?.toString()) {
Expand Down

0 comments on commit cbd5907

Please sign in to comment.