@tgwf/co2 0.13.7 → 0.13.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.all-contributorsrc +10 -0
- package/CHANGELOG.md +14 -4
- package/README.md +2 -1
- package/data/output/average-intensities.js +1 -1
- package/data/output/average-intensities.json +1 -1
- package/dist/cjs/co2.js +9 -9
- package/dist/cjs/co2.js.map +1 -1
- package/dist/cjs/data/average-intensities.min.js +1 -1
- package/dist/cjs/data/average-intensities.min.js.map +1 -1
- package/dist/cjs/helpers/index.js +6 -6
- package/dist/cjs/helpers/index.js.map +2 -2
- package/dist/data/functions/generate_average_co2.d.ts +2 -0
- package/dist/data/functions/generate_average_co2.d.ts.map +1 -0
- package/dist/data/functions/generate_marginal_co2.d.ts +2 -0
- package/dist/data/functions/generate_marginal_co2.d.ts.map +1 -0
- package/dist/data/output/average-intensities.d.ts +231 -0
- package/dist/data/output/average-intensities.d.ts.map +1 -0
- package/dist/data/output/marginal-intensities-2021.d.ts +243 -0
- package/dist/data/output/marginal-intensities-2021.d.ts.map +1 -0
- package/dist/data/utils/getCountryCodes.d.ts +3 -0
- package/dist/data/utils/getCountryCodes.d.ts.map +1 -0
- package/dist/data/utils/mapCountries.d.ts +3 -0
- package/dist/data/utils/mapCountries.d.ts.map +1 -0
- package/dist/data/utils/parseCSVRow.d.ts +8 -0
- package/dist/data/utils/parseCSVRow.d.ts.map +1 -0
- package/dist/esm/co2.js +11 -11
- package/dist/esm/data/average-intensities.min.js +1 -1
- package/dist/esm/helpers/index.js +6 -6
- package/dist/iife/index.js +12 -12
- package/dist/iife/index.js.map +2 -2
- package/package.json +1 -1
- package/src/co2.js +9 -9
- package/src/data/average-intensities.min.js +1 -1
- package/src/helpers/index.js +6 -6
package/.all-contributorsrc
CHANGED
|
@@ -122,6 +122,16 @@
|
|
|
122
122
|
"contributions": [
|
|
123
123
|
"code"
|
|
124
124
|
]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"login": "p-gerard",
|
|
128
|
+
"name": "p-gerard",
|
|
129
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/97036756?v=4",
|
|
130
|
+
"profile": "https://github.com/p-gerard",
|
|
131
|
+
"contributions": [
|
|
132
|
+
"bug",
|
|
133
|
+
"code"
|
|
134
|
+
]
|
|
125
135
|
}
|
|
126
136
|
],
|
|
127
137
|
"contributorsPerLine": 7,
|
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
18
18
|
|
|
19
19
|
# Released
|
|
20
20
|
|
|
21
|
+
## [0.13.7] - 2023-09-13
|
|
22
|
+
|
|
23
|
+
- Automated monthly update of annual average grid intensity data.
|
|
24
|
+
|
|
25
|
+
## [0.13.6] - 2023-08-08
|
|
26
|
+
|
|
27
|
+
- Automated monthly update of annual average grid intensity data.
|
|
28
|
+
- Create FUNDING.yml to allow sponsor contribution to this project.
|
|
29
|
+
- Store segment flag on CO2 instance, not models.
|
|
30
|
+
|
|
21
31
|
## [0.13.5] - 2023-07-5
|
|
22
32
|
|
|
23
33
|
### Changed
|
|
@@ -54,8 +64,8 @@ In PR #135 there were significant changes made to how average annual grid intens
|
|
|
54
64
|
|
|
55
65
|
- Updated average annual grid intensities to include 2022 values from Ember.
|
|
56
66
|
- Changed the functions to generate average grid intensities to:
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
- Fetch data directly from Ember's API.
|
|
68
|
+
- Get the _latest_ annual average values for each country/region.
|
|
59
69
|
- Renamed the average grid intensities export file.
|
|
60
70
|
|
|
61
71
|
## [0.12.2] - 2023-03-01
|
|
@@ -120,7 +130,7 @@ In PR #135 there were significant changes made to how average annual grid intens
|
|
|
120
130
|
|
|
121
131
|
### Changed
|
|
122
132
|
|
|
123
|
-
- Changed the default model for transfer based CO2 calculations from the _1byte_ model to the _Sustainable Web Design_ model instead. See https://developers.thegreenwebfoundation.org/co2js/models
|
|
133
|
+
- Changed the default model for transfer based CO2 calculations from the _1byte_ model to the _Sustainable Web Design_ model instead. See <https://developers.thegreenwebfoundation.org/co2js/models/> for guidance on the differences and how to migrate between them. See [#94 for more](https://github.com/thegreenwebfoundation/co2.js/issues/94).
|
|
124
134
|
- Updated our release commands to generate and format the carbon intensity data as part of the release process.
|
|
125
135
|
|
|
126
136
|
## [0.10.4] - 2022-08-12
|
|
@@ -212,7 +222,7 @@ This release used a version bump as previously we had released v0.10.0 under a p
|
|
|
212
222
|
|
|
213
223
|
### Removed
|
|
214
224
|
|
|
215
|
-
- Extracted sqlite usage and dependencies into a separate module, `url2green`. This means
|
|
225
|
+
- Extracted sqlite usage and dependencies into a separate module, `url2green`. This means you no longer need to compile SQLite on install.
|
|
216
226
|
|
|
217
227
|
## [0.5.0] - 2020-03-03
|
|
218
228
|
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# CO2.js
|
|
2
2
|
|
|
3
3
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
4
|
-
[](#contributors-)
|
|
5
5
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
6
6
|
|
|
7
7
|
<img src="https://github.com/thegreenwebfoundation/co2.js/actions/workflows/unittests.yml/badge.svg" />
|
|
@@ -145,6 +145,7 @@ See LICENCE for more.
|
|
|
145
145
|
<td align="center" valign="top" width="14.28%"><a href="https://www.intersectionalenvironmentalist.com/"><img src="https://avatars.githubusercontent.com/u/1530684?v=4?s=100" width="100px;" alt="Piper"/><br /><sub><b>Piper</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=piperchester" title="Code">💻</a></td>
|
|
146
146
|
<td align="center" valign="top" width="14.28%"><a href="https://vasquezruiz.com/"><img src="https://avatars.githubusercontent.com/u/108420?v=4?s=100" width="100px;" alt="Raymundo Vásquez Ruiz"/><br /><sub><b>Raymundo Vásquez Ruiz</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=raymundovr" title="Code">💻</a></td>
|
|
147
147
|
<td align="center" valign="top" width="14.28%"><a href="https://greengumption.co.uk/"><img src="https://avatars.githubusercontent.com/u/26165947?v=4?s=100" width="100px;" alt="JamieB"/><br /><sub><b>JamieB</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=JamieBeevor" title="Code">💻</a></td>
|
|
148
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/p-gerard"><img src="https://avatars.githubusercontent.com/u/97036756?v=4?s=100" width="100px;" alt="p-gerard"/><br /><sub><b>p-gerard</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/issues?q=author%3Ap-gerard" title="Bug reports">🐛</a> <a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=p-gerard" title="Code">💻</a></td>
|
|
148
149
|
</tr>
|
|
149
150
|
</tbody>
|
|
150
151
|
</table>
|
package/dist/cjs/co2.js
CHANGED
|
@@ -68,10 +68,10 @@ See https://developers.thegreenwebfoundation.org/co2js/methods/ to learn more ab
|
|
|
68
68
|
bytes,
|
|
69
69
|
gridIntensity: {
|
|
70
70
|
description: "The grid intensity (grams per kilowatt-hour) used to calculate this CO2 estimate.",
|
|
71
|
-
network: ((_b = (_a = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _a.network) == null ? void 0 : _b.value)
|
|
72
|
-
dataCenter: green ? import_constants.RENEWABLES_GRID_INTENSITY : ((_d = (_c = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _c.dataCenter) == null ? void 0 : _d.value)
|
|
71
|
+
network: ((_b = (_a = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _a.network) == null ? void 0 : _b.value) ?? import_constants.GLOBAL_GRID_INTENSITY,
|
|
72
|
+
dataCenter: green ? import_constants.RENEWABLES_GRID_INTENSITY : ((_d = (_c = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _c.dataCenter) == null ? void 0 : _d.value) ?? import_constants.GLOBAL_GRID_INTENSITY,
|
|
73
73
|
production: import_constants.GLOBAL_GRID_INTENSITY,
|
|
74
|
-
device: ((_f = (_e = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _e.device) == null ? void 0 : _f.value)
|
|
74
|
+
device: ((_f = (_e = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _e.device) == null ? void 0 : _f.value) ?? import_constants.GLOBAL_GRID_INTENSITY
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
};
|
|
@@ -91,14 +91,14 @@ See https://developers.thegreenwebfoundation.org/co2js/methods/ to learn more ab
|
|
|
91
91
|
bytes,
|
|
92
92
|
gridIntensity: {
|
|
93
93
|
description: "The grid intensity (grams per kilowatt-hour) used to calculate this CO2 estimate.",
|
|
94
|
-
network: ((_c = (_b = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _b.network) == null ? void 0 : _c.value)
|
|
95
|
-
dataCenter: green ? import_constants.RENEWABLES_GRID_INTENSITY : ((_e = (_d = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _d.dataCenter) == null ? void 0 : _e.value)
|
|
94
|
+
network: ((_c = (_b = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _b.network) == null ? void 0 : _c.value) ?? import_constants.GLOBAL_GRID_INTENSITY,
|
|
95
|
+
dataCenter: green ? import_constants.RENEWABLES_GRID_INTENSITY : ((_e = (_d = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _d.dataCenter) == null ? void 0 : _e.value) ?? import_constants.GLOBAL_GRID_INTENSITY,
|
|
96
96
|
production: import_constants.GLOBAL_GRID_INTENSITY,
|
|
97
|
-
device: ((_g = (_f = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _f.device) == null ? void 0 : _g.value)
|
|
97
|
+
device: ((_g = (_f = adjustments == null ? void 0 : adjustments.gridIntensity) == null ? void 0 : _f.device) == null ? void 0 : _g.value) ?? import_constants.GLOBAL_GRID_INTENSITY
|
|
98
98
|
},
|
|
99
|
-
dataReloadRatio: (adjustments == null ? void 0 : adjustments.dataReloadRatio)
|
|
100
|
-
firstVisitPercentage: (adjustments == null ? void 0 : adjustments.firstVisitPercentage)
|
|
101
|
-
returnVisitPercentage: (adjustments == null ? void 0 : adjustments.returnVisitPercentage)
|
|
99
|
+
dataReloadRatio: (adjustments == null ? void 0 : adjustments.dataReloadRatio) ?? 0.02,
|
|
100
|
+
firstVisitPercentage: (adjustments == null ? void 0 : adjustments.firstVisitPercentage) ?? 0.75,
|
|
101
|
+
returnVisitPercentage: (adjustments == null ? void 0 : adjustments.returnVisitPercentage) ?? 0.25
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
} else {
|
package/dist/cjs/co2.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/co2.js"],
|
|
4
|
-
"sourcesContent": ["\"use strict\";\n\n/**\n * @typedef {Object} CO2EstimateTraceResultPerByte\n * @property {number} co2 - The CO2 estimate in grams/kilowatt-hour\n * @property {boolean} green - Whether the domain is green or not\n * @property {TraceResultVariables} variables - The variables used to calculate the CO2 estimate\n */\n\n/**\n * @typedef {Object} CO2EstimateTraceResultPerVisit\n * @property {number} co2 - The CO2 estimate in grams/kilowatt-hour\n * @property {boolean} green - Whether the domain is green or not\n * @property {TraceResultVariables} variables - The variables used to calculate the CO2 estimate\n */\n\n/**\n * @typedef {Object} TraceResultVariablesPerByte\n * @property {GridIntensityVariables} gridIntensity - The grid intensity related variables\n */\n/**\n * @typedef {Object} TraceResultVariablesPerVisit\n * @property {GridIntensityVariables} gridIntensity - The grid intensity related variables\n * @property {number} dataReloadRatio - What percentage of a page is reloaded on each subsequent page view\n * @property {number} firstVisitPercentage - What percentage of visits are loading this page for subsequent times\n * @property {number} returnVisitPercentage - What percentage of visits are loading this page for the second or more time\n */\n\n/**\n * @typedef {Object} GridIntensityVariables\n * @property {string} description - The description of the variables\n * @property {number} network - The network grid intensity set by the user or the default\n * @property {number} dataCenter - The data center grid intensity set by the user or the default\n * @property {number} device - The device grid intensity set by the user or the default\n * @property {number} production - The production grid intensity set by the user or the default\n */\n\nimport OneByte from \"./1byte.js\";\nimport SustainableWebDesign from \"./sustainable-web-design.js\";\n\nimport {\n GLOBAL_GRID_INTENSITY,\n RENEWABLES_GRID_INTENSITY,\n} from \"./constants/index.js\";\nimport { parseOptions } from \"./helpers/index.js\";\n\nclass CO2 {\n constructor(options) {\n this.model = new SustainableWebDesign();\n // Using optional chaining allows an empty object to be passed\n // in without breaking the code.\n if (options?.model === \"1byte\") {\n this.model = new OneByte();\n } else if (options?.model === \"swd\") {\n this.model = new SustainableWebDesign();\n } else if (options?.model) {\n throw new Error(\n `\"${options.model}\" is not a valid model. Please use \"1byte\" for the OneByte model, and \"swd\" for the Sustainable Web Design model.\\nSee https://developers.thegreenwebfoundation.org/co2js/models/ to learn more about the models available in CO2.js.`\n );\n }\n\n /** @private */\n this._segment = options?.results === \"segment\";\n }\n\n /**\n * Accept a figure in bytes for data transfer, and a boolean for whether\n * the domain shows as 'green', and return a CO2 figure for energy used to shift the corresponding\n * the data transfer.\n *\n * @param {number} bytes\n * @param {boolean} green\n * @return {number} the amount of CO2 in grammes\n */\n perByte(bytes, green = false) {\n return this.model.perByte(bytes, green, this._segment);\n }\n\n /**\n * Accept a figure in bytes for data transfer, and a boolean for whether\n * the domain shows as 'green', and return a CO2 figure for energy used to shift the corresponding\n * the data transfer.\n *\n * @param {number} bytes\n * @param {boolean} green\n * @return {number} the amount of CO2 in grammes\n */\n perVisit(bytes, green = false) {\n if (this.model?.perVisit) {\n return this.model.perVisit(bytes, green, this._segment);\n } else {\n throw new Error(\n `The perVisit() method is not supported in the model you are using. Try using perByte() instead.\\nSee https://developers.thegreenwebfoundation.org/co2js/methods/ to learn more about the methods available in CO2.js.`\n );\n }\n }\n\n /**\n * Accept a figure in bytes for data transfer, a boolean for whether\n * the domain shows as 'green', and an options object.\n * Returns an object containing CO2 figure, green boolean, and object of the variables used in calculating the CO2 figure.\n *\n * @param {number} bytes\n * @param {boolean} green\n * @param {Object} options\n * @return {CO2EstimateTraceResultPerByte} the amount of CO2 in grammes\n */\n perByteTrace(bytes, green = false, options = {}) {\n let adjustments = {};\n if (options) {\n // If there are options, parse them and add them to the model.\n adjustments = parseOptions(options);\n }\n return {\n co2: this.model.perByte(bytes, green, this._segment, adjustments),\n green,\n variables: {\n description:\n \"Below are the variables used to calculate this CO2 estimate.\",\n bytes,\n gridIntensity: {\n description:\n \"The grid intensity (grams per kilowatt-hour) used to calculate this CO2 estimate.\",\n network:\n adjustments?.gridIntensity?.network?.value || GLOBAL_GRID_INTENSITY,\n dataCenter: green\n ? RENEWABLES_GRID_INTENSITY\n : adjustments?.gridIntensity?.dataCenter?.value ||\n GLOBAL_GRID_INTENSITY,\n production: GLOBAL_GRID_INTENSITY,\n device:\n adjustments?.gridIntensity?.device?.value || GLOBAL_GRID_INTENSITY,\n },\n },\n };\n }\n\n /**\n * Accept a figure in bytes for data transfer, a boolean for whether\n * the domain shows as 'green', and an options object.\n * Returns an object containing CO2 figure, green boolean, and object of the variables used in calculating the CO2 figure.\n *\n * @param {number} bytes\n * @param {boolean} green\n * @param {Object} options\n * @return {CO2EstimateTraceResultPerVisit} the amount of CO2 in grammes\n */\n perVisitTrace(bytes, green = false, options = {}) {\n if (this.model?.perVisit) {\n let adjustments = {};\n if (options) {\n // If there are options, parse them and add them to the model.\n adjustments = parseOptions(options);\n }\n\n return {\n co2: this.model.perVisit(bytes, green, this._segment, adjustments),\n green,\n variables: {\n description:\n \"Below are the variables used to calculate this CO2 estimate.\",\n bytes,\n gridIntensity: {\n description:\n \"The grid intensity (grams per kilowatt-hour) used to calculate this CO2 estimate.\",\n network:\n adjustments?.gridIntensity?.network?.value ||\n GLOBAL_GRID_INTENSITY,\n dataCenter: green\n ? RENEWABLES_GRID_INTENSITY\n : adjustments?.gridIntensity?.dataCenter?.value ||\n GLOBAL_GRID_INTENSITY,\n production: GLOBAL_GRID_INTENSITY,\n device:\n adjustments?.gridIntensity?.device?.value ||\n GLOBAL_GRID_INTENSITY,\n },\n dataReloadRatio: adjustments?.dataReloadRatio || 0.02,\n firstVisitPercentage: adjustments?.firstVisitPercentage || 0.75,\n returnVisitPercentage: adjustments?.returnVisitPercentage || 0.25,\n },\n };\n } else {\n throw new Error(\n `The perVisitDetailed() method is not supported in the model you are using. Try using perByte() instead.\\nSee https://developers.thegreenwebfoundation.org/co2js/methods/ to learn more about the methods available in CO2.js.`\n );\n }\n }\n\n perDomain(pageXray, greenDomains) {\n const co2PerDomain = [];\n for (let domain of Object.keys(pageXray.domains)) {\n let co2;\n if (greenDomains && greenDomains.indexOf(domain) > -1) {\n co2 = this.perByte(pageXray.domains[domain].transferSize, true);\n } else {\n co2 = this.perByte(pageXray.domains[domain].transferSize);\n }\n co2PerDomain.push({\n domain,\n co2,\n transferSize: pageXray.domains[domain].transferSize,\n });\n }\n co2PerDomain.sort((a, b) => b.co2 - a.co2);\n\n return co2PerDomain;\n }\n\n perPage(pageXray, green) {\n // Accept an xray object, and if we receive a boolean as the second\n // argument, we assume every request we make is sent to a server\n // running on renwewable power.\n\n // if we receive an array of domains, return a number accounting the\n // reduced CO2 from green hosted domains\n\n const domainCO2 = this.perDomain(pageXray, green);\n let totalCO2 = 0;\n for (let domain of domainCO2) {\n totalCO2 += domain.co2;\n }\n return totalCO2;\n }\n\n perContentType(pageXray, greenDomains) {\n const co2PerContentType = {};\n for (let asset of pageXray.assets) {\n const domain = new URL(asset.url).domain;\n const transferSize = asset.transferSize;\n const co2ForTransfer = this.perByte(\n transferSize,\n greenDomains && greenDomains.indexOf(domain) > -1\n );\n const contentType = asset.type;\n if (!co2PerContentType[contentType]) {\n co2PerContentType[contentType] = { co2: 0, transferSize: 0 };\n }\n co2PerContentType[contentType].co2 += co2ForTransfer;\n co2PerContentType[contentType].transferSize += transferSize;\n }\n // restructure and sort\n const all = [];\n for (let type of Object.keys(co2PerContentType)) {\n all.push({\n type,\n co2: co2PerContentType[type].co2,\n transferSize: co2PerContentType[type].transferSize,\n });\n }\n all.sort((a, b) => b.co2 - a.co2);\n return all;\n }\n\n dirtiestResources(pageXray, greenDomains) {\n const allAssets = [];\n for (let asset of pageXray.assets) {\n const domain = new URL(asset.url).domain;\n const transferSize = asset.transferSize;\n const co2ForTransfer = this.perByte(\n transferSize,\n greenDomains && greenDomains.indexOf(domain) > -1\n );\n allAssets.push({ url: asset.url, co2: co2ForTransfer, transferSize });\n }\n allAssets.sort((a, b) => b.co2 - a.co2);\n\n return allAssets.slice(0, allAssets.length > 10 ? 10 : allAssets.length);\n }\n\n perParty(pageXray, greenDomains) {\n let firstParty = 0;\n let thirdParty = 0;\n // calculate co2 per first/third party\n const firstPartyRegEx = pageXray.firstPartyRegEx;\n for (let d of Object.keys(pageXray.domains)) {\n if (!d.match(firstPartyRegEx)) {\n thirdParty += this.perByte(\n pageXray.domains[d].transferSize,\n greenDomains && greenDomains.indexOf(d) > -1\n );\n } else {\n firstParty += this.perByte(\n pageXray.domains[d].transferSize,\n greenDomains && greenDomains.indexOf(d) > -1\n );\n }\n }\n return { firstParty, thirdParty };\n }\n}\n\nexport { CO2 };\nexport default CO2;\n"],
|
|
4
|
+
"sourcesContent": ["\"use strict\";\n\n/**\n * @typedef {Object} CO2EstimateTraceResultPerByte\n * @property {number} co2 - The CO2 estimate in grams/kilowatt-hour\n * @property {boolean} green - Whether the domain is green or not\n * @property {TraceResultVariables} variables - The variables used to calculate the CO2 estimate\n */\n\n/**\n * @typedef {Object} CO2EstimateTraceResultPerVisit\n * @property {number} co2 - The CO2 estimate in grams/kilowatt-hour\n * @property {boolean} green - Whether the domain is green or not\n * @property {TraceResultVariables} variables - The variables used to calculate the CO2 estimate\n */\n\n/**\n * @typedef {Object} TraceResultVariablesPerByte\n * @property {GridIntensityVariables} gridIntensity - The grid intensity related variables\n */\n/**\n * @typedef {Object} TraceResultVariablesPerVisit\n * @property {GridIntensityVariables} gridIntensity - The grid intensity related variables\n * @property {number} dataReloadRatio - What percentage of a page is reloaded on each subsequent page view\n * @property {number} firstVisitPercentage - What percentage of visits are loading this page for subsequent times\n * @property {number} returnVisitPercentage - What percentage of visits are loading this page for the second or more time\n */\n\n/**\n * @typedef {Object} GridIntensityVariables\n * @property {string} description - The description of the variables\n * @property {number} network - The network grid intensity set by the user or the default\n * @property {number} dataCenter - The data center grid intensity set by the user or the default\n * @property {number} device - The device grid intensity set by the user or the default\n * @property {number} production - The production grid intensity set by the user or the default\n */\n\nimport OneByte from \"./1byte.js\";\nimport SustainableWebDesign from \"./sustainable-web-design.js\";\n\nimport {\n GLOBAL_GRID_INTENSITY,\n RENEWABLES_GRID_INTENSITY,\n} from \"./constants/index.js\";\nimport { parseOptions } from \"./helpers/index.js\";\n\nclass CO2 {\n constructor(options) {\n this.model = new SustainableWebDesign();\n // Using optional chaining allows an empty object to be passed\n // in without breaking the code.\n if (options?.model === \"1byte\") {\n this.model = new OneByte();\n } else if (options?.model === \"swd\") {\n this.model = new SustainableWebDesign();\n } else if (options?.model) {\n throw new Error(\n `\"${options.model}\" is not a valid model. Please use \"1byte\" for the OneByte model, and \"swd\" for the Sustainable Web Design model.\\nSee https://developers.thegreenwebfoundation.org/co2js/models/ to learn more about the models available in CO2.js.`\n );\n }\n\n /** @private */\n this._segment = options?.results === \"segment\";\n }\n\n /**\n * Accept a figure in bytes for data transfer, and a boolean for whether\n * the domain shows as 'green', and return a CO2 figure for energy used to shift the corresponding\n * the data transfer.\n *\n * @param {number} bytes\n * @param {boolean} green\n * @return {number} the amount of CO2 in grammes\n */\n perByte(bytes, green = false) {\n return this.model.perByte(bytes, green, this._segment);\n }\n\n /**\n * Accept a figure in bytes for data transfer, and a boolean for whether\n * the domain shows as 'green', and return a CO2 figure for energy used to shift the corresponding\n * the data transfer.\n *\n * @param {number} bytes\n * @param {boolean} green\n * @return {number} the amount of CO2 in grammes\n */\n perVisit(bytes, green = false) {\n if (this.model?.perVisit) {\n return this.model.perVisit(bytes, green, this._segment);\n } else {\n throw new Error(\n `The perVisit() method is not supported in the model you are using. Try using perByte() instead.\\nSee https://developers.thegreenwebfoundation.org/co2js/methods/ to learn more about the methods available in CO2.js.`\n );\n }\n }\n\n /**\n * Accept a figure in bytes for data transfer, a boolean for whether\n * the domain shows as 'green', and an options object.\n * Returns an object containing CO2 figure, green boolean, and object of the variables used in calculating the CO2 figure.\n *\n * @param {number} bytes\n * @param {boolean} green\n * @param {Object} options\n * @return {CO2EstimateTraceResultPerByte} the amount of CO2 in grammes\n */\n perByteTrace(bytes, green = false, options = {}) {\n let adjustments = {};\n if (options) {\n // If there are options, parse them and add them to the model.\n adjustments = parseOptions(options);\n }\n return {\n co2: this.model.perByte(bytes, green, this._segment, adjustments),\n green,\n variables: {\n description:\n \"Below are the variables used to calculate this CO2 estimate.\",\n bytes,\n gridIntensity: {\n description:\n \"The grid intensity (grams per kilowatt-hour) used to calculate this CO2 estimate.\",\n network:\n adjustments?.gridIntensity?.network?.value ?? GLOBAL_GRID_INTENSITY,\n dataCenter: green\n ? RENEWABLES_GRID_INTENSITY\n : adjustments?.gridIntensity?.dataCenter?.value ??\n GLOBAL_GRID_INTENSITY,\n production: GLOBAL_GRID_INTENSITY,\n device:\n adjustments?.gridIntensity?.device?.value ?? GLOBAL_GRID_INTENSITY,\n },\n },\n };\n }\n\n /**\n * Accept a figure in bytes for data transfer, a boolean for whether\n * the domain shows as 'green', and an options object.\n * Returns an object containing CO2 figure, green boolean, and object of the variables used in calculating the CO2 figure.\n *\n * @param {number} bytes\n * @param {boolean} green\n * @param {Object} options\n * @return {CO2EstimateTraceResultPerVisit} the amount of CO2 in grammes\n */\n perVisitTrace(bytes, green = false, options = {}) {\n if (this.model?.perVisit) {\n let adjustments = {};\n if (options) {\n // If there are options, parse them and add them to the model.\n adjustments = parseOptions(options);\n }\n\n return {\n co2: this.model.perVisit(bytes, green, this._segment, adjustments),\n green,\n variables: {\n description:\n \"Below are the variables used to calculate this CO2 estimate.\",\n bytes,\n gridIntensity: {\n description:\n \"The grid intensity (grams per kilowatt-hour) used to calculate this CO2 estimate.\",\n network:\n adjustments?.gridIntensity?.network?.value ??\n GLOBAL_GRID_INTENSITY,\n dataCenter: green\n ? RENEWABLES_GRID_INTENSITY\n : adjustments?.gridIntensity?.dataCenter?.value ??\n GLOBAL_GRID_INTENSITY,\n production: GLOBAL_GRID_INTENSITY,\n device:\n adjustments?.gridIntensity?.device?.value ??\n GLOBAL_GRID_INTENSITY,\n },\n dataReloadRatio: adjustments?.dataReloadRatio ?? 0.02,\n firstVisitPercentage: adjustments?.firstVisitPercentage ?? 0.75,\n returnVisitPercentage: adjustments?.returnVisitPercentage ?? 0.25,\n },\n };\n } else {\n throw new Error(\n `The perVisitDetailed() method is not supported in the model you are using. Try using perByte() instead.\\nSee https://developers.thegreenwebfoundation.org/co2js/methods/ to learn more about the methods available in CO2.js.`\n );\n }\n }\n\n perDomain(pageXray, greenDomains) {\n const co2PerDomain = [];\n for (let domain of Object.keys(pageXray.domains)) {\n let co2;\n if (greenDomains && greenDomains.indexOf(domain) > -1) {\n co2 = this.perByte(pageXray.domains[domain].transferSize, true);\n } else {\n co2 = this.perByte(pageXray.domains[domain].transferSize);\n }\n co2PerDomain.push({\n domain,\n co2,\n transferSize: pageXray.domains[domain].transferSize,\n });\n }\n co2PerDomain.sort((a, b) => b.co2 - a.co2);\n\n return co2PerDomain;\n }\n\n perPage(pageXray, green) {\n // Accept an xray object, and if we receive a boolean as the second\n // argument, we assume every request we make is sent to a server\n // running on renwewable power.\n\n // if we receive an array of domains, return a number accounting the\n // reduced CO2 from green hosted domains\n\n const domainCO2 = this.perDomain(pageXray, green);\n let totalCO2 = 0;\n for (let domain of domainCO2) {\n totalCO2 += domain.co2;\n }\n return totalCO2;\n }\n\n perContentType(pageXray, greenDomains) {\n const co2PerContentType = {};\n for (let asset of pageXray.assets) {\n const domain = new URL(asset.url).domain;\n const transferSize = asset.transferSize;\n const co2ForTransfer = this.perByte(\n transferSize,\n greenDomains && greenDomains.indexOf(domain) > -1\n );\n const contentType = asset.type;\n if (!co2PerContentType[contentType]) {\n co2PerContentType[contentType] = { co2: 0, transferSize: 0 };\n }\n co2PerContentType[contentType].co2 += co2ForTransfer;\n co2PerContentType[contentType].transferSize += transferSize;\n }\n // restructure and sort\n const all = [];\n for (let type of Object.keys(co2PerContentType)) {\n all.push({\n type,\n co2: co2PerContentType[type].co2,\n transferSize: co2PerContentType[type].transferSize,\n });\n }\n all.sort((a, b) => b.co2 - a.co2);\n return all;\n }\n\n dirtiestResources(pageXray, greenDomains) {\n const allAssets = [];\n for (let asset of pageXray.assets) {\n const domain = new URL(asset.url).domain;\n const transferSize = asset.transferSize;\n const co2ForTransfer = this.perByte(\n transferSize,\n greenDomains && greenDomains.indexOf(domain) > -1\n );\n allAssets.push({ url: asset.url, co2: co2ForTransfer, transferSize });\n }\n allAssets.sort((a, b) => b.co2 - a.co2);\n\n return allAssets.slice(0, allAssets.length > 10 ? 10 : allAssets.length);\n }\n\n perParty(pageXray, greenDomains) {\n let firstParty = 0;\n let thirdParty = 0;\n // calculate co2 per first/third party\n const firstPartyRegEx = pageXray.firstPartyRegEx;\n for (let d of Object.keys(pageXray.domains)) {\n if (!d.match(firstPartyRegEx)) {\n thirdParty += this.perByte(\n pageXray.domains[d].transferSize,\n greenDomains && greenDomains.indexOf(d) > -1\n );\n } else {\n firstParty += this.perByte(\n pageXray.domains[d].transferSize,\n greenDomains && greenDomains.indexOf(d) > -1\n );\n }\n }\n return { firstParty, thirdParty };\n }\n}\n\nexport { CO2 };\nexport default CO2;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCA,kBAAoB;AACpB,oCAAiC;AAEjC,uBAGO;AACP,qBAA6B;AAE7B,MAAM,IAAI;AAAA,EACR,YAAY,SAAS;AACnB,SAAK,QAAQ,IAAI,sCAAqB;AAGtC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U,MAAM,GAAG,UAAU,SAAS,KAAK,KAAK,UAAU,MAAM;AAAA,EACzE;AAAA,EAEA,SAAS,UAAU,cAAc;AAC/B,QAAI,aAAa;AACjB,QAAI,aAAa;AAEjB,UAAM,kBAAkB,SAAS;AACjC,aAAS,KAAK,OAAO,KAAK,SAAS,OAAO,GAAG;AAC3C,UAAI,CAAC,EAAE,MAAM,eAAe,GAAG;AAC7B,sBAAc,KAAK,QACjB,SAAS,QAAQ,GAAG,cACpB,gBAAgB,aAAa,QAAQ,CAAC,IAAI,EAC5C;AAAA,MACF,OAAO;AACL,sBAAc,KAAK,QACjB,SAAS,QAAQ,GAAG,cACpB,gBAAgB,aAAa,QAAQ,CAAC,IAAI,EAC5C;AAAA,MACF;AAAA,IACF;AACA,WAAO,EAAE,YAAY,WAAW;AAAA,EAClC;AACF;AAGA,IAAO,cAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -22,7 +22,7 @@ __export(average_intensities_min_exports, {
|
|
|
22
22
|
type: () => type
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(average_intensities_min_exports);
|
|
25
|
-
const data = { "AFG": 120.48, "AFRICA": 484.16, "ALB": 23.44, "DZA": 498.9, "ASM": 687.5, "AGO": 195.98, "ATG": 657.14, "ARG": 344.31, "ARM": 222.68, "ABW": 591.4, "ASEAN": 508.06, "ASIA": 535.23, "AUS": 501.7, "AUT": 157.52, "AZE": 532.9, "BHS": 698.11, "BHR": 494.02, "BGD": 577.03, "BRB": 644.86, "BLR": 415.64, "BEL": 165.36, "BLZ": 484.38, "BEN": 666.67, "BTN": 24.44, "BOL": 322.09, "BIH": 516.01, "BWA": 794.52, "BRA": 102.09, "BRN": 658.85, "BGR": 399.57, "BFA": 611.43, "BDI": 250, "CPV": 600, "KHM": 400.46, "CMR": 278.26, "CAN": 125.84, "CYM": 684.93, "CAF": 0, "TCD": 677.42, "CHL": 332.61, "CHN": 533.98, "COL": 168.95, "COM": 714.29, "COG": 395.52, "COD": 25.36, "COK": 400, "CRI": 37.21, "CIV": 410.75, "HRV": 246.46, "CUB": 602.23, "CYP": 589.35, "CZE": 415.35, "DNK": 180.71, "DJI": 666.67, "DMA": 529.41, "DOM": 549.8, "ECU": 188.71, "EGY": 469.63, "SLV": 194.23, "GNQ": 492.96, "ERI": 688.89, "EST": 464.03, "SWZ": 189.19, "ETH": 25.19, "EU": 277.19, "EUROPE": 296.45, "FLK": 500, "FRO": 428.57, "FJI": 289.47, "FIN": 130.98, "FRA": 84.82, "GUF": 254.72, "PYF": 471.43, "G20": 442.38, "G7": 343.92, "GAB": 397.38, "GMB": 700, "GEO": 134.83, "DEU": 384.83, "GHA": 361.2, "GRC": 343.82, "GRL": 133.33, "GRD": 714.29, "GLP": 623.53, "GUM": 670.33, "GTM": 291.55, "GIN": 208.63, "GNB": 750, "GUY": 642.28, "HTI": 606.06, "HND": 373.96, "HKG": 683.97, "HUN": 222.97, "ISL": 28.56, "IND": 633.4, "IDN": 619.02, "IRN": 487.86, "IRQ": 498.87, "IRL": 346.33, "ISR": 548.03, "ITA": 371.69, "JAM": 537.93, "JPN": 494.86, "JOR": 399.91, "KAZ": 635.57, "KEN": 100.57, "KIR": 666.67, "XKX": 768.73, "KWT": 551.74, "KGZ": 104.43, "LAO": 242.18, "LATIN AMERICA AND CARIBBEAN": 238.68, "LVA": 181.82, "LBN": 605.74, "LSO": 20, "LBR": 304.35, "LBY": 550.42, "LTU": 194.25, "LUX": 168.14, "MAC": 491.53, "MDG": 483.25, "MWI": 133.8, "MYS": 543.87, "MDV": 651.52, "MLI": 463.13, "MLT": 495, "MTQ": 698.63, "MRT": 526.6, "MUS": 611.11, "MEX": 423.81, "MIDDLE EAST": 516.02, "MDA": 677.18, "MNG": 749.66, "MNE": 399.38, "MSR": 1e3, "MAR": 610.41, "MOZ": 126.63, "MMR": 344.37, "NAM": 63.69, "NRU": 750, "NPL": 24.51, "NLD": 355.78, "NCL": 610.12, "NZL": 97.73, "NIC": 354.21, "NER": 622.22, "NGA": 368.11, "NORTH AMERICA": 336.01, "PRK": 157.79, "MKD": 529.33, "NOR": 28.82, "OCEANIA": 449.71, "OECD": 340.95, "OMN": 488.27, "PAK": 344.16, "PSE": 465.12, "PAN": 186.61, "PNG": 526.75, "PRY": 25.49, "PER": 256.51, "POL": 633.1, "PRT": 234.03, "PRI": 681.47, "QAT": 489.88, "REU": 519.03, "ROU": 264.12, "RUS": 363.68, "RWA": 294.12, "KNA": 681.82, "LCA": 685.71, "SPM": 800, "VCT": 500, "WSM": 470.59, "STP": 600, "SAU": 557.78, "SEN": 523.13, "SRB": 569.38, "SYC": 615.39, "SLE": 47.62, "SGP": 488.78, "SVK": 140.67, "SVN": 237.38, "SLB": 727.27, "SOM": 634.15, "ZAF": 708.19, "KOR": 437.6, "SSD": 684.21, "ESP": 217.37, "LKA": 463, "SDN": 264.01, "SUR": 356.44, "SWE": 45.08, "CHE": 45.62, "SYR": 541.17, "TWN":
|
|
25
|
+
const data = { "AFG": 120.48, "AFRICA": 484.16, "ALB": 23.44, "DZA": 498.9, "ASM": 687.5, "AGO": 195.98, "ATG": 657.14, "ARG": 344.31, "ARM": 222.68, "ABW": 591.4, "ASEAN": 508.06, "ASIA": 535.23, "AUS": 501.7, "AUT": 157.52, "AZE": 532.9, "BHS": 698.11, "BHR": 494.02, "BGD": 577.03, "BRB": 644.86, "BLR": 415.64, "BEL": 165.36, "BLZ": 484.38, "BEN": 666.67, "BTN": 24.44, "BOL": 322.09, "BIH": 516.01, "BWA": 794.52, "BRA": 102.09, "BRN": 658.85, "BGR": 399.57, "BFA": 611.43, "BDI": 250, "CPV": 600, "KHM": 400.46, "CMR": 278.26, "CAN": 125.84, "CYM": 684.93, "CAF": 0, "TCD": 677.42, "CHL": 332.61, "CHN": 533.98, "COL": 168.95, "COM": 714.29, "COG": 395.52, "COD": 25.36, "COK": 400, "CRI": 37.21, "CIV": 410.75, "HRV": 246.46, "CUB": 602.23, "CYP": 589.35, "CZE": 415.35, "DNK": 180.71, "DJI": 666.67, "DMA": 529.41, "DOM": 549.8, "ECU": 188.71, "EGY": 469.63, "SLV": 194.23, "GNQ": 492.96, "ERI": 688.89, "EST": 464.03, "SWZ": 189.19, "ETH": 25.19, "EU": 277.19, "EUROPE": 296.45, "FLK": 500, "FRO": 428.57, "FJI": 289.47, "FIN": 130.98, "FRA": 84.82, "GUF": 254.72, "PYF": 471.43, "G20": 442.38, "G7": 343.92, "GAB": 397.38, "GMB": 700, "GEO": 134.83, "DEU": 384.83, "GHA": 361.2, "GRC": 343.82, "GRL": 133.33, "GRD": 714.29, "GLP": 623.53, "GUM": 670.33, "GTM": 291.55, "GIN": 208.63, "GNB": 750, "GUY": 642.28, "HTI": 606.06, "HND": 373.96, "HKG": 683.97, "HUN": 222.97, "ISL": 28.56, "IND": 633.4, "IDN": 619.02, "IRN": 487.86, "IRQ": 498.87, "IRL": 346.33, "ISR": 548.03, "ITA": 371.69, "JAM": 537.93, "JPN": 494.86, "JOR": 399.91, "KAZ": 635.57, "KEN": 100.57, "KIR": 666.67, "XKX": 768.73, "KWT": 551.74, "KGZ": 104.43, "LAO": 242.18, "LATIN AMERICA AND CARIBBEAN": 238.68, "LVA": 181.82, "LBN": 605.74, "LSO": 20, "LBR": 304.35, "LBY": 550.42, "LTU": 194.25, "LUX": 168.14, "MAC": 491.53, "MDG": 483.25, "MWI": 133.8, "MYS": 543.87, "MDV": 651.52, "MLI": 463.13, "MLT": 495, "MTQ": 698.63, "MRT": 526.6, "MUS": 611.11, "MEX": 423.81, "MIDDLE EAST": 516.02, "MDA": 677.18, "MNG": 749.66, "MNE": 399.38, "MSR": 1e3, "MAR": 610.41, "MOZ": 126.63, "MMR": 344.37, "NAM": 63.69, "NRU": 750, "NPL": 24.51, "NLD": 355.78, "NCL": 610.12, "NZL": 97.73, "NIC": 354.21, "NER": 622.22, "NGA": 368.11, "NORTH AMERICA": 336.01, "PRK": 157.79, "MKD": 529.33, "NOR": 28.82, "OCEANIA": 449.71, "OECD": 340.95, "OMN": 488.27, "PAK": 344.16, "PSE": 465.12, "PAN": 186.61, "PNG": 526.75, "PRY": 25.49, "PER": 256.51, "POL": 633.1, "PRT": 234.03, "PRI": 681.47, "QAT": 489.88, "REU": 519.03, "ROU": 264.12, "RUS": 363.68, "RWA": 294.12, "KNA": 681.82, "LCA": 685.71, "SPM": 800, "VCT": 500, "WSM": 470.59, "STP": 600, "SAU": 557.78, "SEN": 523.13, "SRB": 569.38, "SYC": 615.39, "SLE": 47.62, "SGP": 488.78, "SVK": 140.67, "SVN": 237.38, "SLB": 727.27, "SOM": 634.15, "ZAF": 708.19, "KOR": 437.6, "SSD": 684.21, "ESP": 217.37, "LKA": 463, "SDN": 264.01, "SUR": 356.44, "SWE": 45.08, "CHE": 45.62, "SYR": 541.17, "TWN": 560.98, "TJK": 83.63, "TZA": 366.75, "THA": 501.57, "PHL": 582.84, "TGO": 460.32, "TON": 625, "TTO": 491.41, "TUN": 469.43, "TUR": 413.63, "TKM": 490.19, "TCA": 703.7, "UGA": 52.27, "UKR": 187.06, "ARE": 407.98, "GBR": 261.24, "USA": 367.26, "URY": 114.89, "UZB": 505.41, "VUT": 571.43, "VEN": 212.48, "VNM": 386.49, "VGB": 714.29, "VIR": 685.71, "WORLD": 437.26, "YEM": 543.91, "ZMB": 84.7, "ZWE": 392.28 };
|
|
26
26
|
const type = "average";
|
|
27
27
|
var average_intensities_min_default = { data, type };
|
|
28
28
|
//# sourceMappingURL=average-intensities.min.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/data/average-intensities.min.js"],
|
|
4
|
-
"sourcesContent": ["const data = {\"AFG\":120.48,\"AFRICA\":484.16,\"ALB\":23.44,\"DZA\":498.9,\"ASM\":687.5,\"AGO\":195.98,\"ATG\":657.14,\"ARG\":344.31,\"ARM\":222.68,\"ABW\":591.4,\"ASEAN\":508.06,\"ASIA\":535.23,\"AUS\":501.7,\"AUT\":157.52,\"AZE\":532.9,\"BHS\":698.11,\"BHR\":494.02,\"BGD\":577.03,\"BRB\":644.86,\"BLR\":415.64,\"BEL\":165.36,\"BLZ\":484.38,\"BEN\":666.67,\"BTN\":24.44,\"BOL\":322.09,\"BIH\":516.01,\"BWA\":794.52,\"BRA\":102.09,\"BRN\":658.85,\"BGR\":399.57,\"BFA\":611.43,\"BDI\":250,\"CPV\":600,\"KHM\":400.46,\"CMR\":278.26,\"CAN\":125.84,\"CYM\":684.93,\"CAF\":0,\"TCD\":677.42,\"CHL\":332.61,\"CHN\":533.98,\"COL\":168.95,\"COM\":714.29,\"COG\":395.52,\"COD\":25.36,\"COK\":400,\"CRI\":37.21,\"CIV\":410.75,\"HRV\":246.46,\"CUB\":602.23,\"CYP\":589.35,\"CZE\":415.35,\"DNK\":180.71,\"DJI\":666.67,\"DMA\":529.41,\"DOM\":549.8,\"ECU\":188.71,\"EGY\":469.63,\"SLV\":194.23,\"GNQ\":492.96,\"ERI\":688.89,\"EST\":464.03,\"SWZ\":189.19,\"ETH\":25.19,\"EU\":277.19,\"EUROPE\":296.45,\"FLK\":500,\"FRO\":428.57,\"FJI\":289.47,\"FIN\":130.98,\"FRA\":84.82,\"GUF\":254.72,\"PYF\":471.43,\"G20\":442.38,\"G7\":343.92,\"GAB\":397.38,\"GMB\":700,\"GEO\":134.83,\"DEU\":384.83,\"GHA\":361.2,\"GRC\":343.82,\"GRL\":133.33,\"GRD\":714.29,\"GLP\":623.53,\"GUM\":670.33,\"GTM\":291.55,\"GIN\":208.63,\"GNB\":750,\"GUY\":642.28,\"HTI\":606.06,\"HND\":373.96,\"HKG\":683.97,\"HUN\":222.97,\"ISL\":28.56,\"IND\":633.4,\"IDN\":619.02,\"IRN\":487.86,\"IRQ\":498.87,\"IRL\":346.33,\"ISR\":548.03,\"ITA\":371.69,\"JAM\":537.93,\"JPN\":494.86,\"JOR\":399.91,\"KAZ\":635.57,\"KEN\":100.57,\"KIR\":666.67,\"XKX\":768.73,\"KWT\":551.74,\"KGZ\":104.43,\"LAO\":242.18,\"LATIN AMERICA AND CARIBBEAN\":238.68,\"LVA\":181.82,\"LBN\":605.74,\"LSO\":20,\"LBR\":304.35,\"LBY\":550.42,\"LTU\":194.25,\"LUX\":168.14,\"MAC\":491.53,\"MDG\":483.25,\"MWI\":133.8,\"MYS\":543.87,\"MDV\":651.52,\"MLI\":463.13,\"MLT\":495,\"MTQ\":698.63,\"MRT\":526.6,\"MUS\":611.11,\"MEX\":423.81,\"MIDDLE EAST\":516.02,\"MDA\":677.18,\"MNG\":749.66,\"MNE\":399.38,\"MSR\":1000,\"MAR\":610.41,\"MOZ\":126.63,\"MMR\":344.37,\"NAM\":63.69,\"NRU\":750,\"NPL\":24.51,\"NLD\":355.78,\"NCL\":610.12,\"NZL\":97.73,\"NIC\":354.21,\"NER\":622.22,\"NGA\":368.11,\"NORTH AMERICA\":336.01,\"PRK\":157.79,\"MKD\":529.33,\"NOR\":28.82,\"OCEANIA\":449.71,\"OECD\":340.95,\"OMN\":488.27,\"PAK\":344.16,\"PSE\":465.12,\"PAN\":186.61,\"PNG\":526.75,\"PRY\":25.49,\"PER\":256.51,\"POL\":633.1,\"PRT\":234.03,\"PRI\":681.47,\"QAT\":489.88,\"REU\":519.03,\"ROU\":264.12,\"RUS\":363.68,\"RWA\":294.12,\"KNA\":681.82,\"LCA\":685.71,\"SPM\":800,\"VCT\":500,\"WSM\":470.59,\"STP\":600,\"SAU\":557.78,\"SEN\":523.13,\"SRB\":569.38,\"SYC\":615.39,\"SLE\":47.62,\"SGP\":488.78,\"SVK\":140.67,\"SVN\":237.38,\"SLB\":727.27,\"SOM\":634.15,\"ZAF\":708.19,\"KOR\":437.6,\"SSD\":684.21,\"ESP\":217.37,\"LKA\":463,\"SDN\":264.01,\"SUR\":356.44,\"SWE\":45.08,\"CHE\":45.62,\"SYR\":541.17,\"TWN\":
|
|
4
|
+
"sourcesContent": ["const data = {\"AFG\":120.48,\"AFRICA\":484.16,\"ALB\":23.44,\"DZA\":498.9,\"ASM\":687.5,\"AGO\":195.98,\"ATG\":657.14,\"ARG\":344.31,\"ARM\":222.68,\"ABW\":591.4,\"ASEAN\":508.06,\"ASIA\":535.23,\"AUS\":501.7,\"AUT\":157.52,\"AZE\":532.9,\"BHS\":698.11,\"BHR\":494.02,\"BGD\":577.03,\"BRB\":644.86,\"BLR\":415.64,\"BEL\":165.36,\"BLZ\":484.38,\"BEN\":666.67,\"BTN\":24.44,\"BOL\":322.09,\"BIH\":516.01,\"BWA\":794.52,\"BRA\":102.09,\"BRN\":658.85,\"BGR\":399.57,\"BFA\":611.43,\"BDI\":250,\"CPV\":600,\"KHM\":400.46,\"CMR\":278.26,\"CAN\":125.84,\"CYM\":684.93,\"CAF\":0,\"TCD\":677.42,\"CHL\":332.61,\"CHN\":533.98,\"COL\":168.95,\"COM\":714.29,\"COG\":395.52,\"COD\":25.36,\"COK\":400,\"CRI\":37.21,\"CIV\":410.75,\"HRV\":246.46,\"CUB\":602.23,\"CYP\":589.35,\"CZE\":415.35,\"DNK\":180.71,\"DJI\":666.67,\"DMA\":529.41,\"DOM\":549.8,\"ECU\":188.71,\"EGY\":469.63,\"SLV\":194.23,\"GNQ\":492.96,\"ERI\":688.89,\"EST\":464.03,\"SWZ\":189.19,\"ETH\":25.19,\"EU\":277.19,\"EUROPE\":296.45,\"FLK\":500,\"FRO\":428.57,\"FJI\":289.47,\"FIN\":130.98,\"FRA\":84.82,\"GUF\":254.72,\"PYF\":471.43,\"G20\":442.38,\"G7\":343.92,\"GAB\":397.38,\"GMB\":700,\"GEO\":134.83,\"DEU\":384.83,\"GHA\":361.2,\"GRC\":343.82,\"GRL\":133.33,\"GRD\":714.29,\"GLP\":623.53,\"GUM\":670.33,\"GTM\":291.55,\"GIN\":208.63,\"GNB\":750,\"GUY\":642.28,\"HTI\":606.06,\"HND\":373.96,\"HKG\":683.97,\"HUN\":222.97,\"ISL\":28.56,\"IND\":633.4,\"IDN\":619.02,\"IRN\":487.86,\"IRQ\":498.87,\"IRL\":346.33,\"ISR\":548.03,\"ITA\":371.69,\"JAM\":537.93,\"JPN\":494.86,\"JOR\":399.91,\"KAZ\":635.57,\"KEN\":100.57,\"KIR\":666.67,\"XKX\":768.73,\"KWT\":551.74,\"KGZ\":104.43,\"LAO\":242.18,\"LATIN AMERICA AND CARIBBEAN\":238.68,\"LVA\":181.82,\"LBN\":605.74,\"LSO\":20,\"LBR\":304.35,\"LBY\":550.42,\"LTU\":194.25,\"LUX\":168.14,\"MAC\":491.53,\"MDG\":483.25,\"MWI\":133.8,\"MYS\":543.87,\"MDV\":651.52,\"MLI\":463.13,\"MLT\":495,\"MTQ\":698.63,\"MRT\":526.6,\"MUS\":611.11,\"MEX\":423.81,\"MIDDLE EAST\":516.02,\"MDA\":677.18,\"MNG\":749.66,\"MNE\":399.38,\"MSR\":1000,\"MAR\":610.41,\"MOZ\":126.63,\"MMR\":344.37,\"NAM\":63.69,\"NRU\":750,\"NPL\":24.51,\"NLD\":355.78,\"NCL\":610.12,\"NZL\":97.73,\"NIC\":354.21,\"NER\":622.22,\"NGA\":368.11,\"NORTH AMERICA\":336.01,\"PRK\":157.79,\"MKD\":529.33,\"NOR\":28.82,\"OCEANIA\":449.71,\"OECD\":340.95,\"OMN\":488.27,\"PAK\":344.16,\"PSE\":465.12,\"PAN\":186.61,\"PNG\":526.75,\"PRY\":25.49,\"PER\":256.51,\"POL\":633.1,\"PRT\":234.03,\"PRI\":681.47,\"QAT\":489.88,\"REU\":519.03,\"ROU\":264.12,\"RUS\":363.68,\"RWA\":294.12,\"KNA\":681.82,\"LCA\":685.71,\"SPM\":800,\"VCT\":500,\"WSM\":470.59,\"STP\":600,\"SAU\":557.78,\"SEN\":523.13,\"SRB\":569.38,\"SYC\":615.39,\"SLE\":47.62,\"SGP\":488.78,\"SVK\":140.67,\"SVN\":237.38,\"SLB\":727.27,\"SOM\":634.15,\"ZAF\":708.19,\"KOR\":437.6,\"SSD\":684.21,\"ESP\":217.37,\"LKA\":463,\"SDN\":264.01,\"SUR\":356.44,\"SWE\":45.08,\"CHE\":45.62,\"SYR\":541.17,\"TWN\":560.98,\"TJK\":83.63,\"TZA\":366.75,\"THA\":501.57,\"PHL\":582.84,\"TGO\":460.32,\"TON\":625,\"TTO\":491.41,\"TUN\":469.43,\"TUR\":413.63,\"TKM\":490.19,\"TCA\":703.7,\"UGA\":52.27,\"UKR\":187.06,\"ARE\":407.98,\"GBR\":261.24,\"USA\":367.26,\"URY\":114.89,\"UZB\":505.41,\"VUT\":571.43,\"VEN\":212.48,\"VNM\":386.49,\"VGB\":714.29,\"VIR\":685.71,\"WORLD\":437.26,\"YEM\":543.91,\"ZMB\":84.7,\"ZWE\":392.28}; const type = \"average\"; export { data, type }; export default { data, type };"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,OAAO,EAAC,OAAM,QAAO,UAAS,QAAO,OAAM,OAAM,OAAM,OAAM,OAAM,OAAM,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,OAAM,SAAQ,QAAO,QAAO,QAAO,OAAM,OAAM,OAAM,QAAO,OAAM,OAAM,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,OAAM,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,KAAI,OAAM,KAAI,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,GAAE,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,OAAM,OAAM,KAAI,OAAM,OAAM,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM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,QAAO,OAAM,OAAM,OAAM,QAAO,OAAM,OAAM,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,KAAI,OAAM,KAAI,OAAM,QAAO,OAAM,KAAI,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,OAAM,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,OAAM,OAAM,QAAO,OAAM,QAAO,OAAM,KAAI,OAAM,QAAO,OAAM,QAAO,OAAM,OAAM,OAAM,OAAM,OAAM,QAAO,OAAM,QAAO,OAAM,OAAM,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,KAAI,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,OAAM,OAAM,OAAM,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,OAAM,QAAO,SAAQ,QAAO,OAAM,QAAO,OAAM,MAAK,OAAM,OAAM;AAAG,MAAM,OAAO;AAAkC,IAAO,kCAAQ,EAAE,MAAM,KAAK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,7 +33,7 @@ function parseOptions(options) {
|
|
|
33
33
|
if (options == null ? void 0 : options.gridIntensity) {
|
|
34
34
|
adjustments.gridIntensity = {};
|
|
35
35
|
const { device, dataCenter, network } = options.gridIntensity;
|
|
36
|
-
if (device) {
|
|
36
|
+
if (device || device === 0) {
|
|
37
37
|
if (typeof device === "object") {
|
|
38
38
|
if (!import__.averageIntensity.data[(_a = device.country) == null ? void 0 : _a.toUpperCase()]) {
|
|
39
39
|
console.warn(`"${device.country}" is not a valid country. Please use a valid 3 digit ISO 3166 country code.
|
|
@@ -59,7 +59,7 @@ Falling back to global average grid intensity.`);
|
|
|
59
59
|
Falling back to global average grid intensity.`);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
if (dataCenter) {
|
|
62
|
+
if (dataCenter || dataCenter === 0) {
|
|
63
63
|
if (typeof dataCenter === "object") {
|
|
64
64
|
if (!import__.averageIntensity.data[(_c = dataCenter.country) == null ? void 0 : _c.toUpperCase()]) {
|
|
65
65
|
console.warn(`"${dataCenter.country}" is not a valid country. Please use a valid 3 digit ISO 3166 country code.
|
|
@@ -85,7 +85,7 @@ Falling back to global average grid intensity.`);
|
|
|
85
85
|
Falling back to global average grid intensity.`);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
if (network) {
|
|
88
|
+
if (network || network === 0) {
|
|
89
89
|
if (typeof network === "object") {
|
|
90
90
|
if (!import__.averageIntensity.data[(_e = network.country) == null ? void 0 : _e.toUpperCase()]) {
|
|
91
91
|
console.warn(`"${network.country}" is not a valid country. Please use a valid 3 digit ISO 3166 country code.
|
|
@@ -112,7 +112,7 @@ Falling back to global average grid intensity.`);
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
if (options == null ? void 0 : options.dataReloadRatio) {
|
|
115
|
+
if ((options == null ? void 0 : options.dataReloadRatio) || options.dataReloadRatio === 0) {
|
|
116
116
|
if (typeof options.dataReloadRatio === "number") {
|
|
117
117
|
if (options.dataReloadRatio >= 0 && options.dataReloadRatio <= 1) {
|
|
118
118
|
adjustments.dataReloadRatio = options.dataReloadRatio;
|
|
@@ -127,7 +127,7 @@ Falling back to default value.`);
|
|
|
127
127
|
Falling back to default value.`);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
if (options == null ? void 0 : options.firstVisitPercentage) {
|
|
130
|
+
if ((options == null ? void 0 : options.firstVisitPercentage) || options.firstVisitPercentage === 0) {
|
|
131
131
|
if (typeof options.firstVisitPercentage === "number") {
|
|
132
132
|
if (options.firstVisitPercentage >= 0 && options.firstVisitPercentage <= 1) {
|
|
133
133
|
adjustments.firstVisitPercentage = options.firstVisitPercentage;
|
|
@@ -142,7 +142,7 @@ Falling back to default value.`);
|
|
|
142
142
|
Falling back to default value.`);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
if (options == null ? void 0 : options.returnVisitPercentage) {
|
|
145
|
+
if ((options == null ? void 0 : options.returnVisitPercentage) || options.returnVisitPercentage === 0) {
|
|
146
146
|
if (typeof options.returnVisitPercentage === "number") {
|
|
147
147
|
if (options.returnVisitPercentage >= 0 && options.returnVisitPercentage <= 1) {
|
|
148
148
|
adjustments.returnVisitPercentage = options.returnVisitPercentage;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/index.js"],
|
|
4
|
-
"sourcesContent": ["import { averageIntensity } from \"../index.js\";\nimport {\n GLOBAL_GRID_INTENSITY,\n PERCENTAGE_OF_DATA_LOADED_ON_SUBSEQUENT_LOAD,\n FIRST_TIME_VIEWING_PERCENTAGE,\n RETURNING_VISITOR_PERCENTAGE,\n} from \"../constants/index.js\";\nconst formatNumber = (num) => parseFloat(num.toFixed(2));\n\nfunction parseOptions(options) {\n // CHeck that it is an object\n if (typeof options !== \"object\") {\n throw new Error(\"Options must be an object\");\n }\n\n const adjustments = {};\n\n if (options?.gridIntensity) {\n adjustments.gridIntensity = {};\n const { device, dataCenter, network } = options.gridIntensity;\n if (device) {\n if (typeof device === \"object\") {\n if (!averageIntensity.data[device.country?.toUpperCase()]) {\n console.warn(\n `\"${device.country}\" is not a valid country. Please use a valid 3 digit ISO 3166 country code. \\nSee https://developers.thegreenwebfoundation.org/co2js/data/ for more information. \\nFalling back to global average grid intensity.`\n );\n adjustments.gridIntensity[\"device\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n }\n adjustments.gridIntensity[\"device\"] = {\n country: device.country,\n value: parseFloat(\n averageIntensity.data[device.country?.toUpperCase()]\n ),\n };\n } else if (typeof device === \"number\") {\n adjustments.gridIntensity[\"device\"] = {\n value: device,\n };\n } else {\n adjustments.gridIntensity[\"device\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n console.warn(\n `The device grid intensity must be a number or an object. You passed in a ${typeof device}. \\nFalling back to global average grid intensity.`\n );\n }\n }\n if (dataCenter) {\n if (typeof dataCenter === \"object\") {\n if (!averageIntensity.data[dataCenter.country?.toUpperCase()]) {\n console.warn(\n `\"${dataCenter.country}\" is not a valid country. Please use a valid 3 digit ISO 3166 country code. \\nSee https://developers.thegreenwebfoundation.org/co2js/data/ for more information. \\nFalling back to global average grid intensity.`\n );\n adjustments.gridIntensity[\"dataCenter\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n }\n adjustments.gridIntensity[\"dataCenter\"] = {\n country: dataCenter.country,\n value: parseFloat(\n averageIntensity.data[dataCenter.country?.toUpperCase()]\n ),\n };\n } else if (typeof dataCenter === \"number\") {\n adjustments.gridIntensity[\"dataCenter\"] = {\n value: dataCenter,\n };\n } else {\n adjustments.gridIntensity[\"dataCenter\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n console.warn(\n `The data center grid intensity must be a number or an object. You passed in a ${typeof dataCenter}. \\nFalling back to global average grid intensity.`\n );\n }\n }\n if (network) {\n if (typeof network === \"object\") {\n if (!averageIntensity.data[network.country?.toUpperCase()]) {\n console.warn(\n `\"${network.country}\" is not a valid country. Please use a valid 3 digit ISO 3166 country code. \\nSee https://developers.thegreenwebfoundation.org/co2js/data/ for more information. Falling back to global average grid intensity. \\nFalling back to global average grid intensity.`\n );\n adjustments.gridIntensity[\"network\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n }\n adjustments.gridIntensity[\"network\"] = {\n country: network.country,\n value: parseFloat(\n averageIntensity.data[network.country?.toUpperCase()]\n ),\n };\n } else if (typeof network === \"number\") {\n adjustments.gridIntensity[\"network\"] = {\n value: network,\n };\n } else {\n adjustments.gridIntensity[\"network\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n console.warn(\n `The network grid intensity must be a number or an object. You passed in a ${typeof network}. \\nFalling back to global average grid intensity.`\n );\n }\n }\n }\n\n if (options?.dataReloadRatio) {\n if (typeof options.dataReloadRatio === \"number\") {\n if (options.dataReloadRatio >= 0 && options.dataReloadRatio <= 1) {\n adjustments.dataReloadRatio = options.dataReloadRatio;\n } else {\n adjustments.dataReloadRatio =\n PERCENTAGE_OF_DATA_LOADED_ON_SUBSEQUENT_LOAD;\n console.warn(\n `The dataReloadRatio option must be a number between 0 and 1. You passed in ${options.dataReloadRatio}. \\nFalling back to default value.`\n );\n }\n } else {\n adjustments.dataReloadRatio =\n PERCENTAGE_OF_DATA_LOADED_ON_SUBSEQUENT_LOAD;\n console.warn(\n `The dataReloadRatio option must be a number. You passed in a ${typeof options.dataReloadRatio}. \\nFalling back to default value.`\n );\n }\n }\n\n if (options?.firstVisitPercentage) {\n if (typeof options.firstVisitPercentage === \"number\") {\n if (\n options.firstVisitPercentage >= 0 &&\n options.firstVisitPercentage <= 1\n ) {\n adjustments.firstVisitPercentage = options.firstVisitPercentage;\n } else {\n adjustments.firstVisitPercentage = FIRST_TIME_VIEWING_PERCENTAGE;\n console.warn(\n `The firstVisitPercentage option must be a number between 0 and 1. You passed in ${options.firstVisitPercentage}. \\nFalling back to default value.`\n );\n }\n } else {\n adjustments.firstVisitPercentage = FIRST_TIME_VIEWING_PERCENTAGE;\n console.warn(\n `The firstVisitPercentage option must be a number. You passed in a ${typeof options.firstVisitPercentage}. \\nFalling back to default value.`\n );\n }\n }\n\n if (options?.returnVisitPercentage) {\n if (typeof options.returnVisitPercentage === \"number\") {\n if (\n options.returnVisitPercentage >= 0 &&\n options.returnVisitPercentage <= 1\n ) {\n adjustments.returnVisitPercentage = options.returnVisitPercentage;\n } else {\n adjustments.returnVisitPercentage = RETURNING_VISITOR_PERCENTAGE;\n console.warn(\n `The returnVisitPercentage option must be a number between 0 and 1. You passed in ${options.returnVisitPercentage}. \\nFalling back to default value.`\n );\n }\n } else {\n adjustments.returnVisitPercentage = RETURNING_VISITOR_PERCENTAGE;\n console.warn(\n `The returnVisitPercentage option must be a number. You passed in a ${typeof options.returnVisitPercentage}. \\nFalling back to default value.`\n );\n }\n }\n\n return adjustments;\n}\n\nexport { formatNumber, parseOptions };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAiC;AACjC,uBAKO;AACP,MAAM,eAAe,CAAC,QAAQ,WAAW,IAAI,QAAQ,CAAC,CAAC;AAEvD,sBAAsB,SAAS;AAT/B;AAWE,MAAI,OAAO,YAAY,UAAU;AAC/B,UAAM,IAAI,MAAM,2BAA2B;AAAA,EAC7C;AAEA,QAAM,cAAc,CAAC;AAErB,MAAI,mCAAS,eAAe;AAC1B,gBAAY,gBAAgB,CAAC;AAC7B,UAAM,EAAE,QAAQ,YAAY,YAAY,QAAQ;AAChD,QAAI,
|
|
4
|
+
"sourcesContent": ["import { averageIntensity } from \"../index.js\";\nimport {\n GLOBAL_GRID_INTENSITY,\n PERCENTAGE_OF_DATA_LOADED_ON_SUBSEQUENT_LOAD,\n FIRST_TIME_VIEWING_PERCENTAGE,\n RETURNING_VISITOR_PERCENTAGE,\n} from \"../constants/index.js\";\nconst formatNumber = (num) => parseFloat(num.toFixed(2));\n\nfunction parseOptions(options) {\n // CHeck that it is an object\n if (typeof options !== \"object\") {\n throw new Error(\"Options must be an object\");\n }\n\n const adjustments = {};\n\n if (options?.gridIntensity) {\n adjustments.gridIntensity = {};\n const { device, dataCenter, network } = options.gridIntensity;\n if (device || device === 0) {\n if (typeof device === \"object\") {\n if (!averageIntensity.data[device.country?.toUpperCase()]) {\n console.warn(\n `\"${device.country}\" is not a valid country. Please use a valid 3 digit ISO 3166 country code. \\nSee https://developers.thegreenwebfoundation.org/co2js/data/ for more information. \\nFalling back to global average grid intensity.`\n );\n adjustments.gridIntensity[\"device\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n }\n adjustments.gridIntensity[\"device\"] = {\n country: device.country,\n value: parseFloat(\n averageIntensity.data[device.country?.toUpperCase()]\n ),\n };\n } else if (typeof device === \"number\") {\n adjustments.gridIntensity[\"device\"] = {\n value: device,\n };\n } else {\n adjustments.gridIntensity[\"device\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n console.warn(\n `The device grid intensity must be a number or an object. You passed in a ${typeof device}. \\nFalling back to global average grid intensity.`\n );\n }\n }\n if (dataCenter || dataCenter === 0) {\n if (typeof dataCenter === \"object\") {\n if (!averageIntensity.data[dataCenter.country?.toUpperCase()]) {\n console.warn(\n `\"${dataCenter.country}\" is not a valid country. Please use a valid 3 digit ISO 3166 country code. \\nSee https://developers.thegreenwebfoundation.org/co2js/data/ for more information. \\nFalling back to global average grid intensity.`\n );\n adjustments.gridIntensity[\"dataCenter\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n }\n adjustments.gridIntensity[\"dataCenter\"] = {\n country: dataCenter.country,\n value: parseFloat(\n averageIntensity.data[dataCenter.country?.toUpperCase()]\n ),\n };\n } else if (typeof dataCenter === \"number\") {\n adjustments.gridIntensity[\"dataCenter\"] = {\n value: dataCenter,\n };\n } else {\n adjustments.gridIntensity[\"dataCenter\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n console.warn(\n `The data center grid intensity must be a number or an object. You passed in a ${typeof dataCenter}. \\nFalling back to global average grid intensity.`\n );\n }\n }\n if (network || network === 0) {\n if (typeof network === \"object\") {\n if (!averageIntensity.data[network.country?.toUpperCase()]) {\n console.warn(\n `\"${network.country}\" is not a valid country. Please use a valid 3 digit ISO 3166 country code. \\nSee https://developers.thegreenwebfoundation.org/co2js/data/ for more information. Falling back to global average grid intensity. \\nFalling back to global average grid intensity.`\n );\n adjustments.gridIntensity[\"network\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n }\n adjustments.gridIntensity[\"network\"] = {\n country: network.country,\n value: parseFloat(\n averageIntensity.data[network.country?.toUpperCase()]\n ),\n };\n } else if (typeof network === \"number\") {\n adjustments.gridIntensity[\"network\"] = {\n value: network,\n };\n } else {\n adjustments.gridIntensity[\"network\"] = {\n value: GLOBAL_GRID_INTENSITY,\n };\n console.warn(\n `The network grid intensity must be a number or an object. You passed in a ${typeof network}. \\nFalling back to global average grid intensity.`\n );\n }\n }\n }\n\n if (options?.dataReloadRatio || options.dataReloadRatio === 0) {\n if (typeof options.dataReloadRatio === \"number\") {\n if (options.dataReloadRatio >= 0 && options.dataReloadRatio <= 1) {\n adjustments.dataReloadRatio = options.dataReloadRatio;\n } else {\n adjustments.dataReloadRatio =\n PERCENTAGE_OF_DATA_LOADED_ON_SUBSEQUENT_LOAD;\n console.warn(\n `The dataReloadRatio option must be a number between 0 and 1. You passed in ${options.dataReloadRatio}. \\nFalling back to default value.`\n );\n }\n } else {\n adjustments.dataReloadRatio =\n PERCENTAGE_OF_DATA_LOADED_ON_SUBSEQUENT_LOAD;\n console.warn(\n `The dataReloadRatio option must be a number. You passed in a ${typeof options.dataReloadRatio}. \\nFalling back to default value.`\n );\n }\n }\n\n if (options?.firstVisitPercentage || options.firstVisitPercentage === 0) {\n if (typeof options.firstVisitPercentage === \"number\") {\n if (\n options.firstVisitPercentage >= 0 &&\n options.firstVisitPercentage <= 1\n ) {\n adjustments.firstVisitPercentage = options.firstVisitPercentage;\n } else {\n adjustments.firstVisitPercentage = FIRST_TIME_VIEWING_PERCENTAGE;\n console.warn(\n `The firstVisitPercentage option must be a number between 0 and 1. You passed in ${options.firstVisitPercentage}. \\nFalling back to default value.`\n );\n }\n } else {\n adjustments.firstVisitPercentage = FIRST_TIME_VIEWING_PERCENTAGE;\n console.warn(\n `The firstVisitPercentage option must be a number. You passed in a ${typeof options.firstVisitPercentage}. \\nFalling back to default value.`\n );\n }\n }\n\n if (options?.returnVisitPercentage || options.returnVisitPercentage === 0) {\n if (typeof options.returnVisitPercentage === \"number\") {\n if (\n options.returnVisitPercentage >= 0 &&\n options.returnVisitPercentage <= 1\n ) {\n adjustments.returnVisitPercentage = options.returnVisitPercentage;\n } else {\n adjustments.returnVisitPercentage = RETURNING_VISITOR_PERCENTAGE;\n console.warn(\n `The returnVisitPercentage option must be a number between 0 and 1. You passed in ${options.returnVisitPercentage}. \\nFalling back to default value.`\n );\n }\n } else {\n adjustments.returnVisitPercentage = RETURNING_VISITOR_PERCENTAGE;\n console.warn(\n `The returnVisitPercentage option must be a number. You passed in a ${typeof options.returnVisitPercentage}. \\nFalling back to default value.`\n );\n }\n }\n\n return adjustments;\n}\n\nexport { formatNumber, parseOptions };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAiC;AACjC,uBAKO;AACP,MAAM,eAAe,CAAC,QAAQ,WAAW,IAAI,QAAQ,CAAC,CAAC;AAEvD,sBAAsB,SAAS;AAT/B;AAWE,MAAI,OAAO,YAAY,UAAU;AAC/B,UAAM,IAAI,MAAM,2BAA2B;AAAA,EAC7C;AAEA,QAAM,cAAc,CAAC;AAErB,MAAI,mCAAS,eAAe;AAC1B,gBAAY,gBAAgB,CAAC;AAC7B,UAAM,EAAE,QAAQ,YAAY,YAAY,QAAQ;AAChD,QAAI,UAAU,WAAW,GAAG;AAC1B,UAAI,OAAO,WAAW,UAAU;AAC9B,YAAI,CAAC,0BAAiB,KAAK,aAAO,YAAP,mBAAgB,gBAAgB;AACzD,kBAAQ,KACN,IAAI,OAAO;AAAA;AAAA,+CACb;AACA,sBAAY,cAAc,YAAY;AAAA,YACpC,OAAO;AAAA,UACT;AAAA,QACF;AACA,oBAAY,cAAc,YAAY;AAAA,UACpC,SAAS,OAAO;AAAA,UAChB,OAAO,WACL,0BAAiB,KAAK,aAAO,YAAP,mBAAgB,cACxC;AAAA,QACF;AAAA,MACF,WAAW,OAAO,WAAW,UAAU;AACrC,oBAAY,cAAc,YAAY;AAAA,UACpC,OAAO;AAAA,QACT;AAAA,MACF,OAAO;AACL,oB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AAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate_average_co2.d.ts","sourceRoot":"","sources":["../../../data/functions/generate_average_co2.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate_marginal_co2.d.ts","sourceRoot":"","sources":["../../../data/functions/generate_marginal_co2.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { data };
|
|
3
|
+
export { type };
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export const data: {
|
|
7
|
+
AFG: number;
|
|
8
|
+
AFRICA: number;
|
|
9
|
+
ALB: number;
|
|
10
|
+
DZA: number;
|
|
11
|
+
ASM: number;
|
|
12
|
+
AGO: number;
|
|
13
|
+
ATG: number;
|
|
14
|
+
ARG: number;
|
|
15
|
+
ARM: number;
|
|
16
|
+
ABW: number;
|
|
17
|
+
ASEAN: number;
|
|
18
|
+
ASIA: number;
|
|
19
|
+
AUS: number;
|
|
20
|
+
AUT: number;
|
|
21
|
+
AZE: number;
|
|
22
|
+
BHS: number;
|
|
23
|
+
BHR: number;
|
|
24
|
+
BGD: number;
|
|
25
|
+
BRB: number;
|
|
26
|
+
BLR: number;
|
|
27
|
+
BEL: number;
|
|
28
|
+
BLZ: number;
|
|
29
|
+
BEN: number;
|
|
30
|
+
BTN: number;
|
|
31
|
+
BOL: number;
|
|
32
|
+
BIH: number;
|
|
33
|
+
BWA: number;
|
|
34
|
+
BRA: number;
|
|
35
|
+
BRN: number;
|
|
36
|
+
BGR: number;
|
|
37
|
+
BFA: number;
|
|
38
|
+
BDI: number;
|
|
39
|
+
CPV: number;
|
|
40
|
+
KHM: number;
|
|
41
|
+
CMR: number;
|
|
42
|
+
CAN: number;
|
|
43
|
+
CYM: number;
|
|
44
|
+
CAF: number;
|
|
45
|
+
TCD: number;
|
|
46
|
+
CHL: number;
|
|
47
|
+
CHN: number;
|
|
48
|
+
COL: number;
|
|
49
|
+
COM: number;
|
|
50
|
+
COG: number;
|
|
51
|
+
COD: number;
|
|
52
|
+
COK: number;
|
|
53
|
+
CRI: number;
|
|
54
|
+
CIV: number;
|
|
55
|
+
HRV: number;
|
|
56
|
+
CUB: number;
|
|
57
|
+
CYP: number;
|
|
58
|
+
CZE: number;
|
|
59
|
+
DNK: number;
|
|
60
|
+
DJI: number;
|
|
61
|
+
DMA: number;
|
|
62
|
+
DOM: number;
|
|
63
|
+
ECU: number;
|
|
64
|
+
EGY: number;
|
|
65
|
+
SLV: number;
|
|
66
|
+
GNQ: number;
|
|
67
|
+
ERI: number;
|
|
68
|
+
EST: number;
|
|
69
|
+
SWZ: number;
|
|
70
|
+
ETH: number;
|
|
71
|
+
EU: number;
|
|
72
|
+
EUROPE: number;
|
|
73
|
+
FLK: number;
|
|
74
|
+
FRO: number;
|
|
75
|
+
FJI: number;
|
|
76
|
+
FIN: number;
|
|
77
|
+
FRA: number;
|
|
78
|
+
GUF: number;
|
|
79
|
+
PYF: number;
|
|
80
|
+
G20: number;
|
|
81
|
+
G7: number;
|
|
82
|
+
GAB: number;
|
|
83
|
+
GMB: number;
|
|
84
|
+
GEO: number;
|
|
85
|
+
DEU: number;
|
|
86
|
+
GHA: number;
|
|
87
|
+
GRC: number;
|
|
88
|
+
GRL: number;
|
|
89
|
+
GRD: number;
|
|
90
|
+
GLP: number;
|
|
91
|
+
GUM: number;
|
|
92
|
+
GTM: number;
|
|
93
|
+
GIN: number;
|
|
94
|
+
GNB: number;
|
|
95
|
+
GUY: number;
|
|
96
|
+
HTI: number;
|
|
97
|
+
HND: number;
|
|
98
|
+
HKG: number;
|
|
99
|
+
HUN: number;
|
|
100
|
+
ISL: number;
|
|
101
|
+
IND: number;
|
|
102
|
+
IDN: number;
|
|
103
|
+
IRN: number;
|
|
104
|
+
IRQ: number;
|
|
105
|
+
IRL: number;
|
|
106
|
+
ISR: number;
|
|
107
|
+
ITA: number;
|
|
108
|
+
JAM: number;
|
|
109
|
+
JPN: number;
|
|
110
|
+
JOR: number;
|
|
111
|
+
KAZ: number;
|
|
112
|
+
KEN: number;
|
|
113
|
+
KIR: number;
|
|
114
|
+
XKX: number;
|
|
115
|
+
KWT: number;
|
|
116
|
+
KGZ: number;
|
|
117
|
+
LAO: number;
|
|
118
|
+
"LATIN AMERICA AND CARIBBEAN": number;
|
|
119
|
+
LVA: number;
|
|
120
|
+
LBN: number;
|
|
121
|
+
LSO: number;
|
|
122
|
+
LBR: number;
|
|
123
|
+
LBY: number;
|
|
124
|
+
LTU: number;
|
|
125
|
+
LUX: number;
|
|
126
|
+
MAC: number;
|
|
127
|
+
MDG: number;
|
|
128
|
+
MWI: number;
|
|
129
|
+
MYS: number;
|
|
130
|
+
MDV: number;
|
|
131
|
+
MLI: number;
|
|
132
|
+
MLT: number;
|
|
133
|
+
MTQ: number;
|
|
134
|
+
MRT: number;
|
|
135
|
+
MUS: number;
|
|
136
|
+
MEX: number;
|
|
137
|
+
"MIDDLE EAST": number;
|
|
138
|
+
MDA: number;
|
|
139
|
+
MNG: number;
|
|
140
|
+
MNE: number;
|
|
141
|
+
MSR: number;
|
|
142
|
+
MAR: number;
|
|
143
|
+
MOZ: number;
|
|
144
|
+
MMR: number;
|
|
145
|
+
NAM: number;
|
|
146
|
+
NRU: number;
|
|
147
|
+
NPL: number;
|
|
148
|
+
NLD: number;
|
|
149
|
+
NCL: number;
|
|
150
|
+
NZL: number;
|
|
151
|
+
NIC: number;
|
|
152
|
+
NER: number;
|
|
153
|
+
NGA: number;
|
|
154
|
+
"NORTH AMERICA": number;
|
|
155
|
+
PRK: number;
|
|
156
|
+
MKD: number;
|
|
157
|
+
NOR: number;
|
|
158
|
+
OCEANIA: number;
|
|
159
|
+
OECD: number;
|
|
160
|
+
OMN: number;
|
|
161
|
+
PAK: number;
|
|
162
|
+
PSE: number;
|
|
163
|
+
PAN: number;
|
|
164
|
+
PNG: number;
|
|
165
|
+
PRY: number;
|
|
166
|
+
PER: number;
|
|
167
|
+
POL: number;
|
|
168
|
+
PRT: number;
|
|
169
|
+
PRI: number;
|
|
170
|
+
QAT: number;
|
|
171
|
+
REU: number;
|
|
172
|
+
ROU: number;
|
|
173
|
+
RUS: number;
|
|
174
|
+
RWA: number;
|
|
175
|
+
KNA: number;
|
|
176
|
+
LCA: number;
|
|
177
|
+
SPM: number;
|
|
178
|
+
VCT: number;
|
|
179
|
+
WSM: number;
|
|
180
|
+
STP: number;
|
|
181
|
+
SAU: number;
|
|
182
|
+
SEN: number;
|
|
183
|
+
SRB: number;
|
|
184
|
+
SYC: number;
|
|
185
|
+
SLE: number;
|
|
186
|
+
SGP: number;
|
|
187
|
+
SVK: number;
|
|
188
|
+
SVN: number;
|
|
189
|
+
SLB: number;
|
|
190
|
+
SOM: number;
|
|
191
|
+
ZAF: number;
|
|
192
|
+
KOR: number;
|
|
193
|
+
SSD: number;
|
|
194
|
+
ESP: number;
|
|
195
|
+
LKA: number;
|
|
196
|
+
SDN: number;
|
|
197
|
+
SUR: number;
|
|
198
|
+
SWE: number;
|
|
199
|
+
CHE: number;
|
|
200
|
+
SYR: number;
|
|
201
|
+
TWN: number;
|
|
202
|
+
TJK: number;
|
|
203
|
+
TZA: number;
|
|
204
|
+
THA: number;
|
|
205
|
+
PHL: number;
|
|
206
|
+
TGO: number;
|
|
207
|
+
TON: number;
|
|
208
|
+
TTO: number;
|
|
209
|
+
TUN: number;
|
|
210
|
+
TUR: number;
|
|
211
|
+
TKM: number;
|
|
212
|
+
TCA: number;
|
|
213
|
+
UGA: number;
|
|
214
|
+
UKR: number;
|
|
215
|
+
ARE: number;
|
|
216
|
+
GBR: number;
|
|
217
|
+
USA: number;
|
|
218
|
+
URY: number;
|
|
219
|
+
UZB: number;
|
|
220
|
+
VUT: number;
|
|
221
|
+
VEN: number;
|
|
222
|
+
VNM: number;
|
|
223
|
+
VGB: number;
|
|
224
|
+
VIR: number;
|
|
225
|
+
WORLD: number;
|
|
226
|
+
YEM: number;
|
|
227
|
+
ZMB: number;
|
|
228
|
+
ZWE: number;
|
|
229
|
+
};
|
|
230
|
+
export const type: "average";
|
|
231
|
+
//# sourceMappingURL=average-intensities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"average-intensities.d.ts","sourceRoot":"","sources":["../../../data/output/average-intensities.js"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+NE;AACF,6BAAuB"}
|