semanticdb-core 1.0.39 → 1.0.40

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.
@@ -146,6 +146,7 @@ const isDimensionInLogicform = (logicform, dimension, strictMode = true) => {
146
146
  }
147
147
  }
148
148
  }
149
+ // dailyavg', '$monthlyavg', '$yearlyavg', '$weeklyavg, to be deprecated
149
150
  {
150
151
  const avgPreds = logicform.preds
151
152
  .filter((pred) => pred.operator &&
@@ -170,6 +171,18 @@ const isDimensionInLogicform = (logicform, dimension, strictMode = true) => {
170
171
  return tws.indexOf(minTWGranInLogicform) >= tws.indexOf(dimension.level);
171
172
  }
172
173
  }
174
+ // by timewindow:这个可能是未来唯一的表达方式
175
+ {
176
+ const twPreds = logicform.preds.filter((pred) => pred.by && typeof pred.by === 'string' && pred.by.startsWith('$'));
177
+ if (twPreds.length > 0) {
178
+ const minTWGranInLogicform = underscore_1.default.min(twPreds, (i) => tws.indexOf(i.by.slice(1)));
179
+ // 如果粒度没到,那么就返回false
180
+ if (minTWGranInLogicform && typeof minTWGranInLogicform === 'object') {
181
+ return (tws.indexOf(minTWGranInLogicform.by.slice(1)) >=
182
+ tws.indexOf(dimension.level));
183
+ }
184
+ }
185
+ }
173
186
  }
174
187
  const dimInLFIgnoreLevel = isDimensionInLogicformIgnoreLevel(logicform, dimension, strictMode);
175
188
  if (!dimInLFIgnoreLevel)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semanticdb-core",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [