MCPcopy Index your code
hub / github.com/microsoft/SandDance / testBinary

Function testBinary

docs/app/js/sanddance-app.js:57166–57177  ·  view source on GitHub ↗
(data, byteOffset, loader, test)

Source from the content-addressed store, hash-verified

57164 });
57165}
57166function testBinary(data, byteOffset, loader, test) {
57167 if (test instanceof ArrayBuffer) return (0, _loaderUtils.compareArrayBuffers)(test, data, test.byteLength);
57168 switch((0, _typeofDefault.default)(test)){
57169 case "function":
57170 return test(data, loader);
57171 case "string":
57172 var magic = getMagicString(data, byteOffset, test.length);
57173 return test === magic;
57174 default:
57175 return false;
57176 }
57177}
57178function getFirstCharacters(data) {
57179 var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
57180 if (typeof data === "string") return data.slice(0, length);

Callers 1

testDataAgainstBinaryFunction · 0.70

Calls 2

testFunction · 0.70
getMagicStringFunction · 0.70

Tested by

no test coverage detected