Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 120926a

Browse files
fix(TypeArray) _tSplitBy when string is empty
1 parent be56753 commit 120926a

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

dist/types/TypeArray.js

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

dist/types/TypeArray.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/types/TypeArray.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ export class TypeArray<T = any> extends TypeAny {
128128

129129
_transform() {
130130
if (this._tSplitBy != null && typeof this._value === 'string') {
131-
this._value = this._value.split(this._tSplitBy);
131+
if (this._value === '') {
132+
this._value = [];
133+
} else {
134+
this._value = this._value.split(this._tSplitBy);
135+
}
132136
}
133137
if (this._tSingle && !Array.isArray(this._value)) {
134138
this._value = castArray(this._value);

0 commit comments

Comments
 (0)