« get me outta code hell

sugar: move many functions into new #aggregate import - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-02-16 09:39:14 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-02-16 10:28:02 -0400
commit7a3038b982c4d318e146698527070f096591aa4f (patch)
tree02ef22e2c740dc02f073189718a315afff100fe5 /src/data
parent2b0a5231170049bc4fd7f44009c9f32b1404d5a5 (diff)
sugar: move many functions into new #aggregate import
Diffstat (limited to 'src/data')
-rw-r--r--src/data/checks.js5
-rw-r--r--src/data/composite.js17
-rw-r--r--src/data/language.js4
-rw-r--r--src/data/things/index.js2
-rw-r--r--src/data/things/language.js3
-rw-r--r--src/data/validators.js11
-rw-r--r--src/data/yaml.js9
7 files changed, 17 insertions, 34 deletions
diff --git a/src/data/checks.js b/src/data/checks.js
index 25e94aa..ad86087 100644
--- a/src/data/checks.js
+++ b/src/data/checks.js
@@ -4,19 +4,18 @@ import {inspect as nodeInspect} from 'node:util';
 import {colors, ENABLE_COLOR} from '#cli';
 
 import CacheableObject from '#cacheable-object';
+import {compareArrays, empty} from '#sugar';
 import Thing from '#thing';
 import thingConstructors from '#things';
 import {commentaryRegexCaseSensitive} from '#wiki-data';
 
 import {
-  compareArrays,
   conditionallySuppressError,
   decorateErrorWithIndex,
-  empty,
   filterAggregate,
   openAggregate,
   withAggregate,
-} from '#sugar';
+} from '#aggregate';
 
 function inspect(value, opts = {}) {
   return nodeInspect(value, {colors: ENABLE_COLOR, ...opts});
diff --git a/src/data/composite.js b/src/data/composite.js
index 4f89d88..7a98c42 100644
--- a/src/data/composite.js
+++ b/src/data/composite.js
@@ -1,19 +1,12 @@
 import {inspect} from 'node:util';
 
+import {decorateErrorWithIndex, openAggregate, withAggregate}
+  from '#aggregate';
 import {colors} from '#cli';
-import {TupleMap} from '#wiki-data';
+import {empty, filterProperties, stitchArrays, typeAppearance, unique}
+  from '#sugar';
 import {a} from '#validators';
-
-import {
-  decorateErrorWithIndex,
-  empty,
-  filterProperties,
-  openAggregate,
-  stitchArrays,
-  typeAppearance,
-  unique,
-  withAggregate,
-} from '#sugar';
+import {TupleMap} from '#wiki-data';
 
 const globalCompositeCache = {};
 
diff --git a/src/data/language.js b/src/data/language.js
index 6f774f2..96d39d8 100644
--- a/src/data/language.js
+++ b/src/data/language.js
@@ -7,10 +7,10 @@ import chokidar from 'chokidar';
 import he from 'he'; // It stands for "HTML Entities", apparently. Cursed.
 import yaml from 'js-yaml';
 
+import {annotateError, annotateErrorWithFile, showAggregate, withAggregate}
+  from '#aggregate';
 import {externalLinkSpec} from '#external-links';
 import {colors, logWarn} from '#cli';
-import {annotateError, annotateErrorWithFile, showAggregate, withAggregate}
-  from '#sugar';
 import T from '#things';
 
 const {Language} = T;
diff --git a/src/data/things/index.js b/src/data/things/index.js
index 9a36eaa..3bf8409 100644
--- a/src/data/things/index.js
+++ b/src/data/things/index.js
@@ -1,10 +1,10 @@
 import * as path from 'node:path';
 import {fileURLToPath} from 'node:url';
 
+import {openAggregate, showAggregate} from '#aggregate';
 import {logError} from '#cli';
 import {compositeFrom} from '#composite';
 import * as serialize from '#serialize';
-import {openAggregate, showAggregate} from '#sugar';
 
 import Thing from '#thing';
 
diff --git a/src/data/things/language.js b/src/data/things/language.js
index 6bd5a78..93ed40b 100644
--- a/src/data/things/language.js
+++ b/src/data/things/language.js
@@ -1,8 +1,9 @@
 import { Temporal, toTemporalInstant } from '@js-temporal/polyfill';
 
+import {withAggregate} from '#aggregate';
 import CacheableObject from '#cacheable-object';
 import * as html from '#html';
-import {empty, withAggregate} from '#sugar';
+import {empty} from '#sugar';
 import {isLanguageCode} from '#validators';
 import Thing from '#thing';
 
diff --git a/src/data/validators.js b/src/data/validators.js
index 7eabe72..4fc2ac6 100644
--- a/src/data/validators.js
+++ b/src/data/validators.js
@@ -1,18 +1,11 @@
 import {inspect as nodeInspect} from 'node:util';
 
+import {openAggregate, withAggregate} from '#aggregate';
 import {colors, ENABLE_COLOR} from '#cli';
+import {cut, empty, matchMultiline, typeAppearance} from '#sugar';
 import {commentaryRegexCaseInsensitive, commentaryRegexCaseSensitiveOneShot}
   from '#wiki-data';
 
-import {
-  cut,
-  empty,
-  matchMultiline,
-  openAggregate,
-  typeAppearance,
-  withAggregate,
-} from '#sugar';
-
 function inspect(value) {
   return nodeInspect(value, {colors: ENABLE_COLOR});
 }
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 7a0643e..100e07b 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -10,23 +10,20 @@ import yaml from 'js-yaml';
 import {colors, ENABLE_COLOR, logInfo, logWarn} from '#cli';
 import {reportDuplicateDirectories, filterReferenceErrors}
   from '#data-checks';
+import {atOffset, empty, filterProperties, typeAppearance, withEntries}
+  from '#sugar';
 import Thing from '#thing';
 import thingConstructors from '#things';
 import {sortByName} from '#wiki-data';
 
 import {
   annotateErrorWithFile,
-  atOffset,
   decorateErrorWithIndex,
   decorateErrorWithAnnotation,
-  empty,
-  filterProperties,
   openAggregate,
   showAggregate,
-  typeAppearance,
   withAggregate,
-  withEntries,
-} from '#sugar';
+} from '#aggregate';
 
 function inspect(value, opts = {}) {
   return nodeInspect(value, {colors: ENABLE_COLOR, ...opts});