MCPcopy Create free account
hub / github.com/melonjs/melonJS / setParser

Function setParser

packages/melonjs/src/loader/loader.js:357–367  ·  view source on GitHub ↗
(type, parserFn)

Source from the content-addressed store, hash-verified

355 * @category Assets
356 */
357export function setParser(type, parserFn) {
358 if (typeof parserFn !== "function") {
359 throw new Error("invalid parser function for " + type);
360 }
361
362 if (typeof parsers.get(type) !== "undefined") {
363 warning("overriding parser for " + type + " format");
364 }
365
366 parsers.set(type, parserFn);
367}
368
369/**
370 * set all the specified game assets to be preloaded.

Callers 1

initParsersFunction · 0.85

Calls 3

warningFunction · 0.90
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected