-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #302 from l2hyunwoo/feature/fix-validation-empty-n…
…ame-goal 🐛 Add Validation For Name & Goal
- Loading branch information
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { isEmptyOrBlank } from "../src/utils/whitespace"; | ||
|
||
describe("WhiteSpace and empty string should return true", () => { | ||
test("Empty string should return true", () => { | ||
const emptyString = ""; | ||
expect(isEmptyOrBlank(emptyString)).toEqual(true); | ||
}) | ||
test("WhiteSpace string should return true", () => { | ||
const whiteSpaceString = " "; | ||
expect(isEmptyOrBlank(whiteSpaceString)).toEqual(true); | ||
}) | ||
test("NewLine should return true", () => { | ||
const newLineString = "\n\n"; | ||
expect(isEmptyOrBlank(newLineString)).toEqual(true); | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function regex() { | ||
return /^[\s\f\n\r\t\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\ufeff\x09\x0a\x0b\x0c\x0d\x20\xa0]+$/; | ||
} | ||
|
||
export function isEmptyOrBlank(value: string) { | ||
return regex().test(value) || value === ''; | ||
} |
f730c66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
agent-gpt – ./
agent-gpt-git-main-reworkd.vercel.app
reworkd.ai
agent-gpt-reworkd.vercel.app
agent-gpt.vercel.app
agentgpt.reworkd.ai
agent.reworkd.ai
agent-gpt.reworkd.ai