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

jscoord

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscoord - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

src/CoordChunk.js

3

index.js
module.exports = {
JSCoord: require("./JSCoord"),
JSCoord: require("./src/JSCoord"),
CoordChunk: require("./src/CoordChunk")
}
{
"name": "jscoord",
"version": "0.0.14",
"version": "0.0.15",
"description": "A simple Map coordinate system for NodeJS and potentially the browser.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -35,7 +35,7 @@ # JSCoord

## Properties
### Properties
#### `.x`, `.y`, `.z`
Get X, Y or Z value. **Do NOT modify these variables, they can break your coordinate set.**
Get X, Y or Z value. **Do NOT modify these variables, they can break your coordinate set.**

@@ -46,3 +46,3 @@ ```js

## Methods
### Methods

@@ -153,2 +153,68 @@ JSCoord provides some basic mutation methods. They can be used to modify the coordinate set in different ways.

coords.getRltArray() // [x, y, z]
```
```
## CoordChunk
CoordChunk is another feature of JSCoord. Its basically an Array of Sets with some extra functions. When creating a CoordChunk instance, you can pass a parameter to set the maximum size of the set.
```js
const { CoordChunk } = require("jscoord")
```
Or if you use Typescript/Webpack:
```ts
import { CoordChunk } from "jscoord";
```
Then, to create a new instance:
```js
let chunk = new CoordChunk(10)
```
### Properties
`.limit`
Maximum length of chunk. **Do NOT modify this variable, it can break your coordinate set.**
```js
chunk.limit
```
`.sets`
Array in which Sets are stored. **Do NOT modify this variable, it can break your coordinate set.**
```js
chunk.sets
```
### Methods
`.addSet(coords)`
Add a Set to the Chunk. `coords` can be an Array with coordinate values `([x, y, z])` or a JSCoord instance. You can not have 2 of the same coordinate sets in the same chunk.
```js
chunk.addSet(new JSCoord(100, 100, 100))
```
`.getSet(coords)`
Find a Set by coordinates. Throws if Set could not be found.
```js
chunk.getSet([100, 100, 100])
```
`.delSet(coords)`
Delete a Set from the Chunk. `coords` can be an Array with coordinate values or a JSCoord instance. Throws if Set could not be found.
```js
chunk.delSet([100, 100, 100])
```
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