thegreenwebfoundation / co2.js

An npm module for accessing the green web API, and estimating the carbon emissions from using digital services
Other
399 stars 51 forks source link

Fix #212 - Return correct properties and values for SWDMv4 trace functions #213

Closed fershad closed 3 months ago

fershad commented 3 months ago

Triage

Type of change

Please select any of the below items that are appropriate.

This pull request:

Related issue/s

Please list below any issues this pull request is related to.

Docs changes required

Do any changes made in this pull request require parts of the CO2.js documentation to be updated?

If you answered "Yes", please create an corresponding issue in our Developer Documentation repository.

Describe the changes made in this pull request

As clearly as possible, describe the changes made in the pull request. You should at least detail "what changes have been made" and "what the results of these changes will be".

This update ensures that the correct properties are returned when using either version 3 or version 4 of the Sustainable Web Design Model with the perByteTrace or perViewTrace functions. This helps deal with the fact that there are different properties that need to be returned depending on the version of the model that is used.