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

Reassignment to constant #11

Open
cybercode opened this issue Apr 3, 2023 · 2 comments
Open

Reassignment to constant #11

cybercode opened this issue Apr 3, 2023 · 2 comments

Comments

@cybercode
Copy link

In a strict (typescript) environment the module fails to build due to the following error:

build failed (node_modules/node-dns-sd/lib/dns-sd.js:236:16                 v = 'address';): Cannot assign to "v" because it is a constant

the offending code:

        if ('key' in params) {
            const v = params['key']; // <---
            if (typeof (v) !== 'string' || !/^(address|fqdn)$/.test(v)) {
                return { error: new Error('The `key` is invalid.') };
            }
            if (!v) {
                v = 'address'; // <--- can't reassign to const v
            }
            p['key'] = v;
        }
@futomi
Copy link
Owner

futomi commented Apr 5, 2023

Thank you for reporting the issue. I'll try to fix it.

@futomi
Copy link
Owner

futomi commented Apr 5, 2023

Fixed the issue. Please try again.

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

No branches or pull requests

2 participants