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

Method parseConversionInfo

www/js/_hyperscript.esm.js:6136–6151  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

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