From fa45eb4c67308d2559e0f0f0dc40452470f7bfe6 Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 30 Jun 2023 22:50:29 +1000 Subject: [PATCH] tests --- gulpfile.js | 4 ++-- src/Parse.ts | 8 ++++---- src/ParseQuery.ts | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 687af221f..981e18fd2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -137,7 +137,7 @@ gulp.task('minify-weapp', function() { gulp.task('watch', function() { if (BUILD === 'browser') { - const watcher = gulp.watch('src/*.js', { ignoreInitial: false }, gulp.series('compile', 'browserify', 'minify')); + const watcher = gulp.watch('src/*.*(js|ts)', { ignoreInitial: false }, gulp.series('compile', 'browserify', 'minify')); watcher.on('add', function(path) { console.log(`File ${path} was added`); }); @@ -146,5 +146,5 @@ gulp.task('watch', function() { }); return watcher; } - return compileTask(watch('src/*.js', { ignoreInitial: false, verbose: true })); + return compileTask(watch('src/*.*(js|ts)', { ignoreInitial: false, verbose: true })); }); diff --git a/src/Parse.ts b/src/Parse.ts index ed7fbd1d3..a8ead2f7f 100644 --- a/src/Parse.ts +++ b/src/Parse.ts @@ -7,8 +7,8 @@ import * as ParseOp from './ParseOp'; import RESTController from './RESTController'; import ACL from './ParseACL'; import * as Analytics from './Analytics' -import * as AnonymousUtils from './AnonymousUtils' -import Cloud from './Cloud'; +import AnonymousUtils from './AnonymousUtils' +import * as Cloud from './Cloud'; import CLP from './ParseCLP'; import CoreManager from './CoreManager'; import Config from './ParseConfig' @@ -116,8 +116,8 @@ const Parse: Parse = { ACL: ACL, Analytics: Analytics, AnonymousUtils: AnonymousUtils, - Cloud: Cloud, - CLP: CLP, + Cloud: Cloud, + CLP: CLP, CoreManager: CoreManager, Config: Config, Error: ParseError, diff --git a/src/ParseQuery.ts b/src/ParseQuery.ts index 9e64277f3..d485bc6ab 100644 --- a/src/ParseQuery.ts +++ b/src/ParseQuery.ts @@ -1382,15 +1382,15 @@ class ParseQuery { * @param {string} modifiers The regular expression mode. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - matches(key: string, regex: RegExp, modifiers: string): ParseQuery { + matches(key: string, regex: RegExp | string, modifiers: string): ParseQuery { this._addCondition(key, '$regex', regex); if (!modifiers) { modifiers = ''; } - if (regex.ignoreCase) { + if ((regex as RegExp).ignoreCase) { modifiers += 'i'; } - if (regex.multiline) { + if ((regex as RegExp).multiline) { modifiers += 'm'; } if (modifiers.length) { @@ -1571,7 +1571,7 @@ class ParseQuery { if (typeof prefix !== 'string') { throw new Error('The value being searched for must be a string.'); } - return this.matches(key, new RegExp(this._regexStartWith(prefix)), modifiers); + return this.matches(key, this._regexStartWith(prefix), modifiers); } /** @@ -1587,7 +1587,7 @@ class ParseQuery { if (typeof suffix !== 'string') { throw new Error('The value being searched for must be a string.'); } - return this.matches(key, new RegExp(quote(suffix) + '$'), modifiers); + return this.matches(key, quote(suffix) + '$', modifiers); } /**