Skip to content

Instantly share code, notes, and snippets.

@garretmh
garretmh / jira_issue_key.ts
Created January 23, 2025 02:33
Parse a Jira issue ID
const JIRA_ISSUE_KEY_PATTERN =
/(?<![\w-])(?<project>[A-Z][A-Z0-9_]+)-(?<issue>[1-9][0-9]*)(?![\w-])/
const JIRA_ISSUE_KEYS_PATTERN =
/(?<![\w-])(?<project>[A-Z][A-Z0-9_]+)-(?<issues>[1-9][0-9]*(?:_[1-9][0-9]*)*)(?![\w-])/
@garretmh
garretmh / lib.es5.d.ts
Last active September 4, 2023 17:32
Proposed JSON type definition update
/** A parsed JSON value. */
export type json =
| string
| number
| boolean
| null
| json[]
| { [key: string]: json };
/** A JSON stringify-able value. */