Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove osc-min dependency #125

Closed
wants to merge 3 commits into from
Closed

Remove osc-min dependency #125

wants to merge 3 commits into from

Conversation

MylesBorins
Copy link
Owner

@MylesBorins MylesBorins commented Aug 28, 2024

Fixes #115

Remove the osc-min dependency and implement toBuffer and fromBuffer functions according to the OSC specification.

  • package.json

    • Remove the osc-min dependency
    • Add a package import named #osc pointing to lib/internal/osc.mjs
  • lib/internal/osc.mjs

    • Implement the toBuffer function
    • Implement the fromBuffer function
  • lib/Client.mjs

    • Remove the import of osc-min
    • Import toBuffer from #osc
    • Update the send method to use toBuffer from #osc
  • lib/Server.mjs

    • Remove the import of #decode
    • Import fromBuffer from #osc
    • Update the _sock.on('message') handler to use fromBuffer from #osc
  • test/test-osc.mjs

    • Add tests for the toBuffer function
    • Add tests for the fromBuffer function
  • Remove files

    • lib/internal/decode.mjs
    • test/test-decode.mjs

For more details, open the Copilot Workspace session.

Fixes #115

Remove the `osc-min` dependency and implement `toBuffer` and `fromBuffer` functions according to the OSC specification.

* **package.json**
  - Remove the `osc-min` dependency
  - Add a package import named `#osc` pointing to `lib/internal/osc.mjs`

* **lib/internal/osc.mjs**
  - Implement the `toBuffer` function
  - Implement the `fromBuffer` function

* **lib/Client.mjs**
  - Remove the import of `osc-min`
  - Import `toBuffer` from `#osc`
  - Update the `send` method to use `toBuffer` from `#osc`

* **lib/Server.mjs**
  - Remove the import of `#decode`
  - Import `fromBuffer` from `#osc`
  - Update the `_sock.on('message')` handler to use `fromBuffer` from `#osc`

* **test/test-osc.mjs**
  - Add tests for the `toBuffer` function
  - Add tests for the `fromBuffer` function

* **Remove files**
  - `lib/internal/decode.mjs`
  - `test/test-decode.mjs`

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/MylesBorins/node-osc/issues/115?shareId=XXXX-XXXX-XXXX-XXXX).
@@ -0,0 +1,226 @@
import { Buffer } from 'node:buffer';

function toBuffer(object, strict = false) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function toBuffer(object, strict = false) {
function toBuffer(object) {

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.

Remove osc-min dependency
1 participant