UNPKG

@bscotch/stitch

Version:

Stitch: The GameMaker Studio 2 Asset Pipeline Development Kit.

21 lines 880 B
/** @file Extend the generic Gms2ComponentArray to add folders-specific contents */ import { Gms2ComponentArray } from './components/Gms2ComponentArray.js'; import { Gms2Folder } from './components/Gms2Folder.js'; export class Gms2FolderArray extends Gms2ComponentArray { constructor(data) { super(data, Gms2Folder); } /** * Given a "module" name, find all folders making up that module. * For example, for module "BscotchPack" any folder (as seen in the IDE) * ending with "/BscotchPack" is part of that module. Case-insensitive. */ findModuleFolders(module) { return this.items.filter((item) => { const subdirs = item.path.split('/'); return (subdirs[subdirs.length - 1].toLocaleLowerCase() == module.toLocaleLowerCase()); }); } } //# sourceMappingURL=Gms2FolderArray.js.map