Skip to content

Latest commit

 

History

History
101 lines (45 loc) · 1.42 KB

API_MODIFIERS.md

File metadata and controls

101 lines (45 loc) · 1.42 KB

Repeat last generator

Rules:

  • (function genFn, int min = 1, int max = 10) -> *
  • (function genFn, int min = 1, int max = 10, string join) -> *
  • (function genFn, int length) -> *
  • (function genFn, int length, string join) -> *
  • (function genFn) -> *
  • (function genFn, string join) -> *

Examples:

yod('@Bool.repeat(2)')       // => some thing like: [true, false]
yod('@Int.repeat(3, "-")')   // => some thing like: "20-3-12"

Get indexed item in an array or indexed character in a string

Rules:

  • (* arg) -> *
  • (* arg, int i = 0) -> *

Examples:

yod('@([1, 2, 3]).index(2)');  // => 3
yod('@(abc).index(2)');        // => 'c'

Call JSON.stringify on obj

Rules:

  • (* obj) -> string

Upper case first letter in every word

Rules:

  • (string str) -> string

Upper case first letter in str

Rules:

  • (string str) -> string

Upper case all letters in str

Rules:

  • (string str) -> string

Lower case all letters in str

Rules:

  • (string str) -> string