MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / parseConversionInfo

Method parseConversionInfo

www/js/_hyperscript-max.js:6137–6152  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

6135 this.dontThrow = dontThrow;
6136 }
6137 static parseConversionInfo(parser) {
6138 var type = "text";
6139 var conversion;
6140 parser.matchToken("a") || parser.matchToken("an");
6141 if (parser.matchToken("json") || parser.matchToken("JSON") || parser.matchToken("Object")) {
6142 type = "json";
6143 } else if (parser.matchToken("response") || parser.matchToken("Response")) {
6144 type = "response";
6145 } else if (parser.matchToken("html") || parser.matchToken("HTML")) {
6146 type = "html";
6147 } else if (parser.matchToken("text") || parser.matchToken("Text") || parser.matchToken("String")) {
6148 } else {
6149 conversion = parser.requireElement("dotOrColonPath").evalStatically();
6150 }
6151 return { type, conversion };
6152 }
6153 static parse(parser) {
6154 if (!parser.matchToken("fetch")) return;
6155 parser.pushFollow("as");

Callers 1

parseMethod · 0.45

Calls 3

matchTokenMethod · 0.45
evalStaticallyMethod · 0.45
requireElementMethod · 0.45

Tested by

no test coverage detected