MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / assert_null_string_or_array

Function assert_null_string_or_array

MathBox/mathbox-core.js:33428–33439  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

33426 }
33427
33428 function assert_null_string_or_array(x, y) {
33429 switch(typeof x) {
33430 case 'string': if(y !== x) {
33431 unexpected('expected `'+x+'`, got '+y+'\n'+token.data);
33432 } return !errored
33433
33434 case 'object': if(x && x.indexOf(y) === -1) {
33435 unexpected('expected one of `'+x.join('`, `')+'`, got '+y);
33436 } return !errored
33437 }
33438 return true
33439 }
33440
33441 // stative ----------------------------
33442

Callers 1

assertFunction · 0.70

Calls 1

unexpectedFunction · 0.70

Tested by

no test coverage detected