Line data Source code
1 : /**
2 : * The charset every free-form identifier in the contract shares: plan slugs,
3 : * correlation ids, workspace ids, and the reference billing hands back. It is
4 : * deliberately narrower than what a URL permits, so nothing that survives it
5 : * can carry a path separator, a query delimiter, or a percent escape into a
6 : * downstream URL.
7 : */
8 2356 : const CONTRACT_IDENTIFIER = /^[A-Za-z0-9_-]{1,128}$/
9 :
10 0 : export function isContractIdentifier(value: string): boolean {
11 0 : return CONTRACT_IDENTIFIER.test(value)
12 : }
|