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.6.2 to 0.6.3

2

package.json
{
"name": "squishjs",
"version": "0.6.2",
"version": "0.6.3",
"description": "squish & unsquish stuff",

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

```
> const { GameNode, Shapes, Colors, ShapeUtils, squish, unsquish } = require('squishjs');
>
> const redSquare = new GameNode.Shape({
coordinates2d: ShapeUtils.rectangle(40, 40, 20, 20),
fill: Colors.COLORS.RED,
shapeType: Shapes.POLYGON
});
> const squished = squish(redSquare);
... fill: Colors.COLORS.RED,
... coordinates2d: ShapeUtils.rectangle(20, 20, 60, 60),
... shapeType: Shapes.POLYGON
... });
>
> const squished = squish(redSquare.node);
> const unsquished = unsquish(squished);
>
> squished
[ 3, 5, 43, 3, 0 ]
[
3, 35, 43, 3, 0,
44, 2, 52, 22, 20,
0, 20, 0, 80, 0,
20, 0, 80, 0, 80,
0, 20, 0, 80, 0,
20, 0, 20, 0, 53,
6, 255, 0, 0, 255
]
>
> unsquished
InternalGameNode {
id: 0,
children: [],
color: undefined,
handleClick: undefined,
coordinates2d: [
20, 20, 80,
20, 80, 80,
20, 80, 20,
20
],
border: undefined,
fill: [ 255, 0, 0, 255 ],
text: undefined,
asset: undefined,
effects: null,
input: null,
listeners: Set {},
playerIds: []
}
```

@@ -6,2 +6,4 @@ class Game {

this.root = null;
this.intervals = [];
this.timeouts = [];
}

@@ -28,2 +30,26 @@

}
setInterval(fun, interval) {
const ticker = setInterval(fun, interval);
this.intervals.push(ticker);
return ticker;
}
setTimeout(fun, time) {
const timeout = setTimeout(fun, time);
this.timeouts.push(timeout);
return timeout;
}
close() {
for (const i in this.timeouts) {
const timeout = this.timeouts[i];
clearTimeout(timeout);
}
for (const i in this.intervals) {
const interval = this.intervals[i];
clearInterval(interval);
}
}
}

@@ -30,0 +56,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