src/preact/base-element.js
/**
   * Verifies that every Preact render exposes the same API surface as the previous render.
   * If it does not, the API wrapper is syncrhonized.
   *
   * @param {API_TYPE} current
   * @private
   */
Verifies that every Preact render exposes the same API surface as the previous render.
If it does not, the API wrapper is syncrhonized.

@param {API_TYPE} current
@private
Verifies that every Preact render exposes the same API surface as the previous render . If it does not the API wrapper is syncrhonized . @param { API_TYPE } current @private
checkApiWrapper_(current) {
    if (!mode.isLocalDev()) {
      return;
    }
    if (current.constructor && current.constructor.name !== 'Object') {
      return;
    }
    const api = this.apiWrapper_;
    const newKeys = Object.keys(current);
    for (let i = 0; i < newKeys.length; i++) {
      const key = newKeys[i];
      devAssert(
        hasOwn(api, key),
        'Inconsistent Bento API shape: imperative API gained a "%s" key for %s',
        key,
        this.element
      );
    }
    const oldKeys = Object.keys(api);
    for (let i = 0; i < oldKeys.length; i++) {
      const key = oldKeys[i];
      devAssert(
        hasOwn(current, key),
        'Inconsistent Bento API shape: imperative API lost a "%s" key for %s',
        key,
        this.element
      );
    }
  }
checkApiWrapper_ ( current ) { if ( ! mode . isLocalDev ( ) ) { return ; } if ( current . constructor && current . constructor . name !== 'Object' ) { return ; } const api = this . apiWrapper_ ; const newKeys = Object . keys ( current ) ; for ( let i = 0 ; i < newKeys . length ; i ++ ) { const key = newKeys [ i ] ; devAssert ( hasOwn ( api , key ) , 'Inconsistent Bento API shape: imperative API gained a "%s" key for %s' , key , this . element ) ; } const oldKeys = Object . keys ( api ) ; for ( let i = 0 ; i < oldKeys . length ; i ++ ) { const key = oldKeys [ i ] ; devAssert ( hasOwn ( current , key ) , 'Inconsistent Bento API shape: imperative API lost a "%s" key for %s' , key , this . element ) ; } }
Verifies that every Preact render exposes the same API surface as the previous render.
Verifies that every Preact render exposes the same API surface as the previous render .
// Hack around https://github.com/preactjs/preact/issues/3084