sethares-dissonance 2.1.0 → 2.1.1

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.
Files changed (2) hide show
  1. package/README.md +12 -16
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -79,26 +79,22 @@ import {
79
79
  import type { ReadOnlyDissonanceCurve } from "sethares-dissonance";
80
80
 
81
81
  /**
82
- * Read-only view of DissonanceCurve without the recalculate method.
82
+ * Read-only view of DissonanceCurve without the methods that cause mutation.
83
83
  * Use this type when exposing the curve from hooks to prevent external mutation.
84
84
  */
85
- export type ReadOnlyDissonanceCurve = Partial<Omit<
85
+ type ReadOnlyDissonanceCurve = Omit<
86
86
  DissonanceCurve,
87
87
  "recalculate"
88
- >>;
89
-
90
- function createReadOnlyWrapper(
91
- curve: DissonanceCurve,
92
- ): ReadOnlyDissonanceCurve {
93
-
94
- return {
95
- get maxDissonance() {
96
- return curve.maxDissonance;
97
- },
98
- plotCents: () => curve.plotCents(),
99
- findNearestPoint: (ratio) => curve.findNearestPoint(ratio),
100
- // .. can add more methods if needed, aboid those that cause mutations
101
- };
88
+ >;
89
+
90
+ function createReadOnlyWrapper(curve: DissonanceCurve) {
91
+ return {
92
+ get maxDissonance() {
93
+ return curve.maxDissonance
94
+ },
95
+ plotCents: () => curve.plotCents()
96
+ // ... can map more methods if needed
97
+ } satisfies Partial<ReadOnlyDissonanceCurve>
102
98
  }
103
99
 
104
100
  export function useDissonanceCurve(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sethares-dissonance",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "@types/bun": "latest"