{"name":"match-url-wildcard","version":"0.0.4","keywords":["url","match-url","no-proxy","proxy-bypass","wildcard"],"author":{"name":"alexkamaev"},"license":"MIT","_id":"match-url-wildcard@0.0.4","maintainers":[{"name":"alexkamaev","email":"alexikam@gmail.com"}],"homepage":"https://github.com/AlexKamaev/match-url-wildcard#readme","bugs":{"url":"https://github.com/AlexKamaev/match-url-wildcard/issues"},"dist":{"shasum":"c8533da7ec0901eddf01fc0893effa68d4e727d6","tarball":"http://registry-npm.ywwl.com/match-url-wildcard/download/match-url-wildcard-0.0.4.tgz","fileCount":5,"integrity":"sha512-R1XhQaamUZPWLOPtp4ig5j+3jctN+skhgRmEQTUamMzmNtRG69QEirQs0NZKLtHMR7tzWpmtnS4Eqv65DcgXUA==","signatures":[{"sig":"MEYCIQD8gu3gsTdldk/nnzAIcN50MMw0+/jOQ59j9nc9NEkgXgIhAPQbuITonaHuEtdX//fi1QBiwK79NGnsZcO03BbuGyDK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc48DmCRA9TVsSAnZWagAAJb8P+QGLhCjGrEgJflgy4RFQ\noDd2XlVbIp1jh0hCFDwG+4YhwgTyWIALX8kMo7NzTv357zSbpQRcqnz/Eqig\nRy1o/wzDG+wAntpFS3GMslEaPfsGvgNcb1gFaD/NtgQNplj6/mjW0AU5fzKA\nKcntNE0cMYCtIi6I3MnZsG0SD5wlFIKGMsVuFUHfBXuE4TnIDZhRmrfohncy\nwHDqJiuW50zyscYQf0o9ei+ZFLtGjtiPjFYkvBx9XdyYwQr+zYi1g7NWtRP2\nBbE9qQrORCouTQAFo9Cw0ZeGJtil2WcqiwFLEQcvlwpoLED5p2kYolQeOJi+\nje9fIzEYkTMa4wfsRugu2X1JXFi8ESKWMp+i5VgphG9eFGGmn9QzVu55qu0A\naueVmtNWRGNFDV8nq7Z392WA5JIbXAIgwT/hdHOU4v4RCSBM706Wlbh9+J71\nA7UQztITA1CIeLiYTV0F45BkNj3v3AaY10i8pwgxW1EPD0E2cCrku6Qgqpjo\nUpxZbISpUIyQgO4FBxrP/7LiaXj0wi9ZICnWKvJDDvqVPx5YuVbo6BSG/dit\nK+jbnAlCaoJJiui+80BkxrS6n9JLRO2fnIrgoOltXQQNM8RmsHHxpbTQS1S0\nfwHniGRuDlVmJZpYpQvxjaKaG9l5vXfUPecNSp7CkNE5zrila5iN2P3pCs1b\nhROC\r\n=IpNj\r\n-----END PGP SIGNATURE-----\r\n","size":2568,"noattachment":false,"key":"/match-url-wildcard/-/match-url-wildcard-0.0.4.tgz"},"main":"index.js","types":"./ts-defs/index.d.ts","gitHead":"598774577647b35d31479ad11a5c5796b401cf34","scripts":{"test":"mocha"},"_npmUser":{"name":"alexkamaev","email":"alexikam@gmail.com"},"repository":{"url":"git+https://github.com/AlexKamaev/match-url-wildcard.git","type":"git"},"_npmVersion":"6.4.1","description":"Module to match url by pattern with wildcard","directories":{},"_nodeVersion":"10.15.3","dependencies":{"escape-string-regexp":"^1.0.5"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.1.2","mocha":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/match-url-wildcard_0.0.4_1558429926099_0.9089065310282645","host":"s3://npm-registry-packages"},"readme":"# Match-url-wildcard [![Build Status](https://travis-ci.org/AlexKamaev/match-url-wildcard.svg?branch=master)](https://travis-ci.org/AlexKamaev/match-url-wildcard)\n## Module to match url by pattern\n\n#### var rule = 'google.com';\n\n    expect(matchUrl('google.com.uk', rule)).to.be.false;\n    expect(matchUrl('docs.google.com', rule)).to.be.false;\n    expect(matchUrl('http://docs.google.com', rule)).to.be.false;\n    expect(matchUrl('https://docs.google.com', rule)).to.be.false;\n    expect(matchUrl('www.docs.google.com', rule)).to.be.false;\n    expect(matchUrl('http://docs.ggoogle.com', rule)).to.be.false;\n    expect(matchUrl('http://goooogle.com', rule)).to.be.false;\n    expect(matchUrl('gogoogle.com', rule)).to.be.false;\n    expect(matchUrl('http://google.com', rule)).to.be.true;\n    expect(matchUrl('https://google.com', rule)).to.be.true;\n    expect(matchUrl('https://google.com/', rule)).to.be.true;\n    expect(matchUrl('google.com/', rule)).to.be.true;\n\n#### rule = 'http://google.com';\n\n    expect(matchUrl('https://google.com', rule)).to.be.false;\n    expect(matchUrl('https://google.com/', rule)).to.be.false;\n    expect(matchUrl('docs.google.com', rule)).to.be.false;\n    expect(matchUrl('http://docs.google.com', rule)).to.be.false;\n    expect(matchUrl('https://docs.google.com', rule)).to.be.false;\n    expect(matchUrl('www.docs.google.com', rule)).to.be.false;\n    expect(matchUrl('http://docs.ggoogle.com', rule)).to.be.false;\n    expect(matchUrl('http://google.com', rule)).to.be.true;\n    expect(matchUrl('google.com/', rule)).to.be.true;\n\n#### rule = 'https://google.com';\n\n    expect(matchUrl('http://google.com', rule)).to.be.false;\n    expect(matchUrl('https://google.com', rule)).to.be.true;\n\n#### ['.google.com', '*.google.com']\n    .forEach(r => {\n        expect(matchUrl('http://google.com', r)).to.be.false;\n        expect(matchUrl('https://google.com', r)).to.be.false;\n        expect(matchUrl('https://google.com/', r)).to.be.false;\n        expect(matchUrl('google.com/', r)).to.be.false;\n        expect(matchUrl('http://docs.ggoogle.com', r)).to.be.false;\n        expect(matchUrl('docs.google.com', r)).to.be.true;\n        expect(matchUrl('http://docs.google.com', r)).to.be.true;\n        expect(matchUrl('https://docs.google.com', r)).to.be.true;\n        expect(matchUrl('www.docs.google.com', r)).to.be.true;\n    });\n\n#### ['.com', '*.com']\n    .forEach(r => {\n        expect(matchUrl('http://google.com.uk', r)).to.be.false;\n        expect(matchUrl('http://google.com', r)).to.be.true;\n        expect(matchUrl('google.com/', r)).to.be.true;\n        expect(matchUrl('docs.google.com', r)).to.be.true;\n        expect(matchUrl('http://docs.google.com', r)).to.be.true;\n        expect(matchUrl('www.docs.google.com', r)).to.be.true;\n    });\n\n#### ['google.', 'google.*']\n    .forEach(r => {\n        expect(matchUrl('docs.google.com', r)).to.be.false;\n        expect(matchUrl('https://docs.google.co.uk', r)).to.be.false;\n        expect(matchUrl('https://docs.google.uk', r)).to.be.false;\n        expect(matchUrl('http://google.com', r)).to.be.true;\n        expect(matchUrl('https://google.co.uk', r)).to.be.true;\n        expect(matchUrl('google.ru/', r)).to.be.true;\n    });\n\n#### ['docs.google.', 'docs.google.*']\n    .forEach(r => {\n        expect(matchUrl('http://google.com', r)).to.be.false;\n        expect(matchUrl('docs.google', r)).to.be.false;\n        expect(matchUrl('https://docs.googlee.com', r)).to.be.false;\n        expect(matchUrl('www.docs.google.co.uk', r)).to.be.false;\n        expect(matchUrl('http://docs.ggoogle.com', r)).to.be.false;\n        expect(matchUrl('http://___docs.google.com', r)).to.be.false;\n        expect(matchUrl('docs.google.en', r)).to.be.true;\n        expect(matchUrl('http://docs.google.co.uk', r)).to.be.true;\n    });\n\n#### ['.google.', '*.google.*']\n    .forEach(r => {\n        expect(matchUrl('http://google.com', r)).to.be.false;\n        expect(matchUrl('docs.google.com', r)).to.be.true;\n        expect(matchUrl('http://docs.google.com', r)).to.be.true;\n        expect(matchUrl('www.docs.google.com', r)).to.be.true;\n        expect(matchUrl('www.my.docs.google.com', r)).to.be.true;\n\n    });\n\n#### ['.docs.google.', '*.docs.google.*']\n    .forEach(r => {\n        expect(matchUrl('http://google.com', r)).to.be.false;\n        expect(matchUrl('docs.google.com', r)).to.be.false;\n        expect(matchUrl('http://docs.google.com', r)).to.be.false;\n        expect(matchUrl('www.docs.google.com', r)).to.be.true;\n        expect(matchUrl('www.my.docs.google.com.eu', r)).to.be.true;\n    });\n\n#### rule = 'docs.*.com';\n\n    expect(matchUrl('docs.google.com', rule)).to.be.true;\n    expect(matchUrl('docs.google.eu.com', rule)).to.be.true;\n    expect(matchUrl('docs.google.ru', rule)).to.be.false;\n    expect(matchUrl('docs.google.co.uk', rule)).to.be.false;\n\n#### rule = 'docs.*.*.com';\n\n    expect(matchUrl('docs.google.com', rule)).to.be.false;\n    expect(matchUrl('docs.google.ru', rule)).to.be.false;\n    expect(matchUrl('my.docs.google.ro.eu.com', rule)).to.be.false;\n    expect(matchUrl('docs.google.co.uk', rule)).to.be.false;\n    expect(matchUrl('docs.google.eu.com', rule)).to.be.true;\n    expect(matchUrl('docs.google.ro.eu.com', rule)).to.be.true;\n\n#### rule = '.docs.*.*.com.';\n\n    expect(matchUrl('my.docs.google.eu.com.ru', rule)).to.be.true;\n\n#### rule = 'docs.g*e.com';\n\n    expect(matchUrl('docs.google.com', rule)).to.be.false;\n\n#### rule = 'localhost';\n\n    expect(matchUrl('localhost', rule)).to.be.true;\n    expect(matchUrl('http://localhost', rule)).to.be.true;\n    expect(matchUrl('my-localhost', rule)).to.be.false;\n    expect(matchUrl('localhost-my', rule)).to.be.false;\n\n#### rule = '127.0.0.1';\n\n    expect(matchUrl('127.0.0.1', rule)).to.be.true;\n    expect(matchUrl('http://127.0.0.1', rule)).to.be.true;\n    expect(matchUrl('https://127.0.0.1', rule)).to.be.true;\n\n#### rule = '127.0.0.';\n\n    expect(matchUrl('127.127.0.0', rule)).to.be.false;\n    expect(matchUrl('127.0.0.2', rule)).to.be.true;\n\n#### rule = '.0.0.';\n\n    expect(matchUrl('127.0.1.2', rule)).to.be.false;\n    expect(matchUrl('127.0.0.2', rule)).to.be.true;\n\n#### rule = '127.*.*.0';\n\n    expect(matchUrl('128.120.120.0', rule)).to.be.false;\n    expect(matchUrl('127.0.0.0', rule)).to.be.true;\n    expect(matchUrl('127.120.120.0', rule)).to.be.true;\n\n#### rule = 'google.com:81';\n\n    expect(matchUrl('google.com', rule)).to.be.false;\n    expect(matchUrl('google.com:80', rule)).to.be.false;\n    expect(matchUrl('google.com:81', rule)).to.be.true;\n\n#### rule = 'google.:81';\n\n    expect(matchUrl('google.com', rule)).to.be.false;\n    expect(matchUrl('google.com:80', rule)).to.be.false;\n    expect(matchUrl('google.com:81', rule)).to.be.true;\n\n#### rule = 'localhost:3000';\n\n    expect(matchUrl('localhost:3000/features/functional/local', rule)).to.be.true;\n    expect(matchUrl('http://localhost:3000/features/functional/local', rule)).to.be.true;\n    expect(matchUrl(null, rule)).to.be.false;\n\n#### rule = 1;\n\n    expect(matchUrl('google', rule)).to.be.false;","publish_time":1558429926300,"_cnpm_publish_time":1558429926300,"dist-tags":{"latest":"0.0.5"}}