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

Method parseConversionInfo

www/js/_hyperscript.js:6138–6153  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

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