@hestia-earth/glossary 0.89.0 → 0.91.0

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/index.js CHANGED
@@ -111,11 +111,19 @@ const getEcoinventMapping = (id) =>
111
111
  const getWorldSteelMapping = (id) =>
112
112
  loadResourceKey("worldsteelMapping.json", id);
113
113
 
114
- const getBafuMapping = (id) =>
115
- loadResourceKey("bafuMapping.json", id);
114
+ const getBafuMapping = (id) => loadResourceKey("bafuMapping.json", id);
116
115
 
117
116
  const getBlankNodesGroup = (id) => loadResourceKey("blankNodesGroup.json", id);
118
117
 
118
+ /**
119
+ * Get the groupings for the Emission.
120
+ *
121
+ * @param {string} id The HESTIA term [id](https://hestia.earth/schema/Term#id).
122
+ * @returns {object} Different groupings types and values.
123
+ */
124
+ const getEmissionGroupings = (id) =>
125
+ loadResourceKey("emission-groupings.json", id);
126
+
119
127
  /**
120
128
  * Determines if the property is identifying a cover crop.
121
129
  *
@@ -146,10 +154,10 @@ const termOrder = ({ "@id": id, termType }) => {
146
154
  ? data[termType].indexOf(id)
147
155
  : data[termType]
148
156
  : id
149
- ? Object.values(data)
150
- .find((values) => values.includes(id))
151
- ?.indexOf(id)
152
- : -1;
157
+ ? Object.values(data)
158
+ .find((values) => values.includes(id))
159
+ ?.indexOf(id)
160
+ : -1;
153
161
  };
154
162
 
155
163
  module.exports = {
@@ -169,6 +177,7 @@ module.exports = {
169
177
  getWorldSteelMapping,
170
178
  getBafuMapping,
171
179
  getBlankNodesGroup,
180
+ getEmissionGroupings,
172
181
  isCoverCrop,
173
182
  getModelGroup,
174
183
  termOrder,
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@hestia-earth/glossary",
3
- "version": "0.89.0",
3
+ "version": "0.91.0",
4
4
  "description": "HESTIA Earth Glossary library",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "gen:impact-assessment": "node scripts/node/generate-impact-assessment-data.js",
8
+ "gen:emission-grouping": "node scripts/node/generate-emission-groupings.js",
8
9
  "gen:lookups-data": "node scripts/node/generate-lookups-data.js",
9
10
  "gen:model-groups": "node scripts/node/generate-model-groups-data.js",
10
11
  "gen:term-order": "node scripts/node/generate-term-order.js",