Repository: pixijs/pixijs
File: src/spritesheet/spritesheetAsset.ts (TypeScript)

Code before:
            const {
                texture: imageTexture, // if user need to use preloaded texture
                imageFilename, // if user need to use custom filename (not from jsonFile.meta.image)
                textureOptions // if user need to set texture options on texture
            } = options?.data ?? {};

            let basePath = path.dirname(options.src);

            if (basePath && basePath.lastIndexOf('/') !== (basePath.length - 1))
            {
                basePath += '/';
            }

            let texture: Texture;

            if (imageTexture instanceof Texture)
            {
                texture = imageTexture;
            }
            else
            {
                const imagePath = copySearchParams(basePath + (imageFilename ?? asset.meta.image), options.src);

                let assets;

                if (textureOptions)
                {
                    assets = await loader.load<Texture>([{ src: imagePath, data: textureOptions }]);
                }
                else
                {
                    assets = await loader.load<Texture>([imagePath]);
                }

                texture = assets[imagePath];
            }

            const spritesheet = new Spritesheet(
                texture.source,
                asset,
            );

            await spritesheet.parse();

            // Check and add the multi atlas
            // Heavily influenced and based on https://github.com/rocket-ua/pixi-tps-loader/blob/master/src/ResourceLoader.js
            const multiPacks = asset?.meta?.related_multi_packs;

            if (Array.isArray(multiPacks))
            {
                const promises: Promise<Spritesheet<SpriteSheetJson>>[] = [];

Review comment (suggestion):
I don't think we even need the `if (textureOptions)` check here as textureOptions can be null:

replacing the original line
`assets = await loader.load<Texture>([imagePath]);`

with
`assets = await loader.load<Texture>([{ src: imagePath, data: textureOptions}]);`

should work!


Code after:
            const {
                texture: imageTexture, // if user need to use preloaded texture
                imageFilename, // if user need to use custom filename (not from jsonFile.meta.image)
                textureOptions // if user need to set texture options on texture
            } = options?.data ?? {};

            let basePath = path.dirname(options.src);

            if (basePath && basePath.lastIndexOf('/') !== (basePath.length - 1))
            {
                basePath += '/';
            }

            let texture: Texture;

            if (imageTexture instanceof Texture)
            {
                texture = imageTexture;
            }
            else
            {
                const imagePath = copySearchParams(basePath + (imageFilename ?? asset.meta.image), options.src);

                const assets = await loader.load<Texture>([{ src: imagePath, data: textureOptions }]);

                texture = assets[imagePath];
            }

            const spritesheet = new Spritesheet(
                texture.source,
                asset,
            );

            await spritesheet.parse();

            // Check and add the multi atlas
            // Heavily influenced and based on https://github.com/rocket-ua/pixi-tps-loader/blob/master/src/ResourceLoader.js
            const multiPacks = asset?.meta?.related_multi_packs;

            if (Array.isArray(multiPacks))
            {
                const promises: Promise<Spritesheet<SpriteSheetJson>>[] = [];

                for (const item of multiPacks)
                {
                    if (typeof item !== 'string')
                    {
                        continue;
                    }

                    let itemUrl = basePath + item;