INNER CODE UNIT · TypeScript
match
aws-devtools-labs/aws-blocks · native/swift/Demo/typescript-demo/aws-blocks/index.ts:105
const match = cookies.split('; ').find(c => c.startsWith(`${name}=`));
return match ? match.split('=')[1] : null;
},
async deleteCookie(name: string) {
context.response.headers.set('set-cookie', `${name}=; Max-Age=0; Secure; SameSite=None; Partitioned`);
return { success: true };
},
// DistributedTable example methods
async createTodo(title: string, priority: number = 2): Promise<Todo> {
const user = await auth.requireAuth(context);
// ULID: timestamp-based sortable ID
const ulid = Date.now().toString(36) + crypto.randomBytes(8).toString('hex');
const todo = {
userId: user.username,