Align base64 registration guard with accepted DAW pattern #45

Closed
opened 2026-08-10 17:57:16 +02:00 by michael · 1 comment
Owner

Goal

Align base64.lua with the accepted DAW module self-registration guard used across daw-lua-common.

The accepted registration pattern is:

if _G.daw_register then
  _G.daw_register(_NAME, M)
end

Session rationale

During the daw-lua-net 2.1.0 review, the repository-wide registration pattern in daw-lua-common was checked against the accepted DAW decision. 24 of 25 production files already use the truthy guard; base64.lua is the remaining implementation outlier.

The older type(_G.daw_register) == "function" rule is being corrected in DAW/daw-docs#18. daw-lua-net therefore correctly remains on the truthy pattern; the remaining code inconsistency is in daw-lua-common/base64.lua.

Scope

  • Change the registration guard in base64.lua to the accepted truthy form.
  • Do not change the public Base64 API or encoding/decoding behavior.
  • Keep the change limited to registration behavior.
  • Run the existing daw-lua-common test suite after the change.

Acceptance criteria

  • base64.lua uses if _G.daw_register then ... end.
  • No production file in daw-lua-common still uses the superseded type-check registration guard.
  • Existing Base64 behavior is unchanged.
  • make test passes on the supported Lua versions used by the repository.
  • The change remains consistent with DAW/daw-docs#18.

Cross-repository relation

Documentation consolidation is tracked in DAW/daw-docs#18.

## Goal Align `base64.lua` with the accepted DAW module self-registration guard used across `daw-lua-common`. The accepted registration pattern is: ```lua if _G.daw_register then _G.daw_register(_NAME, M) end ``` ## Session rationale During the daw-lua-net 2.1.0 review, the repository-wide registration pattern in `daw-lua-common` was checked against the accepted DAW decision. 24 of 25 production files already use the truthy guard; `base64.lua` is the remaining implementation outlier. The older `type(_G.daw_register) == "function"` rule is being corrected in DAW/daw-docs#18. `daw-lua-net` therefore correctly remains on the truthy pattern; the remaining code inconsistency is in `daw-lua-common/base64.lua`. ## Scope - Change the registration guard in `base64.lua` to the accepted truthy form. - Do not change the public Base64 API or encoding/decoding behavior. - Keep the change limited to registration behavior. - Run the existing daw-lua-common test suite after the change. ## Acceptance criteria - [ ] `base64.lua` uses `if _G.daw_register then ... end`. - [ ] No production file in `daw-lua-common` still uses the superseded type-check registration guard. - [ ] Existing Base64 behavior is unchanged. - [ ] `make test` passes on the supported Lua versions used by the repository. - [ ] The change remains consistent with DAW/daw-docs#18. ## Cross-repository relation Documentation consolidation is tracked in DAW/daw-docs#18.
Author
Owner

Done

Same change as DAW/daw-lua-common#44, see there. Verified on main: all
21 production files that register themselves use the truthy
'if _G.daw_register then' guard; none uses the superseded type check.

## Done Same change as DAW/daw-lua-common#44, see there. Verified on main: all 21 production files that register themselves use the truthy 'if _G.daw_register then' guard; none uses the superseded type check.
michael 2026-09-20 21:36:49 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-lua-common#45
No description provided.