INNER CODE UNIT · TypeScript

stripQuotes

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

function stripQuotes(input: string): string {
  if (input.startsWith(`"`) && input.endsWith(`"`)) {
    return input.slice(1, input.length - 1)
  } else {
    return input
  }
}

export function getSlashCommandPayload(
  commandTokens: string[],
  staticArgs: string[]
): SlashCommandPayload {
  const payload: SlashCommandPayload = {
    command: commandTokens[0],
    args: {
      all: '',
      unnamed: {
        all: ''

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…