add an underscore to numbered filenames
Here's an example, the file is http://images.neopets.com/cp/items/data/000/000/546/546022_1132b0ffeb/546022.js and the constructor is _546022, to account for the fact that JS syntax won't allow a plain number there.
This commit is contained in:
parent
507d0709e4
commit
a4d159381c
1 changed files with 3 additions and 0 deletions
|
@ -213,6 +213,9 @@ export function OutfitCanvasMovie({ librarySrc, zIndex }) {
|
|||
const fileName = librarySrc.split("/").pop();
|
||||
const fileNameWithoutExtension = fileName.split(".")[0];
|
||||
constructorName = fileNameWithoutExtension.replace(/[ -]/g, "");
|
||||
if (constructorName.match(/^[0-9]+$/)) {
|
||||
constructorName = "_" + constructorName;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(
|
||||
`Movie librarySrc %s did not match expected format: %o`,
|
||||
|
|
Loading…
Reference in a new issue