@woosh/meep-engine 2.39.34 → 2.39.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,6 +47,14 @@ export default class IndexedBinaryBVH {
47
47
  this.data = new Float32Array(16);
48
48
  }
49
49
 
50
+ /**
51
+ *
52
+ * @returns {number}
53
+ */
54
+ estimateByteSize(){
55
+ return this.data.buffer.byteLength + 248;
56
+ }
57
+
50
58
  /**
51
59
  *
52
60
  * @param {int} leafCount
@@ -182,7 +182,7 @@ export class Signal {
182
182
  * @returns {boolean} true if a handler was removed, false otherwise
183
183
  */
184
184
  remove(h, thisArg) {
185
- assert.typeOf(h, "function", "handler");
185
+ assert.isFunction(h, "handler");
186
186
 
187
187
  if (thisArg === undefined) {
188
188
  return removeHandlerByHandler(this, h);
@@ -707,7 +707,7 @@ function removeHandlerByHandlerAndContext(signal, h, ctx) {
707
707
  }
708
708
 
709
709
  function dispatchCallback(f, context, args) {
710
- assert.typeOf(f, 'function', 'f');
710
+ assert.isFunction(f, 'f');
711
711
 
712
712
  try {
713
713
  f.apply(context, args)
@@ -19,7 +19,7 @@ export class SignalHandler {
19
19
  */
20
20
  constructor(handle, context) {
21
21
  assert.notEqual(handle, undefined, 'handle must be defined');
22
- assert.typeOf(handle, 'function', 'handle');
22
+ assert.isFunction(handle, 'handle');
23
23
 
24
24
 
25
25
  this.handle = handle;
@@ -22,7 +22,7 @@ class FunctionDefinition {
22
22
  * @param {string[]} [args]
23
23
  */
24
24
  constructor({ name, body, args = [] }) {
25
- assert.typeOf(body, 'string', 'body');
25
+ assert.isString(body, 'body');
26
26
 
27
27
  /**
28
28
  *
@@ -8,7 +8,7 @@ import { ReactivePegParser } from "./pegjs/ReactivePegParser.js";
8
8
  * @returns {ReactiveExpression}
9
9
  */
10
10
  export function compileReactiveExpression(code) {
11
- assert.typeOf(code, 'string', 'code');
11
+ assert.isString(code, 'code');
12
12
 
13
13
  const parseTree = ReactivePegParser.INSTANCE.parse(code);
14
14
 
@@ -320,7 +320,7 @@ class CompilingVisitor extends AbstractParseTreeVisitor {
320
320
  * @returns {ReactiveExpression}
321
321
  */
322
322
  export function compileReactiveExpression(code) {
323
- assert.typeOf(code, 'string', 'code');
323
+ assert.isString(code, 'code');
324
324
 
325
325
  const chars = new ANTLRInputStream(code);
326
326
 
@@ -1473,8 +1473,8 @@ export class EntityComponentDataset {
1473
1473
  addEntityEventListener(entity, eventName, listener, thisArg) {
1474
1474
 
1475
1475
  if (!ENV_PRODUCTION) {
1476
- assert.typeOf(eventName, "string", "eventName");
1477
- assert.typeOf(listener, "function", "listener");
1476
+ assert.isString(eventName, "eventName");
1477
+ assert.isFunction(listener, "listener");
1478
1478
  }
1479
1479
 
1480
1480
  if (!this.entityExists(entity)) {
@@ -25,7 +25,7 @@ export class GeometrySpatialQueryAccelerator {
25
25
  * @param {IndexedBinaryBVH} tree
26
26
  */
27
27
  valueWeigher(tree) {
28
- return tree.data.buffer.byteLength + 248;
28
+ return tree.estimateByteSize();
29
29
  }
30
30
  });
31
31
 
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "productName": "Meep",
6
6
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.39.34",
8
+ "version": "2.39.35",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",