@sorisdk/matcher 0.5.1 → 0.6.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/README.md +3 -1
- package/dist/generated/core_bg.wasm +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,7 +72,9 @@ If you want campaign events and browser recognition flow on top of matching, use
|
|
|
72
72
|
## Metadata lookup
|
|
73
73
|
|
|
74
74
|
Audiopack footer metadata is available through explicit lookup rather than being
|
|
75
|
-
embedded in `MatchResult`.
|
|
75
|
+
embedded in `MatchResult`. Segment timing is the exception: when a pack provides
|
|
76
|
+
valid `matcherSegments` metadata, `MatchResult.position` is segment-local and
|
|
77
|
+
`MatchResult.durationMillis` contains the matched segment duration.
|
|
76
78
|
|
|
77
79
|
```ts
|
|
78
80
|
const best = await session.bestMatch(queryBytes);
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -511,12 +511,17 @@ var WrappedMatcher = class {
|
|
|
511
511
|
};
|
|
512
512
|
function normalizeResult(raw) {
|
|
513
513
|
const afpType = Number(raw.afpType ?? raw.afp_type);
|
|
514
|
-
|
|
514
|
+
const durationMillis = raw.durationMillis ?? raw.duration_millis;
|
|
515
|
+
const result = {
|
|
515
516
|
name: String(raw.name),
|
|
516
517
|
score: Number(raw.score),
|
|
517
518
|
position: Number(raw.position),
|
|
518
519
|
afpType
|
|
519
520
|
};
|
|
521
|
+
if (durationMillis != null) {
|
|
522
|
+
result.durationMillis = Number(durationMillis);
|
|
523
|
+
}
|
|
524
|
+
return result;
|
|
520
525
|
}
|
|
521
526
|
function normalizeVariantMatch(raw) {
|
|
522
527
|
const rawMatch = raw.matchResult ?? raw.match;
|