@sc-voice/tools 3.11.0 → 3.12.0

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/index.mjs CHANGED
@@ -1,3 +1,7 @@
1
+ import { Assert } from './src/js/assert.mjs';
2
+ export const JS = {
3
+ Assert,
4
+ }
1
5
 
2
6
  import { Fraction } from './src/math/fraction.mjs';
3
7
  import { Interval } from './src/math/interval.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sc-voice/tools",
3
- "version": "3.11.0",
3
+ "version": "3.12.0",
4
4
  "description": "Utilities for SC-Voice",
5
5
  "main": "index.mjs",
6
6
  "files": [
@@ -0,0 +1,8 @@
1
+ export class Assert {
2
+ static ok(expr, msg) {
3
+ if (!expr) {
4
+ throw new Error(msg || 'Unknown assertion error');
5
+ }
6
+ return expr;
7
+ }
8
+ }