@hestia-earth/glossary 0.95.1 → 0.96.1

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
@@ -43,6 +43,7 @@ __export(index_exports, {
43
43
  idToIso31662: () => idToIso31662,
44
44
  isCoverCrop: () => isCoverCrop,
45
45
  isInSystemBoundary: () => isInSystemBoundary,
46
+ isPlantation: () => isPlantation,
46
47
  iso31662ToId: () => iso31662ToId,
47
48
  iso31662ToName: () => iso31662ToName,
48
49
  loadResourceKey: () => loadResourceKey,
@@ -58,6 +59,7 @@ var import_ecoinventMapping = __toESM(require("./resources/ecoinventMapping.json
58
59
  var import_emission_groupings = __toESM(require("./resources/emission-groupings.json"), 1);
59
60
  var import_id_to_iso3166_2 = __toESM(require("./resources/id-to-iso3166-2.json"), 1);
60
61
  var import_inHestiaDefaultSystemBoundary = __toESM(require("./resources/inHestiaDefaultSystemBoundary.json"), 1);
62
+ var import_isPlantation = __toESM(require("./resources/isPlantation.json"), 1);
61
63
  var import_iso3166_2_to_id = __toESM(require("./resources/iso3166-2-to-id.json"), 1);
62
64
  var import_iso3166_2_to_name = __toESM(require("./resources/iso3166-2-to-name.json"), 1);
63
65
  var import_modelGroups = __toESM(require("./resources/modelGroups.json"), 1);
@@ -75,6 +77,7 @@ const RESOURCES = {
75
77
  "emission-groupings.json": import_emission_groupings.default,
76
78
  "id-to-iso3166-2.json": import_id_to_iso3166_2.default,
77
79
  "inHestiaDefaultSystemBoundary.json": import_inHestiaDefaultSystemBoundary.default,
80
+ "isPlantation.json": import_isPlantation.default,
78
81
  "iso3166-2-to-id.json": import_iso3166_2_to_id.default,
79
82
  "iso3166-2-to-name.json": import_iso3166_2_to_name.default,
80
83
  "modelGroups.json": import_modelGroups.default,
@@ -100,6 +103,8 @@ const isInSystemBoundary = (id) => {
100
103
  const value = import_inHestiaDefaultSystemBoundary.default[id];
101
104
  return !value || value === "true";
102
105
  };
106
+ const plantations = new Set(import_isPlantation.default);
107
+ const isPlantation = (id) => plantations.has(id);
103
108
  const getEcoalimMapping = (id) => import_ecoalimMapping.default[id];
104
109
  const getEcoinventMapping = (id) => import_ecoinventMapping.default[id];
105
110
  const getWorldSteelMapping = (id) => import_worldsteelMapping.default[id];
@@ -127,6 +132,7 @@ const termOrder = ({ "@id": id, termType }) => termType ? id ? import_term_order
127
132
  idToIso31662,
128
133
  isCoverCrop,
129
134
  isInSystemBoundary,
135
+ isPlantation,
130
136
  iso31662ToId,
131
137
  iso31662ToName,
132
138
  loadResourceKey,
package/index.mjs CHANGED
@@ -22,6 +22,7 @@ import ecoinventMapping from "./resources/ecoinventMapping.json" with { type: "j
22
22
  import emissionGroupings from "./resources/emission-groupings.json" with { type: "json" };
23
23
  import idToIso31662Map from "./resources/id-to-iso3166-2.json" with { type: "json" };
24
24
  import inHestiaDefaultSystemBoundary from "./resources/inHestiaDefaultSystemBoundary.json" with { type: "json" };
25
+ import plantationIds from "./resources/isPlantation.json" with { type: "json" };
25
26
  import iso31662ToIdMap from "./resources/iso3166-2-to-id.json" with { type: "json" };
26
27
  import iso31662ToNameMap from "./resources/iso3166-2-to-name.json" with { type: "json" };
27
28
  import modelGroups from "./resources/modelGroups.json" with { type: "json" };
@@ -43,6 +44,7 @@ const RESOURCES = {
43
44
  "emission-groupings.json": emissionGroupings,
44
45
  "id-to-iso3166-2.json": idToIso31662Map,
45
46
  "inHestiaDefaultSystemBoundary.json": inHestiaDefaultSystemBoundary,
47
+ "isPlantation.json": plantationIds,
46
48
  "iso3166-2-to-id.json": iso31662ToIdMap,
47
49
  "iso3166-2-to-name.json": iso31662ToNameMap,
48
50
  "modelGroups.json": modelGroups,
@@ -155,6 +157,18 @@ export const isInSystemBoundary = (id) => {
155
157
  return !value || value === "true";
156
158
  };
157
159
 
160
+ // built once, so repeated checks do not scan the list
161
+ const plantations = new Set(plantationIds);
162
+
163
+ /**
164
+ * Checks whether the crop is grown as a plantation - a permanent crop that produces over several
165
+ * years, rather than one planted and harvested within a Cycle.
166
+ *
167
+ * @param {string} id The HESTIA term [id](https://hestia.earth/schema/Term#id).
168
+ * @returns {boolean} True if the Term is a plantation crop.
169
+ */
170
+ export const isPlantation = (id) => plantations.has(id);
171
+
158
172
  export const getEcoalimMapping = (id) => ecoalimMapping[id];
159
173
 
160
174
  export const getEcoinventMapping = (id) => ecoinventMapping[id];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/glossary",
3
- "version": "0.95.1",
3
+ "version": "0.96.1",
4
4
  "description": "HESTIA Earth Glossary library",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -0,0 +1 @@
1
+ ["abacaFibre","abacaLeafStalk","acaciaWood","achioteAril","achioteSeed","acornHusk","acornInHusk","acornInShell","acornKernel","acornShell","africanLocustBeanPod","africanLocustBeanPodHusk","africanLocustBeanPodPulp","africanLocustBeanSeed","agatiHay","agatiPod","allspiceFruit","almondFruit","almondHull","almondInShell","almondKernel","almondShell","almondWood","appleFruit","apricotFruit","arazaFruit","arecaSeed","asparagusShoot","assaiPalmFrond","assaiPalmFruit","assaiPalmHeart","assaiPalmWood","avocadoFruit","avocadoWood","azaroleFruit","babulPod","babulPodHusk","babulYoungPod","bambooCulm","bambooFibre","bambooLeaf","bambooShoot","bananaFruit","bananaFruitPlantain","bananaLeaf","bananaPeel","bananaRoot","bananaStalk","bayLeaf","bergamotFruit","bilberryFruit","bitterOrangeFruit","blackWattleSap","blackberryFruit","blueberryFruit","brazilNutFruit","brazilNutInShell","brazilNutKernel","brazilNutShell","breadfruitFruit","caperFlowerBud","caperFruit","carambolaFruit","carobGum","carobPod","carobPulp","carobSeed","cashewApple","cashewFruit","cashewGum","cashewHull","cashewInShell","cashewKernel","cashewShell","cashewWood","chayoteFruit","cherimoyaFruit","chestnutHusk","chestnutInHusk","chestnutInShell","chestnutKernel","chestnutShell","cinnamonBark","citronFruit","citrusFruit","citrusPellet","citrusPulpDry","citrusPulpFresh","citrusWood","clementineFruit","cloveFlowerBud","cocoaFruit","cocoaHull","cocoaPodHusk","cocoaSeedDehulled","cocoaSeedWhole","coconutFruit","coconutFruitInHusk","coconutLeaf","coconutMidrib","coconutSap","coconutYoungFruit","coffeeFruit","coffeeHull","coffeeLeaf","coffeePulp","coffeeSeedDehulled","coffeeSeedWhole","colaSeed","cranberryFruit","crossandraCutFlower","currantFruit","curryLeaf","custardAppleFruit","dateFruit","devilSCottonBark","devilSCottonFibre","dewberryFruit","durianFruit","elderFlower","elderFruit","eucalyptusLeaf","eucalyptusWood","feijoaFruit","figFruit","fruitCropFruit","genericTreeLeaf","genericTreeWood","giantReedHay","gojiBerryFruit","gooseberryFruit","grapefruitFruit","grapesFruit","grapesLeaf","grapesPomace","grapesWood","guavaFruit","gumArabicGum","hazelnutHusk","hazelnutInHusk","hazelnutInShell","hazelnutKernel","hazelnutShell","heliconiaCutFlower","henequenFibre","henequenLeaf","hennaLeaf","honeyberryFruit","hopCone","hopShoot","jackfruitFruit","jackfruitSeed","jambolanFruit","jasmineFlower","jatrophaSeedWhole","jojobaSeed","jujubeFruit","juniperCone","kapokFibre","kapokPod","khatLeaf","kiwifruitFruit","kumquatFruit","lebbekHay","lebbekPod","lemonFruit","limeFruit","limeLeaf","limequatFruit","lindenFlower","litchiFruit","loganberryFruit","longanFruit","longkongFruit","loquatFruit","loquatWood","macadamiaInShell","macadamiaKernel","macadamiaShell","mandarinFruit","mangoFruit","mangosteenFruit","medlarFruit","mesquiteHull","mesquiteLeaf","mesquitePod","mesquitePodHusk","mesquiteSeedDehulled","mesquiteSeedWhole","mesquiteYoungPod","moringaLeaf","moringaSeed","moringaYoungPod","mulberryFruit","nutmegAril","nutmegSeed","oilPalmFrond","oilPalmFruit","oilPalmWood","oliveFruit","oliveSeed","oliveWood","orangeFruit","palmFibre","palmHeart","palmyraFrond","palmyraFruit","palmyraSap","papayaFruit","passionfruitFruit","peachFruit","peachPalmFruit","pearFruit","pecanFruit","pecanHull","pecanInShell","pecanKernel","pecanShell","pepperFruit","pepperSeed","persimmonFruit","physalisFruit","pineSeed","pineappleFruit","pistachioFruit","pistachioHull","pistachioInShell","pistachioKernel","pistachioShell","pitayaFruit","plumFruit","pomegranateFruit","pomeloFruit","pricklyPearFruit","quinceFruit","quinineBark","rainTreePod","rainTreeSeed","rambutanFruit","raspberryFruit","riverTamarindPod","riverTamarindSeed","roseCutFlower","roseFlower","roseHip","rosePetal","rubberLatex","sagoPalmPith","sagoPalmStarch","sapodillaFruit","sassafrasLeaf","satsumaFruit","sesbanHay","sesbanPod","sesbanSeed","sheanutFruit","sheanutInShell","sheanutKernel","sheanutLeaf","sheanutShell","sichuanPepperFruit","silkOakWood","sisalFibre","sisalLeaf","sourCherryFruit","soursopFruit","starAniseFruit","starAppleFruit","sugarcaneSilage","sugarcaneStalk","sugarcaneTop","sweetCherryFruit","sweetGranadillaFruit","sweetSorghumGrain","sweetSorghumStalk","tallowSeed","tamarilloFruit","tamarindLeaf","tamarindPod","tamarindPodHusk","tamarindSeed","tamarindWood","tangeloFruit","tangerineFruit","teaLeaf","teaOilCamelliaSeed","treeNutInShell","treeNutKernel","treeNutWood","tungSeed","ubaCaneLeaf","ubaCaneStalk","ugliFruit","umbrellaThornHay","umbrellaThornPod","umbrellaThornSeed","umbrellaThornYoungPod","vanillaPod","vanillaSeed","walnutFruit","walnutHull","walnutInShell","walnutKernel","walnutShell","whiteMulberryFruit","whiteMulberryLeafMeal","winterThornHay","winterThornPod","winterThornSeed","yerbaMateLeaf"]