if (criterion == null || typeof criterion !== 'object' || Array.isArray(criterion)) {
    return function () {
      return true;
    };
  }