Skip to content

Commit

Permalink
v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasZottis committed Sep 24, 2024
1 parent abaca1d commit ef55b23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dev-toolz.library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dev-toolz.library",
"version": "1.0.3",
"version": "1.0.4",
"description": "Biblioteca de funcionalidades gerais usadas no dia a dia de um desenvolvedor",
"main": "index.js",
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions dev-toolz.library/src/extensions/stringExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ declare global {
String.prototype.empty = "";

String.prototype.forEach = function (action: (element: string) => void): void {
let value: string = this;
let value: string = this.toString();

for (let i = 0; i < value.length; i++)
action(value[i]);
}

String.prototype.isEqual = function (value: string): boolean {
return value === this;
return value === this.toString();
}

String.prototype.isEmpty = function (): boolean {
let value: string = this;
let value: string = this.toString();

return value === undefined && value === null && value.trim() === "";
}

String.prototype.isNotEmpty = function (): boolean {
let value: string = this;
let value: string = this.toString();

return value !== undefined && value !== null && value.trim() !== "";
}
Expand All @@ -43,6 +43,6 @@ String.prototype.isNumber = function (): boolean {
}

String.prototype.toNumber = function (): number {
let value = Number(this);
let value = Number(this.toString());
return isNaN(value) ? 0 : value
}

0 comments on commit ef55b23

Please sign in to comment.