Convenient filter functions for roblox-ts functional programming
game.GetDescendants()
.filter(filterIsA("BasePart"))
.forEach(x => print(x.Size)); // Part | WedgePart | ...
game.GetDescendants()
.filter(filterClass("Script"))
.forEach(x => print(x.GetFullName())); // only Script objects, no LocalScript
game.GetDescendants()
.filter(filterIsA("BasePart"))
.filter(
filterProps({
Size: new Vector3(4, 4, 4)
})
)
.forEach(x => print(x.Size)); // 4, 4, 4