Skip to content

Commit

Permalink
Use class name instead of this to refer to class fields
Browse files Browse the repository at this point in the history
(This is to workaround a bug in esbuild: evanw/esbuild#885)
  • Loading branch information
aral committed Feb 25, 2021
1 parent 7510480 commit c3c1bb1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/QueryOperators.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Constants that represent supported operators in queries.
//
// Like this? Fund us!
// Like QueryOperators? Fund us!
// https://small-tech.org/fund-us
//
// Copyright ⓒ 2020-2021 Aral Balkan. Licensed under AGPLv3 or later.
Expand All @@ -18,12 +18,15 @@ export default class QueryOperators {
static STRICT_DOES_NOT_EQUAL = '!=='

static RELATIONAL_OPERATORS = {
is: this.STRICT_EQUALS,
isEqualTo: this.STRICT_EQUALS,
equals: this.STRICT_EQUALS,
// Note: do not use “this” here until this bug in esbuild is fixed
// ===== as it messes up the distribution bundle:
// https://github.com/evanw/esbuild/issues/885
is: QueryOperators.STRICT_EQUALS,
isEqualTo: QueryOperators.STRICT_EQUALS,
equals: QueryOperators.STRICT_EQUALS,

isNot: this.STRICT_DOES_NOT_EQUAL,
doesNotEqual: this.STRICT_DOES_NOT_EQUAL,
isNot: QueryOperators.STRICT_DOES_NOT_EQUAL,
doesNotEqual: QueryOperators.STRICT_DOES_NOT_EQUAL,

isGreaterThan: '>',
isGreaterThanOrEqualTo: '>=',
Expand Down

0 comments on commit c3c1bb1

Please sign in to comment.