MCPcopy Index your code
hub / github.com/microsoft/typescript-go / AsObject

Method AsObject

internal/packagejson/jsonvalue.go:65–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63}
64
65func (v JSONValue) AsObject() *collections.OrderedMap[string, JSONValue] {
66 if v.Type != JSONValueTypeObject {
67 panic(fmt.Sprintf("expected object, got %v", v.Type))
68 }
69 return v.Value.(*collections.OrderedMap[string, JSONValue])
70}
71
72func (v JSONValue) AsArray() []JSONValue {
73 if v.Type != JSONValueTypeArray {

Calls 1

panicFunction · 0.85

Tested by 2

testExportsFunction · 0.36
testJSONValueFunction · 0.36