Renamed the #isDebitCreditMatches and #isQueryMatches methods in the JavaScript OriginalLineItem class to #isDebitCreditMatched and #isQueryMatched, respectively.

This commit is contained in:
依瑪貓 2023-03-24 07:32:23 +08:00
parent e8e4100677
commit 8c1ecd6eac

View File

@ -340,9 +340,9 @@ class OriginalLineItem {
isMatched(debitCredit, currencyCode, query = null) { isMatched(debitCredit, currencyCode, query = null) {
return this.netBalance.greaterThan(0) return this.netBalance.greaterThan(0)
&& this.date <= this.#selector.lineItemEditor.form.date && this.date <= this.#selector.lineItemEditor.form.date
&& this.#isDebitCreditMatches(debitCredit) && this.#isDebitCreditMatched(debitCredit)
&& this.#currencyCode === currencyCode && this.#currencyCode === currencyCode
&& this.#isQueryMatches(query); && this.#isQueryMatched(query);
} }
/** /**
@ -351,7 +351,7 @@ class OriginalLineItem {
* @param debitCredit {string} either "debit" or credit * @param debitCredit {string} either "debit" or credit
* @return {boolean} true if the option matches, or false otherwise * @return {boolean} true if the option matches, or false otherwise
*/ */
#isDebitCreditMatches(debitCredit) { #isDebitCreditMatched(debitCredit) {
return (debitCredit === "debit" && this.#debitCredit === "credit") return (debitCredit === "debit" && this.#debitCredit === "credit")
|| (debitCredit === "credit" && this.#debitCredit === "debit"); || (debitCredit === "credit" && this.#debitCredit === "debit");
} }
@ -362,7 +362,7 @@ class OriginalLineItem {
* @param query {string|null} the query term * @param query {string|null} the query term
* @return {boolean} true if the option matches, or false otherwise * @return {boolean} true if the option matches, or false otherwise
*/ */
#isQueryMatches(query) { #isQueryMatched(query) {
if (query === "") { if (query === "") {
return true; return true;
} }