Skip to content

Commit 02db18e

Browse files
committed
Update javascript-interface-library.ts
1 parent e7bb9fa commit 02db18e

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

src/javascript-interface-library.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,19 @@
102102
return TargetObject
103103
}
104104

105-
/**** throwableError - simplifies construction of named errors ****/
105+
/**** throwError - simplifies construction of named errors ****/
106106

107-
export function throwableError (Message:string):Error {
107+
export function throwError (Message:string):never {
108108
let Match = /^([$a-zA-Z][$a-zA-Z0-9]*):\s*(\S.+)\s*$/.exec(Message)
109109
if (Match == null) {
110-
return new Error(Message)
110+
throw new Error(Message)
111111
} else {
112112
let namedError = new Error(Match[2])
113113
namedError.name = Match[1]
114-
return namedError
114+
throw namedError
115115
}
116116
}
117117

118-
/**** throwError - throws a named error ****/
119-
120-
export function throwError (Message:string):never {
121-
throw throwableError(Message)
122-
}
123-
124118
//------------------------------------------------------------------------------
125119
//-- Value Classification Functions --
126120
//------------------------------------------------------------------------------
@@ -1191,31 +1185,31 @@
11911185
/**** allow/expect[ed]Color ****/
11921186

11931187
export const allowColor = /*#__PURE__*/ ValidatorForClassifier(
1194-
ValueIsColor, acceptNil, 'valid CSS color specification'
1188+
ValueIsColor, acceptNil, 'CSS color specification'
11951189
), allowedColor = allowColor
11961190

11971191
export const expectColor = /*#__PURE__*/ ValidatorForClassifier(
1198-
ValueIsColor, rejectNil, 'valid CSS color specification'
1192+
ValueIsColor, rejectNil, 'CSS color specification'
11991193
), expectedColor = expectColor
12001194

12011195
/**** allow/expect[ed]EMailAddress ****/
12021196

12031197
export const allowEMailAddress = /*#__PURE__*/ ValidatorForClassifier(
1204-
ValueIsEMailAddress, acceptNil, 'valid EMail address'
1198+
ValueIsEMailAddress, acceptNil, 'EMail address'
12051199
), allowedEMailAddress = allowEMailAddress
12061200

12071201
export const expectEMailAddress = /*#__PURE__*/ ValidatorForClassifier(
1208-
ValueIsEMailAddress, rejectNil, 'valid EMail address'
1202+
ValueIsEMailAddress, rejectNil, 'EMail address'
12091203
), expectedEMailAddress = expectEMailAddress
12101204

12111205
/**** allow/expect[ed]URL ****/
12121206

12131207
export const allowURL = /*#__PURE__*/ ValidatorForClassifier(
1214-
ValueIsURL, acceptNil, 'valid URL'
1208+
ValueIsURL, acceptNil, 'URL'
12151209
), allowedURL = allowURL
12161210

12171211
export const expectURL = /*#__PURE__*/ ValidatorForClassifier(
1218-
ValueIsURL, rejectNil, 'valid URL'
1212+
ValueIsURL, rejectNil, 'URL'
12191213
), expectedURL = expectURL
12201214

12211215
/**** escaped - escapes all control characters in a given string ****/

0 commit comments

Comments
 (0)