From ef79eab44bfd000792c610b968b5ceefd41e76a0 Mon Sep 17 00:00:00 2001 From: Darius Jahandarie Date: Sat, 4 Nov 2023 18:45:57 +0900 Subject: Modernize codebase - Use ES modules - Remove vendored libs and build them from npm using esbuild - Switch from JSZip to zip.js --- ext/js/general/cache-map.js | 3 ++- ext/js/general/object-property-accessor.js | 2 +- ext/js/general/regex-util.js | 3 ++- ext/js/general/task-accumulator.js | 4 +++- ext/js/general/text-source-map.js | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) (limited to 'ext/js/general') 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 . */ + /** * 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 . */ + /** * 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 . */ -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 . */ -class TextSourceMap { +export class TextSourceMap { constructor(source, mapping=null) { this._source = source; this._mapping = (mapping !== null ? TextSourceMap.normalizeMapping(mapping) : null); -- cgit v1.2.3