zod#record TypeScript Examples

The following examples show how to use zod#record. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: torrents.ts    From flood with GNU General Public License v3.0 6 votes vote down vote up
addTorrentByURLSchema = strictObject({
  // URLs to download torrents from
  urls: array(string()).nonempty(),
  // Cookies to attach to requests, arrays of strings in the format "name=value" with domain as key
  cookies: record(array(string())).optional(),
  // Path of destination
  destination: string().optional(),
  // Tags
  tags: array(string().regex(noComma, TAG_NO_COMMA_MESSAGE)).optional(),
  // Whether destination is the base path [default: false]
  isBasePath: boolean().optional(),
  // Whether destination contains completed contents [default: false]
  isCompleted: boolean().optional(),
  // Whether contents of a torrent should be downloaded sequentially [default: false]
  isSequential: boolean().optional(),
  // Whether to use initial seeding mode [default: false]
  isInitialSeeding: boolean().optional(),
  // Whether to start torrent [default: false]
  start: boolean().optional(),
})