entodicton 9.7.1-beta.2 → 9.7.1-beta.4

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
@@ -1,7 +1,7 @@
1
1
  const { Semantics, Semantic } = require('./src/semantics')
2
2
  const { Generators, Generator } = require('./src/generators')
3
3
  const { Config } = require('./src/config')
4
- const { w, where } = require('./src/helpers')
4
+ const { w, where, OverrideCheck } = require('./src/helpers')
5
5
  const Digraph = require('./src/digraph')
6
6
  const client = require('./client')
7
7
  const flattens = require('./src/flatten')
@@ -28,5 +28,6 @@ module.exports = {
28
28
  flattens: flattens.flattens,
29
29
  flatten: flattens.flatten,
30
30
  unflatten: unflatten.unflatten,
31
- debug
31
+ debug,
32
+ OverrideCheck,
32
33
  }
package/package.json CHANGED
@@ -73,6 +73,6 @@
73
73
  "scriptjs": "^2.5.9",
74
74
  "uuid": "^8.3.2"
75
75
  },
76
- "version": "9.7.1-beta.2",
76
+ "version": "9.7.1-beta.4",
77
77
  "license": "UNLICENSED"
78
78
  }
package/src/config.js CHANGED
@@ -454,7 +454,7 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
454
454
  // match: async (args) => bridge.id === args.context.marker && args.context.level === level && !args.context.paraphrase && (args.context.response || args.context.isResponse) && await match(args),
455
455
  match: async (args) => {
456
456
  if (bridge.callId == args.callId) {
457
- debugger
457
+ debugger // eslint-disable-line no-debugger
458
458
  }
459
459
  return args.isA(args.context.marker, bridge.id) && args.context.level === level && !args.context.paraphrase && (args.context.response != null || args.context.isResponse) && await match(args)
460
460
  },
@@ -2313,6 +2313,7 @@ class Config {
2313
2313
  }
2314
2314
  }
2315
2315
 
2316
+ // TODO Api or API -> pick one and do that
2316
2317
  async setMultiApi (initializer) {
2317
2318
  await this.setApi(() => multiApiImpl(initializer))
2318
2319
  }
@@ -2420,11 +2421,17 @@ class Config {
2420
2421
  if (!api.initialize) {
2421
2422
  throw new Error(`Expected the API for ${this.name} to have an initialize function.`)
2422
2423
  }
2424
+ if (api.baseAPI) {
2425
+ new helpers.OverrideCheck(api.baseAPI).check(api)
2426
+ }
2423
2427
  }
2424
2428
  } else {
2425
2429
  if (!value.initialize) {
2426
2430
  throw new Error(`Expected the API to have an initialize function for ${this.name}. If you are trying to pass in multiple API configs at once use setApiKMs to set the names of the configs that you want set.`)
2427
2431
  }
2432
+ if (value.baseAPI) {
2433
+ new helpers.OverrideCheck(value.baseAPI).check(value)
2434
+ }
2428
2435
  }
2429
2436
 
2430
2437
  if (this._api && this._api.multiApi) {
package/src/helpers.js CHANGED
@@ -10,6 +10,10 @@ class OverrideCheck {
10
10
  }
11
11
 
12
12
  check(obj) {
13
+ const overriden = obj.constructor !== obj.baseAPI
14
+ if (!overriden) {
15
+ return
16
+ }
13
17
  for (const check of this.checks) {
14
18
  if (obj[check] == this.base.prototype[check]) {
15
19
  throw new Error(`For ${obj.constructor.name} you need to override ${check}`)