1local assertNames(fun, params) = assert test.paramNames(std[fun]) == params: "Wrong params for std.%s, expected %s, got %s" % [fun, params, test.paramNames(std[fun])]; true;23local names = {4 id: ['x'],5 isString: ['v'],6 isNumber: ['v'],7 isBoolean: ['v'],8 isObject: ['v'],9 isArray: ['v'],10 isFunction: ['v'],11 toString: ['a'],12 substr: ['str', 'from', 'len'],13 startsWith: ['a', 'b'],14 endsWith: ['a', 'b'],15 lstripChars: ['str', 'chars'],16 rstripChars: ['str', 'chars'],17 stripChars: ['str', 'chars'],18 stringChars: ['str'],19 parseInt: ['str'],20 parseOctal: ['str'],21 parseHex: ['str'],22 split: ['str', 'c'],23 splitLimit: ['str', 'c', 'maxsplits'],24 splitLimitR: ['str', 'c', 'maxsplits'],25 strReplace: ['str', 'from', 'to'],26 asciiUpper: ['str'],27 asciiLower: ['str'],28 range: ['from', 'to'],29 repeat: ['what', 'count'],30 slice: ['indexable', 'index', 'end', 'step'],31 member: ['arr', 'x'],32 count: ['arr', 'x'],33 mod: ['a', 'b'],34 map: ['func', 'arr'],35 mapWithIndex: ['func', 'arr'],36 mapWithKey: ['func', 'obj'],37 flatMap: ['func', 'arr'],38 join: ['sep', 'arr'],39 lines: ['arr'],40 deepJoin: ['arr'],41 format: ['str', 'vals'],42 foldr: ['func', 'arr', 'init'],43 foldl: ['func', 'arr', 'init'],44 filterMap: ['filter_func', 'map_func', 'arr'],45 assertEqual: ['a', 'b'],46 abs: ['n'],47 sign: ['n'],48 max: ['a', 'b'],49 min: ['a', 'b'],50 clamp: ['x', 'minVal', 'maxVal'],51 flattenArrays: ['arrs'],52 manifestIni: ['ini'],53 manifestToml: ['value'],54 manifestTomlEx: ['value', 'indent'],55 escapeStringJson: ['str_'],56 escapeStringPython: ['str'],57 escapeStringBash: ['str_'],58 escapeStringDollars: ['str_'],59 escapeStringXML: ['str_'],60 manifestJson: ['value'],61 manifestJsonMinified: ['value'],62 manifestJsonEx: ['value', 'indent', 'newline', 'key_val_sep'],63 manifestYamlDoc: ['value', 'indent_array_in_object', 'quote_keys'],64 manifestYamlStream: ['value', 'indent_array_in_object', 'c_document_end', 'quote_keys'],65 manifestPython: ['v'],66 manifestPythonVars: ['conf'],67 manifestXmlJsonml: ['value'],68 base64: ['input'],69 base64DecodeBytes: ['str'],70 base64Decode: ['str'],71 reverse: ['arr'],72 sort: ['arr', 'keyF'],73 uniq: ['arr', 'keyF'],74 set: ['arr', 'keyF'],75 setMember: ['x', 'arr', 'keyF'],76 setUnion: ['a', 'b', 'keyF'],77 setInter: ['a', 'b', 'keyF'],78 setDiff: ['a', 'b', 'keyF'],79 mergePatch: ['target', 'patch'],80 get: ['o', 'f', 'default', 'inc_hidden'],81 objectFields: ['o'],82 objectFieldsAll: ['o'],83 objectHas: ['o', 'f'],84 objectHasAll: ['o', 'f'],85 objectValues: ['o'],86 objectValuesAll: ['o'],87 equals: ['a', 'b'],88 resolvePath: ['f', 'r'],89 prune: ['a'],90 findSubstr: ['pat', 'str'],91 find: ['value', 'arr'],92 all: ['arr'],93 any: ['arr'],9495 makeArray: ['sz', 'func'],96 pow: ['x', 'n'],97 floor: ['x'],98 ceil: ['x'],99 sqrt: ['x'],100 sin: ['x'],101 cos: ['x'],102 tan: ['x'],103 asin: ['x'],104 acos: ['x'],105 atan: ['x'],106 type: ['x'],107 filter: ['func', 'arr'],108 objectHasEx: ['obj', 'fname', 'hidden'],109 length: ['x'],110 objectFieldsEx: ['obj', 'hidden'],111 codepoint: ['str'],112 char: ['n'],113 log: ['x'],114 exp: ['x'],115 mantissa: ['x'],116 exponent: ['x'],117 modulo: ['x', 'y'],118 extVar: ['x'],119 primitiveEquals: ['x', 'y'],120 native: ['x'],121 md5: ['s'],122 trace: ['str', 'rest'],123 parseJson: ['str'],124 parseYaml: ['str'],125 encodeUTF8: ['str'],126 decodeUTF8: ['arr'],127128 sum: ['arr'],129 avg: ['arr', 'onEmpty'],130 minArray: ['arr', 'keyF', 'onEmpty'],131 maxArray: ['arr', 'keyF', 'onEmpty'],132 remove: ['arr', 'elem'],133 contains: ['arr', 'elem'],134 removeAt: ['arr', 'at'],135136 equalsIgnoreCase: ['str1', 'str2'],137 isEmpty: ['str'],138139 xor: ['x', 'y'],140 xnor: ['x', 'y'],141 isInteger: ['x'],142 isDecimal: ['x'],143 isEven: ['x'],144 isOdd: ['x'],145 round: ['x'],146147 sha1: ['str'],148 sha256: ['str'],149 sha512: ['str'],150 sha3: ['str'],151152 objectKeysValues: ['o'],153 objectKeysValuesAll: ['o'],154 objectRemoveKey: ['obj', 'key'],155156 157 __compare: ['v1', 'v2'],158 __compare_array: ['arr1', 'arr2'],159 __array_less: ['arr1', 'arr2'],160 __array_greater: ['arr1', 'arr2'],161 __array_less_or_equal: ['arr1', 'arr2'],162 __array_greater_or_equal: ['arr1', 'arr2'],163};164165std.all(std.map(function(key) assertNames(key, names[key]), std.objectFields(names)))166&& std.all([167 assert std.objectHasAll(names, key): ('function "%s" is not defined in names'168 % key); true,169 for key in std.objectFieldsAll(std)170 if key != 'thisFile'171])