From 2dd34ecb2505020d95c7657618912f025b7e3638 Mon Sep 17 00:00:00 2001 From: fershad <27988517+fershad@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:03:33 +0800 Subject: [PATCH 1/4] add mod.ts for jsr --- mod.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 mod.ts diff --git a/mod.ts b/mod.ts new file mode 100644 index 0000000..e258df1 --- /dev/null +++ b/mod.ts @@ -0,0 +1 @@ +export * from "./src/index.js"; From 2962ca1dd4aa9ecf7642efac185d638583fd702b Mon Sep 17 00:00:00 2001 From: fershad <27988517+fershad@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:06:52 +0800 Subject: [PATCH 2/4] create hosting module --- src/hosting.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hosting.js b/src/hosting.js index b8e3da5..4d783f2 100644 --- a/src/hosting.js +++ b/src/hosting.js @@ -2,6 +2,10 @@ import hostingAPI from "./hosting-api.js"; +/** + * @module hosting + */ + /** * Check if a domain is hosted by a green web host. * @param {string|array} domain - The domain to check, or an array of domains to be checked. @@ -17,6 +21,4 @@ function check(domain, optionsOrAgentId) { return hostingAPI.check(domain, optionsOrAgentId); } -export default { - check, -}; +export default check; From ce1ada57aee36aaa58858e6a5d349aeceeb67ae1 Mon Sep 17 00:00:00 2001 From: fershad <27988517+fershad@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:11:41 +0800 Subject: [PATCH 3/4] update version --- jsr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsr.json b/jsr.json index abfd594..7777bc2 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@greenweb/co2js", - "version": "0.16.0", + "version": "0.16.1", "exports": "./dist/esm/index.js", "exclude": [ "!dist/**" From ed2d8ab0419d66c9425c00c8ef278c08c0cb837c Mon Sep 17 00:00:00 2001 From: fershad <27988517+fershad@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:20:27 +0800 Subject: [PATCH 4/4] update average grid intensities --- data/output/average-intensities.js | 72 ++++++++++++------------- data/output/average-intensities.json | 76 +++++++++++++-------------- src/constants/test-constants.js | 10 ++-- src/data/average-intensities.min.js | 2 +- src/sustainable-web-design-v3.test.js | 2 +- 5 files changed, 81 insertions(+), 81 deletions(-) diff --git a/data/output/average-intensities.js b/data/output/average-intensities.js index 3b2b5d0..2907e01 100644 --- a/data/output/average-intensities.js +++ b/data/output/average-intensities.js @@ -1,17 +1,17 @@ const data = { AFG: 132.53, - AFRICA: 544.76, + AFRICA: 547.83, ALB: 24.29, DZA: 634.61, ASM: 611.11, AGO: 174.73, ATG: 611.11, - ARG: 354.1, + ARG: 353.96, ARM: 264.54, ABW: 561.22, - ASEAN: 571.29, - ASIA: 590.01, - AUS: 548.65, + ASEAN: 570.41, + ASIA: 591.13, + AUS: 556.3, AUT: 110.81, AZE: 671.39, BHS: 660.1, @@ -26,7 +26,7 @@ const data = { BOL: 531.69, BIH: 601.29, BWA: 847.91, - BRA: 98.31, + BRA: 96.4, BRN: 893.91, BGR: 335.33, BFA: 467.53, @@ -34,12 +34,12 @@ const data = { CPV: 558.14, KHM: 417.71, CMR: 305.42, - CAN: 171.12, + CAN: 165.15, CYM: 642.86, CAF: 0, TCD: 628.57, CHL: 291.11, - CHN: 582.2, + CHN: 583.61, COL: 259.51, COM: 642.86, COG: 700, @@ -56,15 +56,15 @@ const data = { DMA: 529.41, DOM: 580.78, ECU: 166.91, - EGY: 569.59, + EGY: 574.04, SLV: 224.76, GNQ: 591.84, ERI: 631.58, EST: 416.67, SWZ: 172.41, ETH: 24.64, - EU: 243.94, - EUROPE: 301.99, + EU: 243.93, + EUROPE: 302.29, FLK: 500, FRO: 404.76, FJI: 288.46, @@ -72,12 +72,12 @@ const data = { FRA: 56.02, GUF: 217.82, PYF: 442.86, - G20: 477.13, - G7: 341.04, + G20: 477.89, + G7: 341.44, GAB: 491.6, GMB: 666.67, GEO: 167.59, - DEU: 381.16, + DEU: 381.41, GHA: 484, GRC: 336.57, GRL: 178.57, @@ -93,24 +93,24 @@ const data = { HKG: 699.5, HUN: 204.19, ISL: 27.68, - IND: 713.44, + IND: 713.01, IDN: 682.43, - IRN: 655.13, + IRN: 641.73, IRQ: 688.81, IRL: 282.98, ISR: 582.93, ITA: 330.72, JAM: 555.56, - JPN: 485.39, + JPN: 493.59, JOR: 540.92, - KAZ: 821.39, + KAZ: 821.9, KEN: 71.2, KIR: 666.67, XKX: 894.65, KWT: 649.16, KGZ: 147.29, LAO: 265.51, - "LATIN AMERICA AND CARIBBEAN": 260.09, + "LATIN AMERICA AND CARIBBEAN": 256.03, LVA: 123.99, LBN: 599.01, LSO: 20, @@ -121,15 +121,15 @@ const data = { MAC: 448.98, MDG: 436.44, MWI: 66.67, - MYS: 605.32, + MYS: 607.88, MDV: 611.77, MLI: 408, MLT: 459.14, MTQ: 523.18, MRT: 464.71, MUS: 632.48, - MEX: 507.25, - "MIDDLE EAST": 657.52, + MEX: 492.34, + "MIDDLE EAST": 643.04, MDA: 643.46, MNG: 775.31, MNE: 418.09, @@ -146,12 +146,12 @@ const data = { NIC: 265.12, NER: 670.89, NGA: 523.25, - "NORTH AMERICA": 343.66, + "NORTH AMERICA": 342.95, PRK: 389.59, MKD: 556.19, NOR: 30.05, - OCEANIA: 489.59, - OECD: 341.19, + OCEANIA: 495.74, + OECD: 341.27, OMN: 564.55, PAK: 440.61, PSE: 516.13, @@ -165,7 +165,7 @@ const data = { QAT: 602.5, REU: 572.82, ROU: 240.58, - RUS: 441.04, + RUS: 445.02, RWA: 316.33, KNA: 636.36, LCA: 666.67, @@ -173,7 +173,7 @@ const data = { VCT: 529.41, WSM: 473.68, STP: 642.86, - SAU: 706.79, + SAU: 696.31, SEN: 511.6, SRB: 647.52, SYC: 564.52, @@ -183,8 +183,8 @@ const data = { SVN: 231.28, SLB: 700, SOM: 578.95, - ZAF: 707.69, - KOR: 430.57, + ZAF: 709.69, + KOR: 432.11, SSD: 629.03, ESP: 174.05, LKA: 509.78, @@ -193,10 +193,10 @@ const data = { SWE: 40.7, CHE: 34.68, SYR: 701.66, - TWN: 650.73, + TWN: 644.36, TJK: 116.86, TZA: 339.25, - THA: 549.61, + THA: 549.85, PHL: 610.74, TGO: 443.18, TON: 625, @@ -206,18 +206,18 @@ const data = { TKM: 1306.03, TCA: 653.85, UGA: 44.53, - UKR: 259.69, - ARE: 561.14, - GBR: 237.59, + UKR: 256.21, + ARE: 492.7, + GBR: 228.25, USA: 369.47, URY: 128.79, UZB: 1167.6, VUT: 571.43, VEN: 185.8, - VNM: 475.45, + VNM: 472.47, VGB: 647.06, VIR: 632.35, - WORLD: 481.45, + WORLD: 481.65, YEM: 566.1, ZMB: 111.97, ZWE: 297.87, diff --git a/data/output/average-intensities.json b/data/output/average-intensities.json index c050c2f..cbeabd1 100644 --- a/data/output/average-intensities.json +++ b/data/output/average-intensities.json @@ -9,7 +9,7 @@ "country_code": "", "country_or_region": "Africa", "year": 2023, - "emissions_intensity_gco2_per_kwh": 544.76 + "emissions_intensity_gco2_per_kwh": 547.83 }, "ALB": { "country_code": "ALB", @@ -45,7 +45,7 @@ "country_code": "ARG", "country_or_region": "Argentina", "year": 2023, - "emissions_intensity_gco2_per_kwh": 354.1 + "emissions_intensity_gco2_per_kwh": 353.96 }, "ARM": { "country_code": "ARM", @@ -63,19 +63,19 @@ "country_code": "", "country_or_region": "ASEAN", "year": 2023, - "emissions_intensity_gco2_per_kwh": 571.29 + "emissions_intensity_gco2_per_kwh": 570.41 }, "Asia": { "country_code": "", "country_or_region": "Asia", "year": 2023, - "emissions_intensity_gco2_per_kwh": 590.01 + "emissions_intensity_gco2_per_kwh": 591.13 }, "AUS": { "country_code": "AUS", "country_or_region": "Australia", "year": 2023, - "emissions_intensity_gco2_per_kwh": 548.65 + "emissions_intensity_gco2_per_kwh": 556.3 }, "AUT": { "country_code": "AUT", @@ -165,7 +165,7 @@ "country_code": "BRA", "country_or_region": "Brazil", "year": 2023, - "emissions_intensity_gco2_per_kwh": 98.31 + "emissions_intensity_gco2_per_kwh": 96.4 }, "BRN": { "country_code": "BRN", @@ -213,7 +213,7 @@ "country_code": "CAN", "country_or_region": "Canada", "year": 2023, - "emissions_intensity_gco2_per_kwh": 171.12 + "emissions_intensity_gco2_per_kwh": 165.15 }, "CYM": { "country_code": "CYM", @@ -243,7 +243,7 @@ "country_code": "CHN", "country_or_region": "China", "year": 2023, - "emissions_intensity_gco2_per_kwh": 582.2 + "emissions_intensity_gco2_per_kwh": 583.61 }, "COL": { "country_code": "COL", @@ -345,7 +345,7 @@ "country_code": "EGY", "country_or_region": "Egypt", "year": 2023, - "emissions_intensity_gco2_per_kwh": 569.59 + "emissions_intensity_gco2_per_kwh": 574.04 }, "SLV": { "country_code": "SLV", @@ -387,13 +387,13 @@ "country_code": "", "country_or_region": "EU", "year": 2023, - "emissions_intensity_gco2_per_kwh": 243.94 + "emissions_intensity_gco2_per_kwh": 243.93 }, "Europe": { "country_code": "", "country_or_region": "Europe", "year": 2023, - "emissions_intensity_gco2_per_kwh": 301.99 + "emissions_intensity_gco2_per_kwh": 302.29 }, "FLK": { "country_code": "FLK", @@ -441,13 +441,13 @@ "country_code": "", "country_or_region": "G20", "year": 2023, - "emissions_intensity_gco2_per_kwh": 477.13 + "emissions_intensity_gco2_per_kwh": 477.89 }, "G7": { "country_code": "", "country_or_region": "G7", "year": 2023, - "emissions_intensity_gco2_per_kwh": 341.04 + "emissions_intensity_gco2_per_kwh": 341.44 }, "GAB": { "country_code": "GAB", @@ -471,7 +471,7 @@ "country_code": "DEU", "country_or_region": "Germany", "year": 2023, - "emissions_intensity_gco2_per_kwh": 381.16 + "emissions_intensity_gco2_per_kwh": 381.41 }, "GHA": { "country_code": "GHA", @@ -567,7 +567,7 @@ "country_code": "IND", "country_or_region": "India", "year": 2023, - "emissions_intensity_gco2_per_kwh": 713.44 + "emissions_intensity_gco2_per_kwh": 713.01 }, "IDN": { "country_code": "IDN", @@ -579,7 +579,7 @@ "country_code": "IRN", "country_or_region": "Iran", "year": 2023, - "emissions_intensity_gco2_per_kwh": 655.13 + "emissions_intensity_gco2_per_kwh": 641.73 }, "IRQ": { "country_code": "IRQ", @@ -615,7 +615,7 @@ "country_code": "JPN", "country_or_region": "Japan", "year": 2023, - "emissions_intensity_gco2_per_kwh": 485.39 + "emissions_intensity_gco2_per_kwh": 493.59 }, "JOR": { "country_code": "JOR", @@ -627,7 +627,7 @@ "country_code": "KAZ", "country_or_region": "Kazakhstan", "year": 2023, - "emissions_intensity_gco2_per_kwh": 821.39 + "emissions_intensity_gco2_per_kwh": 821.9 }, "KEN": { "country_code": "KEN", @@ -669,7 +669,7 @@ "country_code": "", "country_or_region": "Latin America and Caribbean", "year": 2023, - "emissions_intensity_gco2_per_kwh": 260.09 + "emissions_intensity_gco2_per_kwh": 256.03 }, "LVA": { "country_code": "LVA", @@ -735,7 +735,7 @@ "country_code": "MYS", "country_or_region": "Malaysia", "year": 2023, - "emissions_intensity_gco2_per_kwh": 605.32 + "emissions_intensity_gco2_per_kwh": 607.88 }, "MDV": { "country_code": "MDV", @@ -777,13 +777,13 @@ "country_code": "MEX", "country_or_region": "Mexico", "year": 2023, - "emissions_intensity_gco2_per_kwh": 507.25 + "emissions_intensity_gco2_per_kwh": 492.34 }, "Middle East": { "country_code": "", "country_or_region": "Middle East", "year": 2023, - "emissions_intensity_gco2_per_kwh": 657.52 + "emissions_intensity_gco2_per_kwh": 643.04 }, "MDA": { "country_code": "MDA", @@ -885,7 +885,7 @@ "country_code": "", "country_or_region": "North America", "year": 2023, - "emissions_intensity_gco2_per_kwh": 343.66 + "emissions_intensity_gco2_per_kwh": 342.95 }, "PRK": { "country_code": "PRK", @@ -909,13 +909,13 @@ "country_code": "", "country_or_region": "Oceania", "year": 2023, - "emissions_intensity_gco2_per_kwh": 489.59 + "emissions_intensity_gco2_per_kwh": 495.74 }, "OECD": { "country_code": "", "country_or_region": "OECD", "year": 2023, - "emissions_intensity_gco2_per_kwh": 341.19 + "emissions_intensity_gco2_per_kwh": 341.27 }, "OMN": { "country_code": "OMN", @@ -999,7 +999,7 @@ "country_code": "RUS", "country_or_region": "Russia", "year": 2023, - "emissions_intensity_gco2_per_kwh": 441.04 + "emissions_intensity_gco2_per_kwh": 445.02 }, "RWA": { "country_code": "RWA", @@ -1046,8 +1046,8 @@ "SAU": { "country_code": "SAU", "country_or_region": "Saudi Arabia", - "year": 2022, - "emissions_intensity_gco2_per_kwh": 706.79 + "year": 2023, + "emissions_intensity_gco2_per_kwh": 696.31 }, "SEN": { "country_code": "SEN", @@ -1107,13 +1107,13 @@ "country_code": "ZAF", "country_or_region": "South Africa", "year": 2023, - "emissions_intensity_gco2_per_kwh": 707.69 + "emissions_intensity_gco2_per_kwh": 709.69 }, "KOR": { "country_code": "KOR", "country_or_region": "South Korea", "year": 2023, - "emissions_intensity_gco2_per_kwh": 430.57 + "emissions_intensity_gco2_per_kwh": 432.11 }, "SSD": { "country_code": "SSD", @@ -1167,7 +1167,7 @@ "country_code": "TWN", "country_or_region": "Taiwan", "year": 2023, - "emissions_intensity_gco2_per_kwh": 650.73 + "emissions_intensity_gco2_per_kwh": 644.36 }, "TJK": { "country_code": "TJK", @@ -1185,7 +1185,7 @@ "country_code": "THA", "country_or_region": "Thailand", "year": 2023, - "emissions_intensity_gco2_per_kwh": 549.61 + "emissions_intensity_gco2_per_kwh": 549.85 }, "PHL": { "country_code": "PHL", @@ -1245,19 +1245,19 @@ "country_code": "UKR", "country_or_region": "Ukraine", "year": 2022, - "emissions_intensity_gco2_per_kwh": 259.69 + "emissions_intensity_gco2_per_kwh": 256.21 }, "ARE": { "country_code": "ARE", "country_or_region": "United Arab Emirates", - "year": 2022, - "emissions_intensity_gco2_per_kwh": 561.14 + "year": 2023, + "emissions_intensity_gco2_per_kwh": 492.7 }, "GBR": { "country_code": "GBR", "country_or_region": "United Kingdom", "year": 2023, - "emissions_intensity_gco2_per_kwh": 237.59 + "emissions_intensity_gco2_per_kwh": 228.25 }, "USA": { "country_code": "USA", @@ -1293,7 +1293,7 @@ "country_code": "VNM", "country_or_region": "Viet Nam", "year": 2023, - "emissions_intensity_gco2_per_kwh": 475.45 + "emissions_intensity_gco2_per_kwh": 472.47 }, "VGB": { "country_code": "VGB", @@ -1311,7 +1311,7 @@ "country_code": "", "country_or_region": "World", "year": 2023, - "emissions_intensity_gco2_per_kwh": 481.45 + "emissions_intensity_gco2_per_kwh": 481.65 }, "YEM": { "country_code": "YEM", diff --git a/src/constants/test-constants.js b/src/constants/test-constants.js index 9c12748..5e56456 100644 --- a/src/constants/test-constants.js +++ b/src/constants/test-constants.js @@ -12,7 +12,7 @@ export const ONEBYTE = { export const SWDV3 = { MILLION_GREY: 0.38998, MILLION_GREEN: 0.33756, - MILLION_PERVISIT_GREY: 0.29443, + MILLION_PERVISIT_GREY: 0.29455, MILLION_PERVISIT_GREEN: 0.25451, TGWF_GREY_VALUE: 0.27980, @@ -25,13 +25,13 @@ export const SWDV3 = { MILLION_GREEN_DATACENTERS: 0.00607, MILLION_GREY_PRODUCTION: 0.07399, - MILLION_PERVISIT_GREY_DEVICE_GRID_INTENSITY_CHANGE: 0.34827, + MILLION_PERVISIT_GREY_DEVICE_GRID_INTENSITY_CHANGE: 0.3463, MILLION_PERVISIT_GREY_DATACENTER_GRID_INTENSITY_CHANGE: 0.30996, MILLION_PERVISIT_GREY_NETWORK_GRID_INTENSITY_CHANGE: 0.30893, - MILLION_PERBYTE_GREY_DEVICE_GRID_INTENSITY_CHANGE: 0.46130, - MILLION_PERBYTE_GREY_DATACENTER_GRID_INTENSITY_CHANGE: 0.41055, - MILLION_PERBYTE_GREY_NETWORK_GRID_INTENSITY_CHANGE: 0.40918, + MILLION_PERBYTE_GREY_DEVICE_GRID_INTENSITY_CHANGE: 0.4587, + MILLION_PERBYTE_GREY_DATACENTER_GRID_INTENSITY_CHANGE: 0.40991, + MILLION_PERBYTE_GREY_NETWORK_GRID_INTENSITY_CHANGE: 0.40859, MILLION_PERVISIT_GREY_DEVICES_FIRST: 0.15188, MILLION_PERVISIT_GREY_DEVICES_SECOND: 0.00092, diff --git a/src/data/average-intensities.min.js b/src/data/average-intensities.min.js index 8528644..64dacd2 100644 --- a/src/data/average-intensities.min.js +++ b/src/data/average-intensities.min.js @@ -1 +1 @@ -const data = {"AFG":132.53,"AFRICA":544.76,"ALB":24.29,"DZA":634.61,"ASM":611.11,"AGO":174.73,"ATG":611.11,"ARG":354.1,"ARM":264.54,"ABW":561.22,"ASEAN":571.29,"ASIA":590.01,"AUS":548.65,"AUT":110.81,"AZE":671.39,"BHS":660.1,"BHR":904.62,"BGD":691.41,"BRB":605.51,"BLR":441.74,"BEL":138.11,"BLZ":225.81,"BEN":584.07,"BTN":23.33,"BOL":531.69,"BIH":601.29,"BWA":847.91,"BRA":98.31,"BRN":893.91,"BGR":335.33,"BFA":467.53,"BDI":250,"CPV":558.14,"KHM":417.71,"CMR":305.42,"CAN":171.12,"CYM":642.86,"CAF":0,"TCD":628.57,"CHL":291.11,"CHN":582.2,"COL":259.51,"COM":642.86,"COG":700,"COD":24.46,"COK":250,"CRI":53.38,"CIV":393.89,"HRV":204.96,"CUB":637.61,"CYP":534.32,"CZE":449.72,"DNK":151.65,"DJI":692.31,"DMA":529.41,"DOM":580.78,"ECU":166.91,"EGY":569.59,"SLV":224.76,"GNQ":591.84,"ERI":631.58,"EST":416.67,"SWZ":172.41,"ETH":24.64,"EU":243.94,"EUROPE":301.99,"FLK":500,"FRO":404.76,"FJI":288.46,"FIN":79.16,"FRA":56.02,"GUF":217.82,"PYF":442.86,"G20":477.13,"G7":341.04,"GAB":491.6,"GMB":666.67,"GEO":167.59,"DEU":381.16,"GHA":484,"GRC":336.57,"GRL":178.57,"GRD":640,"GLP":500,"GUM":622.86,"GTM":328.27,"GIN":236.84,"GNB":625,"GUY":640.35,"HTI":567.31,"HND":282.27,"HKG":699.5,"HUN":204.19,"ISL":27.68,"IND":713.44,"IDN":682.43,"IRN":655.13,"IRQ":688.81,"IRL":282.98,"ISR":582.93,"ITA":330.72,"JAM":555.56,"JPN":485.39,"JOR":540.92,"KAZ":821.39,"KEN":71.2,"KIR":666.67,"XKX":894.65,"KWT":649.16,"KGZ":147.29,"LAO":265.51,"LATIN AMERICA AND CARIBBEAN":260.09,"LVA":123.99,"LBN":599.01,"LSO":20,"LBR":227.85,"LBY":818.69,"LTU":160.07,"LUX":105.26,"MAC":448.98,"MDG":436.44,"MWI":66.67,"MYS":605.32,"MDV":611.77,"MLI":408,"MLT":459.14,"MTQ":523.18,"MRT":464.71,"MUS":632.48,"MEX":507.25,"MIDDLE EAST":657.52,"MDA":643.46,"MNG":775.31,"MNE":418.09,"MSR":1000,"MAR":624.45,"MOZ":135.65,"MMR":436.92,"NAM":59.26,"NRU":750,"NPL":24.44,"NLD":268.48,"NCL":660.58,"NZL":112.76,"NIC":265.12,"NER":670.89,"NGA":523.25,"NORTH AMERICA":343.66,"PRK":389.59,"MKD":556.19,"NOR":30.05,"OCEANIA":489.59,"OECD":341.19,"OMN":564.55,"PAK":440.61,"PSE":516.13,"PAN":161.68,"PNG":507.25,"PRY":24.31,"PER":266.48,"POL":661.93,"PRT":165.55,"PRI":677.96,"QAT":602.5,"REU":572.82,"ROU":240.58,"RUS":441.04,"RWA":316.33,"KNA":636.36,"LCA":666.67,"SPM":600,"VCT":529.41,"WSM":473.68,"STP":642.86,"SAU":706.79,"SEN":511.6,"SRB":647.52,"SYC":564.52,"SLE":50,"SGP":470.78,"SVK":116.77,"SVN":231.28,"SLB":700,"SOM":578.95,"ZAF":707.69,"KOR":430.57,"SSD":629.03,"ESP":174.05,"LKA":509.78,"SDN":263.16,"SUR":349.28,"SWE":40.7,"CHE":34.68,"SYR":701.66,"TWN":650.73,"TJK":116.86,"TZA":339.25,"THA":549.61,"PHL":610.74,"TGO":443.18,"TON":625,"TTO":681.53,"TUN":563.96,"TUR":464.59,"TKM":1306.03,"TCA":653.85,"UGA":44.53,"UKR":259.69,"ARE":561.14,"GBR":237.59,"USA":369.47,"URY":128.79,"UZB":1167.6,"VUT":571.43,"VEN":185.8,"VNM":475.45,"VGB":647.06,"VIR":632.35,"WORLD":481.45,"YEM":566.1,"ZMB":111.97,"ZWE":297.87}; const type = "average"; export { data, type }; export default { data, type }; \ No newline at end of file +const data = {"AFG":132.53,"AFRICA":547.83,"ALB":24.29,"DZA":634.61,"ASM":611.11,"AGO":174.73,"ATG":611.11,"ARG":353.96,"ARM":264.54,"ABW":561.22,"ASEAN":570.41,"ASIA":591.13,"AUS":556.3,"AUT":110.81,"AZE":671.39,"BHS":660.1,"BHR":904.62,"BGD":691.41,"BRB":605.51,"BLR":441.74,"BEL":138.11,"BLZ":225.81,"BEN":584.07,"BTN":23.33,"BOL":531.69,"BIH":601.29,"BWA":847.91,"BRA":96.4,"BRN":893.91,"BGR":335.33,"BFA":467.53,"BDI":250,"CPV":558.14,"KHM":417.71,"CMR":305.42,"CAN":165.15,"CYM":642.86,"CAF":0,"TCD":628.57,"CHL":291.11,"CHN":583.61,"COL":259.51,"COM":642.86,"COG":700,"COD":24.46,"COK":250,"CRI":53.38,"CIV":393.89,"HRV":204.96,"CUB":637.61,"CYP":534.32,"CZE":449.72,"DNK":151.65,"DJI":692.31,"DMA":529.41,"DOM":580.78,"ECU":166.91,"EGY":574.04,"SLV":224.76,"GNQ":591.84,"ERI":631.58,"EST":416.67,"SWZ":172.41,"ETH":24.64,"EU":243.93,"EUROPE":302.29,"FLK":500,"FRO":404.76,"FJI":288.46,"FIN":79.16,"FRA":56.02,"GUF":217.82,"PYF":442.86,"G20":477.89,"G7":341.44,"GAB":491.6,"GMB":666.67,"GEO":167.59,"DEU":381.41,"GHA":484,"GRC":336.57,"GRL":178.57,"GRD":640,"GLP":500,"GUM":622.86,"GTM":328.27,"GIN":236.84,"GNB":625,"GUY":640.35,"HTI":567.31,"HND":282.27,"HKG":699.5,"HUN":204.19,"ISL":27.68,"IND":713.01,"IDN":682.43,"IRN":641.73,"IRQ":688.81,"IRL":282.98,"ISR":582.93,"ITA":330.72,"JAM":555.56,"JPN":493.59,"JOR":540.92,"KAZ":821.9,"KEN":71.2,"KIR":666.67,"XKX":894.65,"KWT":649.16,"KGZ":147.29,"LAO":265.51,"LATIN AMERICA AND CARIBBEAN":256.03,"LVA":123.99,"LBN":599.01,"LSO":20,"LBR":227.85,"LBY":818.69,"LTU":160.07,"LUX":105.26,"MAC":448.98,"MDG":436.44,"MWI":66.67,"MYS":607.88,"MDV":611.77,"MLI":408,"MLT":459.14,"MTQ":523.18,"MRT":464.71,"MUS":632.48,"MEX":492.34,"MIDDLE EAST":643.04,"MDA":643.46,"MNG":775.31,"MNE":418.09,"MSR":1000,"MAR":624.45,"MOZ":135.65,"MMR":436.92,"NAM":59.26,"NRU":750,"NPL":24.44,"NLD":268.48,"NCL":660.58,"NZL":112.76,"NIC":265.12,"NER":670.89,"NGA":523.25,"NORTH AMERICA":342.95,"PRK":389.59,"MKD":556.19,"NOR":30.05,"OCEANIA":495.74,"OECD":341.27,"OMN":564.55,"PAK":440.61,"PSE":516.13,"PAN":161.68,"PNG":507.25,"PRY":24.31,"PER":266.48,"POL":661.93,"PRT":165.55,"PRI":677.96,"QAT":602.5,"REU":572.82,"ROU":240.58,"RUS":445.02,"RWA":316.33,"KNA":636.36,"LCA":666.67,"SPM":600,"VCT":529.41,"WSM":473.68,"STP":642.86,"SAU":696.31,"SEN":511.6,"SRB":647.52,"SYC":564.52,"SLE":50,"SGP":470.78,"SVK":116.77,"SVN":231.28,"SLB":700,"SOM":578.95,"ZAF":709.69,"KOR":432.11,"SSD":629.03,"ESP":174.05,"LKA":509.78,"SDN":263.16,"SUR":349.28,"SWE":40.7,"CHE":34.68,"SYR":701.66,"TWN":644.36,"TJK":116.86,"TZA":339.25,"THA":549.85,"PHL":610.74,"TGO":443.18,"TON":625,"TTO":681.53,"TUN":563.96,"TUR":464.59,"TKM":1306.03,"TCA":653.85,"UGA":44.53,"UKR":256.21,"ARE":492.7,"GBR":228.25,"USA":369.47,"URY":128.79,"UZB":1167.6,"VUT":571.43,"VEN":185.8,"VNM":472.47,"VGB":647.06,"VIR":632.35,"WORLD":481.65,"YEM":566.1,"ZMB":111.97,"ZWE":297.87}; const type = "average"; export { data, type }; export default { data, type }; \ No newline at end of file diff --git a/src/sustainable-web-design-v3.test.js b/src/sustainable-web-design-v3.test.js index 14c716f..2cd189a 100644 --- a/src/sustainable-web-design-v3.test.js +++ b/src/sustainable-web-design-v3.test.js @@ -99,7 +99,7 @@ describe("sustainable web design model version 3", () => { describe("emissionsPerVisitInGrams", () => { it("should calculate the correct co2 per visit", () => { const energy = swd.energyPerVisit(averageWebsiteInBytes); - expect(swd.emissionsPerVisitInGrams(energy)).toEqual(0.66); + expect(swd.emissionsPerVisitInGrams(energy)).toEqual(0.67); }); it("should accept a dynamic KwH value", () => {