Skip to content

Commit

Permalink
Use some more template strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Marsup committed Nov 24, 2018
1 parent 028d6fe commit b9e235f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/types/array/index.js
Expand Up @@ -361,7 +361,7 @@ internals.Array = class extends Any {
castErr.path = index;
}

castErr.message = castErr.message + '(' + castErr.path + ')';
castErr.message = `${castErr.message}(${castErr.path})`;
throw castErr;
}

Expand Down Expand Up @@ -398,7 +398,7 @@ internals.Array = class extends Any {
castErr.path = index;
}

castErr.message = castErr.message + '(' + castErr.path + ')';
castErr.message = `${castErr.message}(${castErr.path})`;
throw castErr;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/types/object/index.js
Expand Up @@ -454,7 +454,7 @@ internals.Object = class extends Any {
}
catch (castErr) {
if (castErr.hasOwnProperty('path')) {
castErr.message = castErr.message + '(' + castErr.path + ')';
castErr.message = `${castErr.message}(${castErr.path})`;
}

throw castErr;
Expand Down Expand Up @@ -686,7 +686,7 @@ internals.Object = class extends Any {
}
catch (castErr) {
if (castErr.hasOwnProperty('path')) {
castErr.message = castErr.message + '(' + castErr.path + ')';
castErr.message = `${castErr.message}(${castErr.path})`;
}

throw castErr;
Expand Down

0 comments on commit b9e235f

Please sign in to comment.