@woosh/meep-engine 2.46.35 → 2.46.36

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.
package/build/meep.cjs CHANGED
@@ -48167,6 +48167,10 @@ class Sampler2D {
48167
48167
  throw new Error("data was undefined");
48168
48168
  }
48169
48169
 
48170
+ if (data.length < width * height * itemSize) {
48171
+ throw new Error(`Buffer underflow, data.length(=${data.length}) is too small. Expected at least ${width * height * itemSize}`);
48172
+ }
48173
+
48170
48174
  /**
48171
48175
  *
48172
48176
  * @type {Number}
@@ -48210,9 +48214,9 @@ class Sampler2D {
48210
48214
  computeMax(channel = 0) {
48211
48215
  const itemSize = this.itemSize;
48212
48216
 
48213
- assert.typeOf(channel, "number", "channel");
48214
- assert.ok(channel >= 0, `channel must be >= 0, was ${channel}`);
48215
- assert.ok(channel < itemSize, `channel must be less than itemSize(=${itemSize}), was ${channel}`);
48217
+ assert.isNumber(channel, "channel");
48218
+ assert.isNonNegativeInteger(channel , 'channel');
48219
+ assert.lessThan(channel, itemSize, `channel must be less than itemSize(=${itemSize}), was ${channel}`);
48216
48220
 
48217
48221
  const data = this.data;
48218
48222