Skip to content
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

CDN link , web distribution #9

Open
mafar opened this issue Mar 7, 2019 · 10 comments
Open

CDN link , web distribution #9

mafar opened this issue Mar 7, 2019 · 10 comments

Comments

@mafar
Copy link

mafar commented Mar 7, 2019

It will be very helpful if there is a CDN link so that lib can be tested .

https://github.com/valoricDe/MultiRegExp2/blob/master/dist/multiRegExp2.js
file is also wrong for web distribution as ther is no UMD wrapper

Just paste code in any jsfiddle and run to see compatibility

@mafar
Copy link
Author

mafar commented Mar 7, 2019

for UMD
npm install --save-dev babel-plugin-transform-es2015-modules-umd
then create
.babelrc file with content

{
  "plugins": ["transform-es2015-modules-umd"]
}

and then run npm build
nw you will have universal module for any env , distribution

@mafar
Copy link
Author

mafar commented Mar 7, 2019

Here is fiddle https://jsfiddle.net/bababalcksheep/o4qn7jwe/48/ with UMD

and this lib does not work correctly for nested groups.
https://jsfiddle.net/bababalcksheep/o4qn7jwe/48/ from this, try query and str and comapre match with regex101.com

@valoricDe
Copy link
Owner

valoricDe commented Mar 7, 2019

I added a build for iife for browsers (https://raw.githubusercontent.com/valoricDe/MultiRegExp2/master/dist/multiRegExp2.js). In the jsfiddle I do not see nested regexps. Could you write the regexp here and the expected output?

@mafar
Copy link
Author

mafar commented Mar 7, 2019

https://regex101.com/r/V16o77/1
see this
string aaaaaaaaaaaaaa
regex /a(a*)a/g

In ur case , full matach which is first result is ok ,
But 2nd group is not , not the match , not the start end as well

image

@mafar
Copy link
Author

mafar commented Mar 7, 2019

in any case, consider using UMD over iife , requireJs is still around

@valoricDe
Copy link
Owner

I added UMD

regarding the matches. I added a testcase for your issue and it correctly returns a matching group with start 1 and end 13. Could you clone the project and run npm test?

@valoricDe
Copy link
Owner

valoricDe commented Mar 7, 2019

new MultiRegExp2(/a(a*)a/).execForAllGroups("aaaaaaaaaaaaaa", false)
TestCase 7 passed: => [{"match":"aaaaaaaaaaaa","start":1,"end":13}]

@mafar
Copy link
Author

mafar commented Mar 8, 2019

Give me sometime and i will make a jsfiddle with all of my test cases . thankx

@mafar
Copy link
Author

mafar commented Mar 8, 2019

Moving on here #10
CLOSE this issue and consider using jsdeliver or any other CDN for this repo.
multiRegExp2.js umd and iife should be deliverable , for web moslty

and with UMD present , there is no need of iife

@mafar
Copy link
Author

mafar commented Mar 8, 2019

no dist folder at https://www.jsdelivr.com/package/npm/multi-regexp2

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

No branches or pull requests

2 participants