Skip to content

Commit

Permalink
rename: unsupported REST API inputs constant name
Browse files Browse the repository at this point in the history
- Rename `UNSUPPORTED_REST_API_INPUTS` constant to `DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS` in `constant.ts`.
- Update references of former constant `UNSUPPORTED_REST_API_INPUTS` to new `DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS` in `utils.ts`.
  • Loading branch information
jackton1 committed Jan 18, 2024
1 parent 6c9dcea commit fb79495
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
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 fb79495

Please sign in to comment.