Skip to content

Conversation

@beast911
Copy link

No description provided.

Copy link
Owner

@joeltankam joeltankam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.
Some changes needed. Also, please update documentation.

src/is/types.js Outdated
@@ -1,4 +1,5 @@
const { toString } = Object.prototype;
const uriRegex = /^([a-z]+\:\/{2})(([a-zA-Z0-9]+([_ -]*[a-zA-Z0-9])*)(:[!#$%^&*\)(}{\[\]\\\|\/\~\`\;\"\'\?\>\<\+\-\.a-zA-Z0-9]*@)?)?([w]{3}\.)?([a-zA-Z0-9]+([_ -]*[a-zA-Z0-9])*\.[a-z]*)(\:[\d]*)?(\/[a-zA-Z0-9]+(\.[a-zA-Z]+)?)*((\?[a-zA-Z]+\=[a-zA-Z0-9]+)*)?((\#[a-zA-Z]+(\=[a-zA-Z0-9]+)?)*)?/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreadable line

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay i will update this

src/is/types.js Outdated
* @param {*} value the value to check
* @returns {Boolean} `true` if the value is a URI; otherwise, `false`
*/
export function isURI(value) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be in this file, but rather regexp.js as mentioned in the issue description.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it


describe('isURI', () => {
const uriFull = "http://abc:[email protected]/path1/path2?param1=value1?param2=value2#frag1=fragvalue1";
test('should return true on correct URI string', () => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the same syntax as the existing tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants