-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trim and remove spaces from ID with user alert #94
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,13 @@ export function getRoot(businessObject, moddle) { | |
} | ||
return businessObject; | ||
} | ||
|
||
|
||
export function processId(id) { | ||
let trimmedId = id.trim(); | ||
let processedId = trimmedId.replace(/\s+/g, ''); | ||
if (id !== processedId) { | ||
alert('ID should not contain spaces. It has been adjusted.'); | ||
} | ||
return processedId; | ||
} | ||
Comment on lines
+41
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider replacing Using |
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.
maybe we should remove any non-alphanumeric/hyphen/underscore characters?