dbusjs / node-dbus-next

🚌 The next great dbus library for node
https://www.npmjs.com/package/dbus-next
155 stars 52 forks source link

Allow non-string dict key types #115

Open QuadratClown opened 1 year ago

QuadratClown commented 1 year ago

Javascript does not allow keys for objects to be other than string or symbol. However, node-dbus-next uses native js objects for the dbus dict format, which allow keys of any type. As keys in js objects are auto-converted to string, marshalling will throw an error for non-string dict key types.

This pull request simply adds a conversion in marshall-compat.js that auto-converts faulty strings keys back to their respective type.

This pull requests fixes https://github.com/dbusjs/node-dbus-next/issues/79

alexcastillo commented 1 year ago

@acrisci, any chance we can get this merged? 🙏🏼