Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exts.forEach((ext) => {
const { error } = resource[getName(ext)];
if (error) {
throw error.message;
}
});
const rawSkel = getSkelJson(resource[getName('skel')].data);
const rawAtlas = resource[getName('atlas')].data;
const rawPng = resource[getName('png')].data;
const spineAtlas = new spine.SpineRuntime.Atlas(rawAtlas, (line, callback) => {
callback(new PIXI.BaseTexture(rawPng));
});
const spineAtlasParser = new spine.SpineRuntime.AtlasAttachmentParser(spineAtlas);
const spineJsonParser = new spine.SpineRuntime.SkeletonJsonParser(spineAtlasParser);
cache[dollCode][type][skinCode] = spineJsonParser.readSkeletonData(rawSkel);
}
return cache[dollCode][type][skinCode];
}
);
});
const resources = await new Promise(resolve => loader.load((_, res) => resolve(res)));
Object.values(resources).forEach((resource) => {
const { error } = resource;
if (error) {
throw new Error(error.message);
}
});
const rawSkel = getSkelJson(resources[getName('skel')].data);
const rawAtlas = resources[getName('atlas')].data;
const rawPng = resources[getName('png')].data;
const spineAtlas = new spine.SpineRuntime.Atlas(rawAtlas, (line, callback) => {
callback(new PIXI.BaseTexture(rawPng));
});
const spineAtlasParser = new spine.SpineRuntime.AtlasAttachmentParser(spineAtlas);
const spineJsonParser = new spine.SpineRuntime.SkeletonJsonParser(spineAtlasParser);
return spineJsonParser.readSkeletonData(rawSkel);
}
resource = await new Promise(resolve => loader.load((_, res) => resolve(res)));
}
loader.destroy(true);
exts.forEach((ext) => {
const { error } = resource[getName(ext)];
if (error) {
throw error.message;
}
});
const rawSkel = getSkelJson(resource[getName('skel')].data);
const rawAtlas = resource[getName('atlas')].data;
const rawPng = resource[getName('png')].data;
const spineAtlas = new spine.SpineRuntime.Atlas(rawAtlas, (line, callback) => {
callback(new PIXI.BaseTexture(rawPng));
});
const spineAtlasParser = new spine.SpineRuntime.AtlasAttachmentParser(spineAtlas);
const spineJsonParser = new spine.SpineRuntime.SkeletonJsonParser(spineAtlasParser);
cache[dollCode][type][skinCode] = spineJsonParser.readSkeletonData(rawSkel);
}
return cache[dollCode][type][skinCode];
}
const resources = await new Promise(resolve => loader.load((_, res) => resolve(res)));
Object.values(resources).forEach((resource) => {
const { error } = resource;
if (error) {
throw new Error(error.message);
}
});
const rawSkel = getSkelJson(resources[getName('skel')].data);
const rawAtlas = resources[getName('atlas')].data;
const rawPng = resources[getName('png')].data;
const spineAtlas = new spine.SpineRuntime.Atlas(rawAtlas, (line, callback) => {
callback(new PIXI.BaseTexture(rawPng));
});
const spineAtlasParser = new spine.SpineRuntime.AtlasAttachmentParser(spineAtlas);
const spineJsonParser = new spine.SpineRuntime.SkeletonJsonParser(spineAtlasParser);
return spineJsonParser.readSkeletonData(rawSkel);
}