Skip to content

feat: sdp.params_get top-level re-export (1.5.0)#7

Merged
andrewstarks merged 1 commit into
mainfrom
feat/params-get-export
Jun 1, 2026
Merged

feat: sdp.params_get top-level re-export (1.5.0)#7
andrewstarks merged 1 commit into
mainfrom
feat/params-get-export

Conversation

@andrewstarks
Copy link
Copy Markdown
Owner

Summary

Re-exports `sdp.params_get(params, key)` on the public module as the inner companion to `sdp.attr_get` / `sdp.attrs_get`. Looks up a value by key in an ordered `a=fmtp` / `a=privacy` param list — returns the value, `true` for a bare flag, or `nil`.

Before this, 1.4.0 had promoted the outer attribute accessors to the public module but left `params_get` reachable only via `parse_sdp.grammar.base`, leaving the inner companion as the odd one out and forcing consumers to cross into a grammar internal mid-task. This restores one public surface for name lookups. The `grammar.base.params_get` path still works for existing callers.

Requested by the `lnmos` `nmos/sdp.lua` layer, which will switch to `sdp.params_get`.

Caveat (documented everywhere)

Unlike `attr_get` (which takes a block), `params_get` takes the inner list directly — `fmtp.params`, not the `fmtp` table — because param lists have no wrapping object. Documented at the re-export, in the GUIDE API reference, and pinned by a dedicated test (passing the `fmtp` table returns `nil`).

Tests

+5 cases in `spec/library_spec.lua` (value lookup / bare-flag → `true` / miss / nil-safe / takes-list-not-block). Full hermetic suite green in Docker (1222/0/0).

Release

Bumps rockspec to 1.5.0 (additive, backward-compatible). dkjson dependency unchanged.

🤖 Generated with Claude Code

Re-export grammar.base.params_get on the public module as the inner
companion to sdp.attr_get / sdp.attrs_get, so name lookups share one public
surface. The grammar.base path still works for existing callers. params_get
takes the inner param list (fmtp.params), not a block — documented at the
re-export, in the GUIDE, and in a dedicated test. Bumps rockspec to 1.5.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@andrewstarks andrewstarks merged commit b82f52a into main Jun 1, 2026
6 checks passed
@andrewstarks andrewstarks deleted the feat/params-get-export branch June 1, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant