Skip to content

Commit 6428c38

Browse files
committed
Updates the release version.
1 parent 5d0462a commit 6428c38

5 files changed

+38
-86
lines changed

VerbalExpressions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* VerbalExpressions JavaScript Library v0.2.1
2+
* VerbalExpressions JavaScript Library v0.3.0
33
* https://github.com/VerbalExpressions/JSVerbalExpressions
44
*
55
*

dist/verbalexpressions.js

Lines changed: 32 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* VerbalExpressions JavaScript Library v0.2.1
2+
* VerbalExpressions JavaScript Library v0.3.0
33
* https://github.com/VerbalExpressions/JSVerbalExpressions
44
*
55
*
@@ -104,9 +104,7 @@
104104
startOfLine: function startOfLine(enable) {
105105
enable = (enable !== false);
106106
this._prefixes = enable ? '^' : '';
107-
this.add();
108-
109-
return this;
107+
return this.add();
110108
},
111109

112110
/**
@@ -117,9 +115,7 @@
117115
endOfLine: function endOfLine(enable) {
118116
enable = (enable !== false);
119117
this._suffixes = enable ? '$' : '';
120-
this.add();
121-
122-
return this;
118+
return this.add();
123119
},
124120

125121
/**
@@ -129,9 +125,7 @@
129125
*/
130126
then: function then(value) {
131127
value = this.sanitize(value);
132-
this.add('(?:' + value + ')');
133-
134-
return this;
128+
return this.add('(?:' + value + ')');
135129
},
136130

137131
/**
@@ -150,9 +144,7 @@
150144
*/
151145
maybe: function maybe(value) {
152146
value = this.sanitize(value);
153-
this.add('(?:' + value + ')?');
154-
155-
return this;
147+
return this.add('(?:' + value + ')?');
156148
},
157149

158150
/**
@@ -161,8 +153,7 @@
161153
* @return {VerbalExpression} Same instance of VerbalExpression to allow method chaining
162154
*/
163155
anything: function anything() {
164-
this.add('(?:.*)');
165-
return this;
156+
return this.add('(?:.*)');
166157
},
167158

168159
/**
@@ -172,18 +163,15 @@
172163
*/
173164
anythingBut: function anythingBut(value) {
174165
value = this.sanitize(value);
175-
this.add('(?:[^' + value + ']*)');
176-
177-
return this;
166+
return this.add('(?:[^' + value + ']*)');
178167
},
179168

180169
/**
181170
* Any character at least one time
182171
* @return {VerbalExpression} Same instance of VerbalExpression to allow method chaining
183172
*/
184173
something: function something() {
185-
this.add('(?:.+)');
186-
return this;
174+
return this.add('(?:.+)');
187175
},
188176

189177
/**
@@ -193,9 +181,7 @@
193181
*/
194182
somethingBut: function somethingBut(value) {
195183
value = this.sanitize(value);
196-
this.add('(?:[^' + value + ']+)');
197-
198-
return this;
184+
return this.add('(?:[^' + value + ']+)');
199185
},
200186

201187
/**
@@ -217,8 +203,7 @@
217203
* @return {VerbalExpression} Same instance of VerbalExpression to allow method chaining
218204
*/
219205
lineBreak: function lineBreak() {
220-
this.add('(?:\\r\\n|\\r|\\n)'); // Unix + Windows CRLF
221-
return this;
206+
return this.add('(?:\\r\\n|\\r|\\n)'); // Unix + Windows CRLF
222207
},
223208

224209
/**
@@ -234,16 +219,23 @@
234219
* @return {VerbalExpression} Same instance of VerbalExpression to allow method chaining
235220
*/
236221
tab: function tab() {
237-
this.add('\\t');
238-
return this;
222+
return this.add('\\t');
239223
},
240224

241225
/**
242226
* Any alphanumeric
243227
* @return {VerbalExpression} Same instance of VerbalExpression to allow method chaining
244228
*/
245229
word: function word() {
246-
this.add('\\w+');
230+
return this.add('\\w+');
231+
},
232+
233+
/**
234+
* Any digit
235+
* @return {VerbalExpression} Same instance of VerbalExpression to allow method chaining
236+
*/
237+
digit: function digit() {
238+
this.add('\\d');
247239
return this;
248240
},
249241

@@ -252,8 +244,7 @@
252244
* @return {VerbalExpression} Same instance of VerbalExpression to allow method chaining
253245
*/
254246
whitespace: function whitespace() {
255-
this.add('\\s');
256-
return this;
247+
return this.add('\\s');
257248
},
258249

259250
/**
@@ -263,9 +254,7 @@
263254
*/
264255
anyOf: function anyOf(value) {
265256
value = this.sanitize(value);
266-
this.add('[' + value + ']');
267-
268-
return this;
257+
return this.add('[' + value + ']');
269258
},
270259

271260
/**
@@ -301,9 +290,7 @@
301290

302291
buffer[index++] = ']';
303292

304-
this.add(buffer.join(''));
305-
306-
return this;
293+
return this.add(buffer.join(''));
307294
},
308295

309296
/// Modifiers ///
@@ -318,9 +305,7 @@
318305
this._modifiers += modifier;
319306
}
320307

321-
this.add();
322-
323-
return this;
308+
return this.add();
324309
},
325310

326311
/**
@@ -330,9 +315,7 @@
330315
*/
331316
removeModifier: function removeModifier(modifier) {
332317
this._modifiers = this._modifiers.replace(modifier, '');
333-
this.add();
334-
335-
return this;
318+
return this.add();
336319
},
337320

338321
/**
@@ -341,15 +324,7 @@
341324
* @return {VerbalExpression} Same instance of VerbalExpression to allow method chaining
342325
*/
343326
withAnyCase: function withAnyCase(enable) {
344-
if (enable !== false) {
345-
this.addModifier('i');
346-
} else {
347-
this.removeModifier('i');
348-
}
349-
350-
this.add();
351-
352-
return this;
327+
return enable !== false ? this.addModifier('i') : this.removeModifier('i');
353328
},
354329

355330
/**
@@ -358,15 +333,7 @@
358333
* @return {VerbalExpression} Same instance of VerbalExpression to allow method chaining
359334
*/
360335
stopAtFirst: function stopAtFirst(enable) {
361-
if (enable !== false) {
362-
this.removeModifier('g');
363-
} else {
364-
this.addModifier('g');
365-
}
366-
367-
this.add();
368-
369-
return this;
336+
return enable !== false ? this.removeModifier('g') : this.addModifier('g');
370337
},
371338

372339
/**
@@ -375,15 +342,7 @@
375342
* @return {VerbalExpression} Same instance of VerbalExpression to allow method chaining
376343
*/
377344
searchOneLine: function searchOneLine(enable) {
378-
if (enable !== false) {
379-
this.removeModifier('m');
380-
} else {
381-
this.addModifier('m');
382-
}
383-
384-
this.add();
385-
386-
return this;
345+
return enable !== false ? this.removeModifier('m') : this.addModifier('m');
387346
},
388347

389348
/**
@@ -410,18 +369,15 @@
410369
}
411370

412371

413-
this.add(value);
414-
415-
return (this);
372+
return this.add(value);
416373
},
417374

418375
/**
419376
* Repeats the previous at least once
420377
* @return {VerbalExpression} Same instance of VerbalExpression to allow method chaining
421378
*/
422379
oneOrMore: function oneOrMore() {
423-
this.add('+');
424-
return (this);
380+
return this.add('+');
425381
},
426382

427383
/// Loops ///
@@ -470,9 +426,7 @@
470426
beginCapture: function beginCapture() {
471427
// Add the end of the capture group to the suffixes for now so compilation continues to work
472428
this._suffixes += ')';
473-
this.add('(');
474-
475-
return this;
429+
return this.add('(');
476430
},
477431

478432
/**
@@ -482,9 +436,7 @@
482436
endCapture: function endCapture() {
483437
// Remove the last parentheses from the _suffixes and add to the regex itself
484438
this._suffixes = this._suffixes.substring(0, this._suffixes.length - 1);
485-
this.add(')');
486-
487-
return this;
439+
return this.add(')');
488440
},
489441

490442
/**

dist/verbalexpressions.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)