Small formatting cleanups (#554)

* Small formatting cleanups

* Cleanup typos
This commit is contained in:
Jaco Greeff
2020-02-28 12:27:27 +01:00
committed by GitHub
parent 765f9baf44
commit 0f726ce777
10 changed files with 39 additions and 58 deletions
+3 -5
View File
@@ -17,9 +17,7 @@
* ```
*/
export default function stringLowerFirst (value?: string | null): string {
if (!value) {
return '';
}
return value.charAt(0).toLowerCase() + value.slice(1);
return value
? value.charAt(0).toLowerCase() + value.slice(1)
: '';
}
+3 -5
View File
@@ -37,9 +37,7 @@ try {
* ```
*/
export default function stringToU8a (value?: string): Uint8Array {
if (!value) {
return new Uint8Array([]);
}
return encoder.encode(value);
return value
? encoder.encode(value)
: new Uint8Array([]);
}
+3 -5
View File
@@ -17,9 +17,7 @@
* ```
*/
export default function stringUpperFirst (value?: string | null): string {
if (!value) {
return '';
}
return value.charAt(0).toUpperCase() + value.slice(1);
return value
? value.charAt(0).toUpperCase() + value.slice(1)
: '';
}