@baron1996/kline-scene-schema 0.4.3 → 0.6.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/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-validator.d.ts","sourceRoot":"","sources":["../src/semantic-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EAIV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"semantic-validator.d.ts","sourceRoot":"","sources":["../src/semantic-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EAIV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AA8iB/E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,UAAU,EAAE,CAM9E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAM3D"}
|
|
@@ -98,7 +98,13 @@ function validateIndicator(indicator, pane, index, issues) {
|
|
|
98
98
|
issues.push(issue('INVALID_REFERENCE', `${path}/yAxisId`, 'Indicator yAxisId must reference an axis in its containing Pane.'));
|
|
99
99
|
}
|
|
100
100
|
const expectedCount = INDICATOR_PARAM_COUNTS[indicator.name];
|
|
101
|
-
if (indicator.
|
|
101
|
+
if (indicator.name === 'MA') {
|
|
102
|
+
if (indicator.calcParams.length < 1 ||
|
|
103
|
+
indicator.calcParams.length > 8) {
|
|
104
|
+
issues.push(issue('SCENE_SCHEMA_INVALID', `${path}/calcParams`, 'MA requires 1 to 8 calculation parameters.'));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else if (indicator.calcParams.length !== expectedCount) {
|
|
102
108
|
issues.push(issue('SCENE_SCHEMA_INVALID', `${path}/calcParams`, `${indicator.name} requires exactly ${expectedCount} calculation parameters.`));
|
|
103
109
|
}
|
|
104
110
|
}
|