@hestia-earth/schema-convert 25.1.0 → 26.1.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/default-values.d.ts +1 -1
- package/default-values.js +4 -1
- package/package.json +1 -1
package/default-values.d.ts
CHANGED
|
@@ -9,10 +9,10 @@ export declare const impactAssessmentDefaultName: ({ product, country, region, e
|
|
|
9
9
|
export declare const extendImpactAssessment: (nodes: HestiaJson<SchemaType>[], impactAssessment: ImpactAssessment) => {
|
|
10
10
|
name: string;
|
|
11
11
|
source: import("@hestia-earth/schema").Source;
|
|
12
|
+
product: Product;
|
|
12
13
|
version?: string;
|
|
13
14
|
versionDetails?: string;
|
|
14
15
|
cycle?: Cycle;
|
|
15
|
-
product?: Product;
|
|
16
16
|
functionalUnitQuantity?: number;
|
|
17
17
|
allocationMethod?: import("@hestia-earth/schema").ImpactAssessmentAllocationMethod;
|
|
18
18
|
endDate?: string;
|
package/default-values.js
CHANGED
|
@@ -80,7 +80,10 @@ var impactAssessmentDefaultName = function (_a) {
|
|
|
80
80
|
exports.impactAssessmentDefaultName = impactAssessmentDefaultName;
|
|
81
81
|
var extendImpactAssessment = function (nodes, impactAssessment) {
|
|
82
82
|
var _a;
|
|
83
|
-
|
|
83
|
+
var cycle = findLinkedNode(nodes, schema_1.SchemaType.Cycle, impactAssessment.cycle);
|
|
84
|
+
// replace the product if there is a single match in the Cycle products
|
|
85
|
+
var products = (_a = cycle === null || cycle === void 0 ? void 0 : cycle.products) === null || _a === void 0 ? void 0 : _a.filter(function (v) { var _a, _b, _c; return ((_a = v.term) === null || _a === void 0 ? void 0 : _a['@id']) === ((_c = (_b = impactAssessment === null || impactAssessment === void 0 ? void 0 : impactAssessment.product) === null || _b === void 0 ? void 0 : _b.term) === null || _c === void 0 ? void 0 : _c['@id']); });
|
|
86
|
+
return __assign(__assign({}, impactAssessment), { name: impactAssessment.name || (0, exports.impactAssessmentDefaultName)(impactAssessment), source: impactAssessment.source || (cycle === null || cycle === void 0 ? void 0 : cycle.defaultSource), product: (products === null || products === void 0 ? void 0 : products.length) === 1 ? products[0] : impactAssessment.product });
|
|
84
87
|
};
|
|
85
88
|
exports.extendImpactAssessment = extendImpactAssessment;
|
|
86
89
|
var siteDefaultName = function (_a, organisation) {
|