MCPcopy Create free account

hub / github.com/tailscale/hujson / functions

Functions134 in github.com/tailscale/hujson

↓ 16 callersMethodbeforeExtraAt
(int)
types.go:516
↓ 14 callersFunctionParse
Parse parses a HuJSON value as a Value. Extra and Literal values in v will alias the provided input buffer.
parse.go:24
↓ 14 callersFunctionconsumeWhitespace
(b []byte)
parse.go:241
↓ 14 callersMethodhasNewline
(checkTopLevelExtra bool)
format.go:579
↓ 12 callersMethodafterExtra
()
types.go:517
↓ 11 callersMethodPack
Pack serializes the value as HuJSON. The output is valid so long as every Extra and Literal in the Value is valid. The output does not alias the memor
pack.go:51
↓ 10 callersMethodformat
(depth int, opts formatOptions)
format.go:358
↓ 9 callersMethodIsStandard
IsStandard reports whether this is standard JSON by checking that there are no comments and no trailing commas.
standard.go:9
↓ 9 callersMethodlength
()
types.go:505
↓ 8 callersMethodClone
Clone returns a deep copy of the value.
types.go:141
↓ 8 callersMethodString
String is a string representation of v.
pack.go:56
↓ 8 callersMethodallValues
()
types.go:508
↓ 8 callersFunctioncopyBytes
(b []byte)
types.go:556
↓ 7 callersMethodlineStats
()
format.go:223
↓ 6 callersMethodhasComment
()
standard.go:36
↓ 6 callersMethodlastValue
()
types.go:509
↓ 6 callersFunctionnewInvalidCharacterError
(prefix []byte, where string)
parse.go:268
↓ 5 callersMethodBool
Bool returns the value for a JSON boolean. It returns false if the literal is not a JSON boolean.
types.go:305
↓ 5 callersMethodKind
Kind represents each possible JSON literal kind with a single byte, which is conveniently the first byte of that kind's grammar with the restriction t
types.go:281
↓ 5 callersMethodKind
()
types.go:504
↓ 5 callersFunctionconsumeComment
consumeComment consumes a line or block comment start in b. It returns the length of the comment if valid, otherwise it returns 0 if it is not a comme
parse.go:251
↓ 5 callersMethodfind
(s findState)
find.go:39
↓ 5 callersFunctionhasTrailingComma
(comp composite)
types.go:520
↓ 5 callersFunctionsetTrailingComma
(comp composite, v bool)
types.go:526
↓ 4 callersMethodFormat
Format formats the value according to some opinionated heuristics for how HuJSON should look. The exact output may change over time. It is the equival
format.go:73
↓ 4 callersMethodStandardize
Standardize strips any features specific to HuJSON from v, making it compliant with standard JSON per RFC 8259. All comments and trailing commas are r
standard.go:62
↓ 4 callersMethodclassifyComments
classifyComments classifies comments as belonging to the previous element or belonging to the current element such that: - b[:prevEnd] belongs to the
patch.go:424
↓ 4 callersMethodextractTrailingcomments
extractTrailingcomments extracts trailing comments from the top of b. If readonly, then the source is not mutated.
patch.go:406
↓ 4 callersFunctionparseNext
parseNext parses the next value with surrounding whitespace and comments.
parse.go:38
↓ 3 callersMethodMinimize
Minimize removes all whitespace, comments, and trailing commas from v, making it compliant with standard JSON per RFC 8259.
standard.go:42
↓ 3 callersMethodUpdateOffsets
UpdateOffsets iterates through v and updates all Value.StartOffset and Value.EndOffset fields so that they are accurate.
pack.go:9
↓ 3 callersFunctionappendIndent
(b []byte, n int)
format.go:597
↓ 3 callersFunctionconsumeExtra
consumeExtra consumes leading whitespace and comments.
parse.go:216
↓ 3 callersMethodextractLeadingComments
extractLeadingComments extracts leading comments from the bottom of b. If readonly, then the source is not mutated.
patch.go:377
↓ 3 callersMethodinjectTrailingComments
injectTrailingComments injects trailing comments into the top of b.
patch.go:388
↓ 3 callersFunctionprocessFile
(info fs.FileInfo, filename string, in io.Reader)
cmd/hujsonfmt/hujsonfmt.go:101
↓ 2 callersMethodAll
All returns an iterator over all values in depth-first order, starting with v itself.
types.go:164
↓ 2 callersMethodIsValid
IsValid reports whether the whitespace and comments are valid according to the HuJSON grammar.
types.go:551
↓ 2 callersMethodPatch
TODO(dsnet): Insert/remove operations on an array has O(n) complexity where n is the length of the array. We could improve this with more clever data
patch.go:46
↓ 2 callersFunctionString
String constructs a JSON literal for string. Invalid UTF-8 is mangled with the Unicode replacement character.
types.go:213
↓ 2 callersMethodappend
(b []byte)
pack.go:60
↓ 2 callersMethodclone
clone returns a deep copy of the value.
types.go:187
↓ 2 callersMethodinjectLeadingComments
injectLeadingComments injects leading comments into the bottom of b.
patch.go:360
↓ 2 callersFunctioninsertAt
(comp composite, i int, v Value)
patch.go:340
↓ 2 callersMethodpatchAdd
(i int, op patchOperation)
patch.go:142
↓ 2 callersFunctionremoveAt
(comp composite, i int)
patch.go:347
↓ 2 callersFunctionreplaceAt
(comp composite, i int, v Value)
patch.go:335
↓ 1 callersMethodFind
Find locates the value specified by the JSON pointer (see RFC 6901). It returns nil if the value does not exist or the pointer is invalid. If a JSON o
find.go:22
↓ 1 callersFunctionFormat
Format formats b according to some opinionated heuristics for how HuJSON should look. The exact output may change over time. It is the equivalent of `
format.go:46
↓ 1 callersFunctionMinimize
Minimize removes all whitespace, comments, and trailing commas from b, making it compliant with standard JSON per RFC 8259. If an error is encountered
format.go:29
↓ 1 callersFunctionStandardize
Standardize strips any features specific to HuJSON from b, making it compliant with standard JSON per RFC 8259. All comments and trailing commas are r
format.go:17
↓ 1 callersMethodString
String returns the unescaped string value for a JSON string. For other JSON kinds, this returns the raw JSON represention.
types.go:311
↓ 1 callersMethodalignObjectValues
alignObjectValues aligns object values by inserting spaces after the name so that the values are aligned to the same column. It always returns true t
format.go:509
↓ 1 callersFunctionbackupFile
( filename string, data []byte, perms fs.FileMode, )
cmd/hujsonfmt/hujsonfmt.go:220
↓ 1 callersFunctioncopyAt
Preserving and moving comments is impossible to perform reasonably in all conceivable situations given that the placement of comments is more a matter
patch.go:329
↓ 1 callersMethodequalString
(s string)
find.go:97
↓ 1 callersFunctionequalValue
(x, y Value)
patch.go:222
↓ 1 callersMethodexpandComposites
expandComposites populates needExpand with the set of composite values that need to be expanded (i.e., print each member/element on a new line). This
format.go:141
↓ 1 callersMethodformatWhitespace
formatWhitespace mutates the AST and formats whitespace to ensure consistent indentation and expansion of objects and arrays.
format.go:259
↓ 1 callersMethodgetAt
(int)
types.go:511
↓ 1 callersFunctionhasPathPrefix
hasPathPrefix is a stricter version of strings.HasPrefix where the prefix must end on a path segment boundary.
patch.go:215
↓ 1 callersMethodinsertAt
(int, ValueTrimmed)
types.go:513
↓ 1 callersFunctionisHuJSONFile
(f fs.DirEntry)
cmd/hujsonfmt/hujsonfmt.go:97
↓ 1 callersMethodisStandard
()
standard.go:12
↓ 1 callersMethodlength
()
types.go:374
↓ 1 callersMethodlength
()
types.go:447
↓ 1 callersFunctionlineColumn
(b []byte, n int)
parse.go:16
↓ 1 callersFunctionmainE
()
cmd/hujsonfmt/hujsonfmt.go:49
↓ 1 callersMethodminimize
()
standard.go:46
↓ 1 callersMethodnormalize
normalize performs simple normalization changes. In particular, it: - normalizes strings, - normalizes empty objects and arrays as simply {} or [], -
format.go:98
↓ 1 callersFunctionparseNextTrimmed
parseNextTrimmed parses the next value without surrounding whitespace and comments.
parse.go:73
↓ 1 callersFunctionparsePatch
(patch []byte)
patch.go:77
↓ 1 callersMethodpatchMoveOrCopy
(i int, op patchOperation)
patch.go:182
↓ 1 callersMethodpatchRemoveOrReplace
(i int, op patchOperation)
patch.go:165
↓ 1 callersMethodpatchTest
(i int, op patchOperation)
patch.go:201
↓ 1 callersFunctionprintDiff
(filename string, src, modified []byte)
cmd/hujsonfmt/hujsonfmt.go:173
↓ 1 callersFunctionprocessSrc
(src []byte)
cmd/hujsonfmt/hujsonfmt.go:155
↓ 1 callersFunctionreadFile
(path string, in io.Reader)
cmd/hujsonfmt/hujsonfmt.go:137
↓ 1 callersMethodremoveAt
(int)
types.go:514
↓ 1 callersMethodsetAt
(int, ValueTrimmed)
types.go:512
↓ 1 callersMethodstandardize
()
standard.go:66
↓ 1 callersMethodupdateOffsets
(n int)
pack.go:12
↓ 1 callersFunctionusage
()
cmd/hujsonfmt/hujsonfmt.go:35
↓ 1 callersFunctionwriteFile
(info fs.FileInfo, filename string, src, data []byte)
cmd/hujsonfmt/hujsonfmt.go:192
FunctionBool
e.g., null, false, true, "string", or 3.14159 Bool constructs a JSON literal for a boolean.
types.go:203
FunctionFloat
Float construct a JSON literal for a floating-point number. The values NaN, +Inf, and -Inf will be represented as a JSON string with the values "NaN",
types.go:260
MethodFloat
Float returns the floating-point value for a JSON number. It returns a NaN, +Inf, or -Inf value for any JSON string with the values "NaN", "Infinity",
types.go:340
FunctionFuzz
(f *testing.F)
fuzz_test.go:15
FunctionFuzzPatch
(f *testing.F)
fuzz_test.go:69
FunctionInt
Int construct a JSON literal for a signed integer.
types.go:248
MethodInt
Int returns the signed integer value for a JSON number. It returns 0 if the literal is not a signed integer.
types.go:320
MethodIsStandard
IsStandard reports whether this is standard JSON whitespace.
standard.go:33
MethodIsValid
IsValid reports whether b is a valid JSON null, boolean, string, or number. The literal must not have surrounding whitespace.
types.go:297
MethodKind
Kind reports the kind of the JSON value.
types.go:185
MethodKind
()
types.go:430
MethodKind
()
types.go:498
MethodRange
Range iterates through a Value in depth-first order and calls f for each value (including the root value). It stops iteration when f returns false. D
types.go:153
FunctionTest
(t *testing.T)
json_test.go:280
FunctionTestAll
(t *testing.T)
types_test.go:9
FunctionTestFind
(t *testing.T)
find_test.go:13
next →1–100 of 134, ranked by callers