-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: Add attendee custom form option #4480
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ module.exports = { | |
'plugin:ember-suave/recommended' | ||
], | ||
env: { | ||
es6: true, | ||
browser: true | ||
}, | ||
rules: { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export function slugify(string: string, sep: string = '-'): string { | ||
return string.toLowerCase() | ||
.replace(/[^\w\s-]/g, '') // remove non-word [a-z0-9_], non-whitespace, non-hyphen characters | ||
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. Codacy found an issue: Expected indentation of 4 spaces but found 8. |
||
.replace(/[\s_-]+/g, sep) // swap any length of whitespace, underscore, hyphen characters with a single - | ||
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. Codacy found an issue: Expected indentation of 4 spaces but found 8. |
||
.replace(/^-+|-+$/g, ''); // remove leading, trailing - | ||
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. Codacy found an issue: Expected indentation of 4 spaces but found 8. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { slugify } from 'open-event-frontend/utils/text'; | ||
import { module, test } from 'qunit'; | ||
|
||
module('Unit | Text | Slugify', function() { | ||
test('test slugify', function(assert) { | ||
assert.equal(slugify('Hello World'), 'hello-world'); | ||
assert.equal(slugify('Name and Age', '_'), 'name_and_age'); | ||
assert.equal(slugify('What is Suo Moto?'), 'what-is-suo-moto'); | ||
}); | ||
}); |
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.
Codacy found an issue: Expected indentation of 2 spaces but found 4.