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

Migrate to node-w3capi instead of sending request to API port directly. #1303

Open
jennyliang220 opened this issue Jun 29, 2021 · 2 comments

Comments

@jennyliang220
Copy link
Contributor

https://github.com/w3c/node-w3capi

@jennyliang220
Copy link
Contributor Author

And use feature w3c/node-w3capi#89.

E.g. in lib/validator.js

before:

let groupsCharters = [];
deliverers.forEach(deliverer => {
    // Skip finding charter for the TAG which doesn't have any charter
    if (deliverer === TagID || deliverer === AbID) return;

    delivererPromises.push(
        new Promise(resolve => {
            w3cApi
                .group(deliverer)
                .charters()
                .fetch({ embed: true }, (err, charters) => {
                    resolve(charters);
                });
        })
    );
});
groupsCharters = await Promise.all(delivererPromises);

after:

const  groupCharters = [];
deliverers.forEach(deliverer => {
    // Skip finding charter for the TAG which doesn't have any charter
    if (deliverer === TagID || deliverer === AbID) return;

    groupCharters.push(await w3cApi.group(deliverer).charters().fetch({ embed: true }))
});

@jennyliang220
Copy link
Contributor Author

w3c.group({type: "wg", shortname: "xxx"}).fetch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant