« get me outta code hell

data: earlyExit -> exit in misc. utility names - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-07 10:10:44 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-07 10:10:44 -0300
commit3437936e6127192d30a308b68731cd4aa33555e7 (patch)
tree37fd15d4cbb4653342c33b190496a8cbe311a6c1 /src
parentc86de8a2be3867c14ca92c8e6799fd9b325305ec (diff)
data: earlyExit -> exit in misc. utility names
Diffstat (limited to 'src')
-rw-r--r--src/data/things/composite.js20
-rw-r--r--src/data/things/thing.js9
-rw-r--r--src/data/things/track.js8
3 files changed, 18 insertions, 19 deletions
diff --git a/src/data/things/composite.js b/src/data/things/composite.js
index 7cba1e97..84a98290 100644
--- a/src/data/things/composite.js
+++ b/src/data/things/composite.js
@@ -1004,13 +1004,13 @@ export function exposeUpdateValueOrContinue({
 }
 
 // Early exits if an availability check has failed.
-// This is for internal use only - use `earlyExitWithoutDependency` or
-// `earlyExitWIthoutUpdateValue` instead.
-export function earlyExitIfAvailabilityCheckFailed({
+// This is for internal use only - use `exitWithoutDependency` or
+// `exitWithoutUpdateValue` instead.
+export function exitIfAvailabilityCheckFailed({
   availability = '#availability',
   value = null,
 } = {}) {
-  return compositeFrom(`earlyExitIfAvailabilityCheckFailed`, [
+  return compositeFrom(`exitIfAvailabilityCheckFailed`, [
     {
       mapDependencies: {availability},
       compute: ({availability}, continuation) =>
@@ -1029,25 +1029,25 @@ export function earlyExitIfAvailabilityCheckFailed({
 
 // Early exits if a dependency isn't available.
 // See withResultOfAvailabilityCheck for {mode} options!
-export function earlyExitWithoutDependency(dependency, {
+export function exitWithoutDependency(dependency, {
   mode = 'null',
   value = null,
 } = {}) {
-  return compositeFrom(`earlyExitWithoutDependency`, [
+  return compositeFrom(`exitWithoutDependency`, [
     withResultOfAvailabilityCheck({fromDependency: dependency, mode}),
-    earlyExitIfAvailabilityCheckFailed({value}),
+    exitIfAvailabilityCheckFailed({value}),
   ]);
 }
 
 // Early exits if this property's update value isn't available.
 // See withResultOfAvailabilityCheck for {mode} options!
-export function earlyExitWithoutUpdateValue({
+export function exitWithoutUpdateValue({
   mode = 'null',
   value = null,
 } = {}) {
-  return compositeFrom(`earlyExitWithoutDependency`, [
+  return compositeFrom(`exitWithoutUpdateValue`, [
     withResultOfAvailabilityCheck({fromUpdateValue: true, mode}),
-    earlyExitIfAvailabilityCheckFailed({value}),
+    exitIfAvailabilityCheckFailed({value}),
   ]);
 }
 
diff --git a/src/data/things/thing.js b/src/data/things/thing.js
index 1077a652..5d407153 100644
--- a/src/data/things/thing.js
+++ b/src/data/things/thing.js
@@ -10,7 +10,7 @@ import {filterMultipleArrays, getKebabCase} from '#wiki-data';
 
 import {
   from as compositeFrom,
-  earlyExitWithoutDependency,
+  exitWithoutDependency,
   exposeDependency,
   raiseWithoutDependency,
 } from '#composite';
@@ -389,7 +389,7 @@ export function withResolvedReference({
 }) {
   return compositeFrom(`withResolvedReference`, [
     raiseWithoutDependency(ref, {map: {to}, raise: {to: null}}),
-    earlyExitWithoutDependency(data),
+    exitWithoutDependency(data),
 
     {
       options: {findFunction, earlyExitIfNotFound},
@@ -426,8 +426,7 @@ export function withResolvedReferenceList({
   }
 
   return compositeFrom(`withResolvedReferenceList`, [
-    earlyExitWithoutDependency(data, {value: []}),
-
+    exitWithoutDependency(data, {value: []}),
     raiseWithoutDependency(list, {
       map: {to},
       raise: {to: []},
@@ -471,7 +470,7 @@ export function withReverseReferenceList({
   to = '#reverseReferenceList',
 }) {
   return compositeFrom(`Thing.common.reverseReferenceList`, [
-    earlyExitWithoutDependency(data, {value: []}),
+    exitWithoutDependency(data, {value: []}),
 
     {
       dependencies: ['this'],
diff --git a/src/data/things/track.js b/src/data/things/track.js
index 0d7803bd..a7f96e42 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -6,7 +6,7 @@ import {empty} from '#sugar';
 
 import {
   from as compositeFrom,
-  earlyExitWithoutDependency,
+  exitWithoutDependency,
   exposeConstant,
   exposeDependency,
   exposeDependencyOrContinue,
@@ -93,7 +93,7 @@ export class Track extends Thing {
       // No cover art file extension if the track doesn't have unique artwork
       // in the first place.
       withHasUniqueCoverArt(),
-      earlyExitWithoutDependency('#hasUniqueCoverArt', {mode: 'falsy'}),
+      exitWithoutDependency('#hasUniqueCoverArt', {mode: 'falsy'}),
 
       // Expose custom coverArtFileExtension update value first.
       exposeUpdateValueOrContinue(),
@@ -114,7 +114,7 @@ export class Track extends Thing {
     // is specified, this value is null.
     coverArtDate: compositeFrom(`Track.coverArtDate`, [
       withHasUniqueCoverArt(),
-      earlyExitWithoutDependency('#hasUniqueCoverArt', {mode: 'falsy'}),
+      exitWithoutDependency('#hasUniqueCoverArt', {mode: 'falsy'}),
 
       exposeUpdateValueOrContinue(),
 
@@ -188,7 +188,7 @@ export class Track extends Thing {
     ]),
 
     otherReleases: compositeFrom(`Track.otherReleases`, [
-      earlyExitWithoutDependency('trackData', {mode: 'empty'}),
+      exitWithoutDependency('trackData', {mode: 'empty'}),
       withOriginalRelease({selfIfOriginal: true}),
 
       {