summaryrefslogtreecommitdiff
path: root/ext/js/general
diff options
context:
space:
mode:
authorDarius Jahandarie <djahandarie@gmail.com>2023-11-04 18:45:57 +0900
committerDarius Jahandarie <djahandarie@gmail.com>2023-11-04 18:45:57 +0900
commitef79eab44bfd000792c610b968b5ceefd41e76a0 (patch)
tree48b04f30f6248caedbd880801aa49402a9e8066a /ext/js/general
parent376151096431d4362e4baaacf0cef4a534e169f7 (diff)
Modernize codebase
- Use ES modules - Remove vendored libs and build them from npm using esbuild - Switch from JSZip to zip.js
Diffstat (limited to 'ext/js/general')
-rw-r--r--ext/js/general/cache-map.js3
-rw-r--r--ext/js/general/object-property-accessor.js2
-rw-r--r--ext/js/general/regex-util.js3
-rw-r--r--ext/js/general/task-accumulator.js4
-rw-r--r--ext/js/general/text-source-map.js2
5 files changed, 9 insertions, 5 deletions
diff --git a/ext/js/general/cache-map.js b/ext/js/general/cache-map.js
index 817626ab..1ee385bf 100644
--- a/ext/js/general/cache-map.js
+++ b/ext/js/general/cache-map.js
@@ -16,10 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+
/**
* Class which caches a map of values, keeping the most recently accessed values.
*/
-class CacheMap {
+export class CacheMap {
/**
* Creates a new CacheMap.
* @param {number} maxSize The maximum number of entries able to be stored in the cache.
diff --git a/ext/js/general/object-property-accessor.js b/ext/js/general/object-property-accessor.js
index 12b91935..b8309ed2 100644
--- a/ext/js/general/object-property-accessor.js
+++ b/ext/js/general/object-property-accessor.js
@@ -19,7 +19,7 @@
/**
* Class used to get and mutate generic properties of an object by using path strings.
*/
-class ObjectPropertyAccessor {
+export class ObjectPropertyAccessor {
/**
* Create a new accessor for a specific object.
* @param {object} target The object which the getter and mutation methods are applied to.
diff --git a/ext/js/general/regex-util.js b/ext/js/general/regex-util.js
index 6e466864..298189d4 100644
--- a/ext/js/general/regex-util.js
+++ b/ext/js/general/regex-util.js
@@ -16,10 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+
/**
* This class provides some general utility functions for regular expressions.
*/
-class RegexUtil {
+export class RegexUtil {
/**
* Applies string.replace using a regular expression and replacement string as arguments.
* A source map of the changes is also maintained.
diff --git a/ext/js/general/task-accumulator.js b/ext/js/general/task-accumulator.js
index b1185316..cae58b94 100644
--- a/ext/js/general/task-accumulator.js
+++ b/ext/js/general/task-accumulator.js
@@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-class TaskAccumulator {
+import {log} from '../core.js';
+
+export class TaskAccumulator {
constructor(runTasks) {
this._deferPromise = null;
this._activePromise = null;
diff --git a/ext/js/general/text-source-map.js b/ext/js/general/text-source-map.js
index 473fd0d0..6a136451 100644
--- a/ext/js/general/text-source-map.js
+++ b/ext/js/general/text-source-map.js
@@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-class TextSourceMap {
+export class TextSourceMap {
constructor(source, mapping=null) {
this._source = source;
this._mapping = (mapping !== null ? TextSourceMap.normalizeMapping(mapping) : null);