difftreelog
fix add missing stdlib functions
in: master
1 file changed
crates/jrsonnet-stdlib/src/std.jsonnetdiffbeforeafterboth25 stringChars(str)::25 stringChars(str)::26 std.makeArray(std.length(str), function(i) str[i]),26 std.makeArray(std.length(str), function(i) str[i]),272728 splitLimitR(str, c, maxsplits)::29 if maxsplits == -1 then30 std.splitLimit(str, c, -1)31 else32 local revStr(str) = std.join('', std.reverse(std.stringChars(str)));33 std.map(function(e) revStr(e), std.reverse(std.splitLimit(revStr(str), revStr(c), maxsplits))),3428 split(str, c):: std.splitLimit(str, c, -1),35 split(str, c):: std.splitLimit(str, c, -1),293630 mapWithIndex(func, arr)::37 mapWithIndex(func, arr)::121 ch;128 ch;122 std.foldl(function(a, b) a + trans(b), std.stringChars(str), ''),129 std.foldl(function(a, b) a + trans(b), std.stringChars(str), ''),123130131 local xml_escapes = {132 '<': '<',133 '>': '>',134 '&': '&',135 '"': '"',136 "'": ''',137 },138139 escapeStringXML(str_)::140 local str = std.toString(str_);141 std.join('', [std.get(xml_escapes, ch, ch) for ch in std.stringChars(str)]),142124 manifestJson(value):: std.manifestJsonEx(value, ' ') tailstrict,143 manifestJson(value):: std.manifestJsonEx(value, ' ') tailstrict,125144126 manifestJsonMinified(value):: std.manifestJsonEx(value, '', '', ':'),145 manifestJsonMinified(value):: std.manifestJsonEx(value, '', '', ':'),127146128 manifestYamlStream(value, indent_array_in_object=false, c_document_end=true)::147 manifestYamlStream(value, indent_array_in_object=false, c_document_end=true, quote_keys=true)::129 if !std.isArray(value) then148 if !std.isArray(value) then130 error 'manifestYamlStream only takes arrays, got ' + std.type(value)149 error 'manifestYamlStream only takes arrays, got ' + std.type(value)131 else150 else132 '---\n' + std.join(151 '---\n' + std.join(133 '\n---\n', [std.manifestYamlDoc(e, indent_array_in_object) for e in value]152 '\n---\n', [std.manifestYamlDoc(e, indent_array_in_object, quote_keys) for e in value]134 ) + if c_document_end then '\n...\n' else '\n',153 ) + if c_document_end then '\n...\n' else '\n',135136154137 manifestPython(v)::155 manifestPython(v)::138 if std.isObject(v) then156 if std.isObject(v) then