Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

squishjs

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

squishjs - npm Package Compare versions

Comparing version 0.7.2 to 0.7.3

2

package.json
{
"name": "squishjs",
"version": "0.7.2",
"version": "0.7.3",
"description": "squish & unsquish stuff",

@@ -5,0 +5,0 @@ "scripts": {

@@ -22,3 +22,3 @@ const ASSET_TYPE = 1;

this.state = this.squish(this.game.getLayers());
this.spectatorState = this.game.getSpectatorLayers ? this.squish(this.game.getSpectatorLayers()) : [];
// this.spectatorState = this.game.getSpectatorLayers ? this.squish(this.game.getSpectatorLayers()) : [];
this.assets = {};

@@ -84,3 +84,3 @@ if (this.game.tick) {

if (this.customTopLayer) {
if (this.customTopLayer) {
const squishedLayer = [];

@@ -100,3 +100,3 @@ this.squishHelper(this.customTopLayer.root, squishedLayer, this.customTopLayer.scale, playerMap);

squishHelper(node, squishedNodes, scale = {x: 1, y: 1}, playerMap = {}) {
squishHelper(node, squishedNodes, scale = {x: 1, y: 1}, playerMap = {}, playerIdFilter = new Set()) {
if (!node.node.listeners.has(this)) {

@@ -109,5 +109,8 @@ node.addListener(this);

if (playerMap) {
if (node.node.playerIds && node.node.playerIds.length) {
node.node.playerIds.forEach(playerId => {
if (node.node.playerIds && node.node.playerIds.length > 0) {
node.node.playerIds.forEach(pId => playerIdFilter.add(pId));
}
if (playerIdFilter.size > 0) {
for (let playerId of playerIdFilter) {
if (playerMap[playerId]) {

@@ -118,12 +121,14 @@ playerMap[playerId].push(squished);

}
});
} else {
Object.keys(playerMap).forEach(playerId => {
playerMap[playerId].push(squished);
})
}
}
} else {
Object.keys(playerMap).forEach(playerId => {
playerMap[playerId].push(squished);
})
}
for (let i = 0; i < node.node.children.length; i++) {
this.squishHelper(node.node.children[i], squishedNodes, scale, playerMap);
// make a new set so child calls within a single generation arent
// modifying the same filter set
const pathFilter = new Set(playerIdFilter);
this.squishHelper(node.node.children[i], squishedNodes, scale, playerMap, pathFilter);
}

@@ -130,0 +135,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc