MCPcopy
hub / github.com/bigskysoftware/htmx / matchToken

Function matchToken

www/static/test/lib/_hyperscript.js:340–348  ·  view source on GitHub ↗

* @param {string} value * @param {string} [type] * @returns {Token | void}

(value, type)

Source from the content-addressed store, hash-verified

338 * @returns {Token | void}
339 */
340 function matchToken(value, type) {
341 if (follows.indexOf(value) !== -1) {
342 return; // disallowed token here
343 }
344 var type = type || "IDENTIFIER";
345 if (currentToken() && currentToken().value === value && currentToken().type === type) {
346 return consumeToken();
347 }
348 }
349
350 /**
351 * @returns {Token}

Callers 2

matchAnyTokenFunction · 0.70
requireTokenFunction · 0.70

Calls 2

currentTokenFunction · 0.70
consumeTokenFunction · 0.70

Tested by

no test coverage detected