INNER CODE UNIT · TypeScript

getCommandsConfigFromJson

peter-evans/slash-command-dispatch · src/command-helper.ts:131

export function getCommandsConfigFromJson(json: string): Command[] {
  const jsonConfig = JSON.parse(json)
  core.debug(`JSON config: ${inspect(jsonConfig)}`)

  const config: Command[] = []
  for (const jc of jsonConfig) {
    const cmd: Command = {
      command: jc.command,
      permission: jc.permission ? jc.permission : commandDefaults.permission,
      issue_type: jc.issue_type ? jc.issue_type : commandDefaults.issue_type,
      allow_edits: toBool(jc.allow_edits, commandDefaults.allow_edits),
      repository: jc.repository ? jc.repository : commandDefaults.repository,
      event_type_suffix: jc.event_type_suffix
        ? jc.event_type_suffix
        : commandDefaults.event_type_suffix,
      static_args: jc.static_args
        ? jc.static_args
        : commandDefaults.static_args,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…