Open this example in the interactive library
Source code
type Area = "jobs" | "users";
type Action = "read" | "write";
console.log(((permission: `${Area}:${Action}`) => permission)("jobs:read"));
Sample output
jobs:read

Open this example in the interactive library
type Area = "jobs" | "users";
type Action = "read" | "write";
console.log(((permission: `${Area}:${Action}`) => permission)("jobs:read"));
jobs:read