pax_global_header00006660000000000000000000000064134273500660014520gustar00rootroot0000000000000052 comment=091af68b6432171e3946c34167a07617a3f776e6 globalyzer-0.1.4/000077500000000000000000000000001342735006600136745ustar00rootroot00000000000000globalyzer-0.1.4/.gitignore000066400000000000000000000000271342735006600156630ustar00rootroot00000000000000node_modules .DS_Store globalyzer-0.1.4/.travis.yml000066400000000000000000000000411342735006600160000ustar00rootroot00000000000000language: node_js node_js: - 8 globalyzer-0.1.4/appveyor.yml000066400000000000000000000003361342735006600162660ustar00rootroot00000000000000environment: nodejs_version: "8" install: - ps: Install-Product node $env:nodejs_version - npm install --global npm@latest - npm install test_script: - node --version - npm --version - npm test build: off globalyzer-0.1.4/license000066400000000000000000000020671342735006600152460ustar00rootroot00000000000000MIT License Copyright (c) 2018 Terkel Gjervig Nielsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. globalyzer-0.1.4/package-lock.json000066400000000000000000000435111342735006600171140ustar00rootroot00000000000000{ "name": "globalyzer", "version": "0.1.4", "lockfileVersion": 1, "requires": true, "dependencies": { "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", "has-ansi": "^2.0.0", "strip-ansi": "^3.0.0", "supports-color": "^2.0.0" } }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", "dev": true }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "requires": { "object-keys": "^1.0.12" } }, "defined": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", "dev": true }, "duplexer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", "dev": true }, "es-abstract": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", "dev": true, "requires": { "es-to-primitive": "^1.2.0", "function-bind": "^1.1.1", "has": "^1.0.3", "is-callable": "^1.1.4", "is-regex": "^1.0.4", "object-keys": "^1.0.12" } }, "es-to-primitive": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", "dev": true, "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", "is-symbol": "^1.0.2" } }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, "figures": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "dev": true, "requires": { "escape-string-regexp": "^1.0.5", "object-assign": "^4.1.0" } }, "for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "requires": { "is-callable": "^1.1.3" } }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { "function-bind": "^1.1.1" } }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { "ansi-regex": "^2.0.0" } }, "has-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" } }, "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", "dev": true }, "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", "dev": true }, "is-finite": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "dev": true, "requires": { "number-is-nan": "^1.0.0" } }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "dev": true, "requires": { "has": "^1.0.1" } }, "is-symbol": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", "dev": true, "requires": { "has-symbols": "^1.0.0" } }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "lodash": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", "dev": true }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, "object-inspect": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", "dev": true }, "object-keys": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", "dev": true }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" } }, "parse-ms": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", "integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", "dev": true }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "plur": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", "integrity": "sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY=", "dev": true }, "pretty-ms": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", "integrity": "sha1-QlfCVt8/sLRR1q/6qwIYhBJpgdw=", "dev": true, "requires": { "is-finite": "^1.0.1", "parse-ms": "^1.0.0", "plur": "^1.0.0" } }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, "re-emitter": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/re-emitter/-/re-emitter-1.1.3.tgz", "integrity": "sha1-+p4xn/3u6zWycpbvDz03TawvUqc=", "dev": true }, "readable-stream": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, "resolve": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", "dev": true, "requires": { "path-parse": "^1.0.5" } }, "resumer": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", "dev": true, "requires": { "through": "~2.3.4" } }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "split": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", "dev": true, "requires": { "through": "2" } }, "string.prototype.trim": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", "dev": true, "requires": { "define-properties": "^1.1.2", "es-abstract": "^1.5.0", "function-bind": "^1.0.2" } }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" } }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" } }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, "tap-out": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/tap-out/-/tap-out-1.4.2.tgz", "integrity": "sha1-yQfsG/lAURHQiCY+kvVgi4jLs3o=", "dev": true, "requires": { "re-emitter": "^1.0.0", "readable-stream": "^2.0.0", "split": "^1.0.0", "trim": "0.0.1" } }, "tap-spec": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/tap-spec/-/tap-spec-4.1.2.tgz", "integrity": "sha512-CmZP7vp9Jk7fND0nvdjIzjGMZnBDx1jVG7T9x6i2GZb/ejIODGz7OSsWFfwwuEcY9yHWtpD/mdLverla0M8EWA==", "dev": true, "requires": { "chalk": "^1.0.0", "duplexer": "^0.1.1", "figures": "^1.4.0", "lodash": "^3.6.0", "pretty-ms": "^2.1.0", "repeat-string": "^1.5.2", "tap-out": "^1.4.1", "through2": "^2.0.0" } }, "tape": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.2.tgz", "integrity": "sha512-lPXKRKILZ1kZaUy5ynWKs8ATGSUO7HAFHCFnBam6FaGSqPdOwMWbxXHq4EXFLE8WRTleo/YOMXkaUTRmTB1Fiw==", "dev": true, "requires": { "deep-equal": "~1.0.1", "defined": "~1.0.0", "for-each": "~0.3.3", "function-bind": "~1.1.1", "glob": "~7.1.2", "has": "~1.0.3", "inherits": "~2.0.3", "minimist": "~1.2.0", "object-inspect": "~1.6.0", "resolve": "~1.7.1", "resumer": "~0.0.0", "string.prototype.trim": "~1.1.2", "through": "~2.3.8" } }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, "through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" } }, "trim": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=", "dev": true }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", "dev": true } } } globalyzer-0.1.4/package.json000066400000000000000000000010171342735006600161610ustar00rootroot00000000000000{ "name": "globalyzer", "version": "0.1.4", "description": "Detect and extract the static part of a glob string", "main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/terkelg/globalyzer" }, "files": [ "src" ], "keywords": [ "glob", "analyzer", "base", "detect" ], "scripts": { "test": "tape test/*.js | tap-spec" }, "author": "Terkel Gjervig", "license": "MIT", "devDependencies": { "tap-spec": "^4.1.2", "tape": "^4.9.2" } } globalyzer-0.1.4/readme.md000066400000000000000000000023441342735006600154560ustar00rootroot00000000000000# globalyzer [![Build Status](https://travis-ci.org/terkelg/globalyzer.svg?branch=master)](https://travis-ci.org/terkelg/globalyzer)[![Build status](https://ci.appveyor.com/api/projects/status/0xqnmxt99rsnnjqh?svg=true)](https://ci.appveyor.com/project/terkelg/globalyzer) > Detect and extract the static part of a glob string Utility to detect if a string contains a glob and then split it in a glob and none-glob part. ## Install ``` npm install globalyzer --save ``` ## Usage ```js const globalyzer = require('globalyzer'); globalyzer('foo/bar/.git/'); // => { base: 'foo/bar/.git/', glob: '', isGlob: false } globalyzer('foo/bar/**/baz'); // => { base: 'foo/bar', glob: '**/baz', isGlob: true } ``` ## API ### globalyzer(glob, options) Type: `function`
Returns: `{ base, glob, isGlob }` Returns an object with the (non-glob) base path and the actual pattern and a is-glob flag. #### options.strict Type: `Boolean`
Default: `true` Be strict about what's a glob and what's not #### glob Type: `String` Glob string to analyze. ## Credit This is a fork of [is-glob](https://github.com/micromatch/is-glob) and [glob-base](https://github.com/micromatch/glob-base) ## License MIT © [Terkel Gjervig](https://terkel.com) globalyzer-0.1.4/src/000077500000000000000000000000001342735006600144635ustar00rootroot00000000000000globalyzer-0.1.4/src/index.js000066400000000000000000000050051342735006600161300ustar00rootroot00000000000000const path = require('path'); const CHARS = { '{': '}', '(': ')', '[': ']'}; const STRICT = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\)|(\\).|([@?!+*]\(.*\)))/; const RELAXED = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; /** * Detect if a string cointains glob * @param {String} str Input string * @param {Object} [options] Configuration object * @param {Boolean} [options.strict=true] Use relaxed regex if true * @returns {Boolean} true if string contains glob */ function isglob(str, { strict = true } = {}) { if (str === '') return false; let match, rgx = strict ? STRICT : RELAXED; while ((match = rgx.exec(str))) { if (match[2]) return true; let idx = match.index + match[0].length; // if an open bracket/brace/paren is escaped, // set the index to the next closing character let open = match[1]; let close = open ? CHARS[open] : null; if (open && close) { let n = str.indexOf(close, idx); if (n !== -1) idx = n + 1; } str = str.slice(idx); } return false; } /** * Find the static part of a glob-path, * split path and return path part * @param {String} str Path/glob string * @returns {String} static path section of glob */ function parent(str, { strict = false } = {}) { str = path.normalize(str).replace(/\/|\\/, '/'); // special case for strings ending in enclosure containing path separator if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/'; // preserves full path in case of trailing path separator str += 'a'; do {str = path.dirname(str)} while (isglob(str, {strict}) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str)); // remove escape chars and return result return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1'); }; /** * Parse a glob path, and split it by static/glob part * @param {String} pattern String path * @param {Object} [opts] Options * @param {Object} [opts.strict=false] Use strict parsing * @returns {Object} object with parsed path */ function globalyzer(pattern, opts = {}) { let base = parent(pattern, opts); let isGlob = isglob(pattern, opts); let glob; if (base != '.') { glob = pattern.substr(base.length); if (glob.startsWith('/')) glob = glob.substr(1); } else { glob = pattern; } if (!isGlob) { base = path.dirname(pattern); glob = base !== '.' ? pattern.substr(base.length) : pattern; } if (glob.startsWith('./')) glob = glob.substr(2); if (glob.startsWith('/')) glob = glob.substr(1); return { base, glob, isGlob }; } module.exports = globalyzer; globalyzer-0.1.4/test/000077500000000000000000000000001342735006600146535ustar00rootroot00000000000000globalyzer-0.1.4/test/index.js000066400000000000000000000232561342735006600163300ustar00rootroot00000000000000test = require('tape'); const { join } = require('path'); const $ = require('../src'); test('standard', t => { t.equal(typeof $, 'function', 'constructor is a typeof function'); t.end(); }); test('base', t => { [ // should strip glob magic to return parent path ['.', '.'], ['.*', '.'], ['/.*', '/'], ['/.*/', '/'], ['a/.*/b', 'a'], ['a*/.*/b', '.'], ['*/a/b/c', '.'], ['*', '.'], ['*/', '.'], ['*/*', '.'], ['*/*/', '.'], ['**', '.'], ['**/', '.'], ['**/*', '.'], ['**/*/', '.'], ['/*.js', '/'], ['*.js', '.'], ['**/*.js', '.'], ['{a,b}', '.'], ['/{a,b}', '/'], ['/{a,b}/', '/'], ['(a|b)', '.'], ['/(a|b)', '/'], ['./(a|b)', '.'], ['a/(b c)', 'a', 'not an extglob'], ['a/(b c)/d', 'a/(b c)', 'not an extglob'], ['path/to/*.js', 'path/to'], ['/root/path/to/*.js', '/root/path/to'], ['chapter/foo [bar]/', 'chapter'], ['path/[a-z]', 'path'], ['path/{to,from}', 'path'], ['path/(to|from)', 'path'], //['path/(foo bar)/subdir/foo.*', 'path/(foo bar)/subdir'], ['path/!(to|from)', 'path'], ['path/?(to|from)', 'path'], ['path/+(to|from)', 'path'], ['path/*(to|from)', 'path'], ['path/@(to|from)', 'path'], ['path/!/foo', 'path/!'], ['path/?/foo', 'path/?'], ['path/+/foo', 'path/+'], ['path/*/foo', 'path'], ['path/@/foo', 'path/@'], ['path/!/foo/', 'path/!'], ['path/?/foo/', 'path/?'], ['path/+/foo/', 'path/+'], ['path/*/foo/', 'path'], //['path/@/foo/', 'path/@/foo'], ['path/**/*', 'path'], ['path/**/subdir/foo.*', 'path'], ['path/subdir/**/foo.js', 'path/subdir'], ['path/!subdir/foo.js', 'path/!subdir'], // should respect escaped characters ['path/\\*\\*/subdir/foo.*', 'path/**/subdir'], ['path/\\[\\*\\]/subdir/foo.*', 'path/[*]/subdir'], ['path/\\*(a|b)/subdir/foo.*', 'path'], ['path/\\*/(a|b)/subdir/foo.*', 'path/*'], ['path/\\*\\(a\\|b\\)/subdir/foo.*', 'path/*(a|b)/subdir'], ['path/\\[foo bar\\]/subdir/foo.*', 'path/[foo bar]/subdir'], ['path/\\[bar]/', 'path'], ['path/foo \\[bar]/', 'path'], // should return parent dirname from non-glob paths ['path', '.'],, ['path/foo', 'path'], ['path/foo/', 'path'], ['path/foo/bar.js', 'path/foo'], ['path', '.'], ['path/foo', 'path'], ['path/foo/', 'path'], ['path/foo/bar.js', 'path/foo'], // glob2base test patterns ['js/*.js', 'js'], ['js/**/test/*.js', 'js'], ['js/test/wow.js', 'js/test'], ['js/test/wow.js', 'js/test'], ['js/t[a-z]st}/*.js', 'js'], ['js/{src,test}/*.js', 'js'], ['js/test{0..9}/*.js', 'js'], ['js/t+(wo|est)/*.js', 'js'], ['js/t(wo|est)/*.js', 'js'], ['js/t/(wo|est)/*.js', 'js/t'], // should get a base name from a complex brace glob ['lib/{components,pages}/**/{test,another}/*.txt', 'lib'], ['js/test/**/{images,components}/*.js', 'js/test'], ['ooga/{booga,sooga}/**/dooga/{eooga,fooga}', 'ooga'] ].forEach(([x, y]) => { t.is($(x).base, y); }); t.end(); }); test('glob', t => { [ ['', ''], ['*', '*'], ['.*', '.*'], ['/.*', '.*'], ['path/**/*', '**/*'], ['/path/**/*', '**/*'], ['root/(foo|bar)/path/**/*', '(foo|bar)/path/**/*'], ['@(test)/root/(foo|bar)/path/**/*', '@(test)/root/(foo|bar)/path/**/*'], ].forEach(([x, y]) => { t.is($(x).glob, y); }); t.end(); }) test('isGlob', t => { // should be true if it is a glob pattern ['*.js', '!*.js', '!foo', '!foo.js', '**/abc.js', 'abc/*.js', '@.(?:abc)', '@.(?!abc)'].forEach(x => { t.true($(x).isGlob); }); // should not match escaped globs ['\\!\\*.js', '\\!foo', '\\!foo.js', '\\*(foo).js', '\\*.js', '\\*\\*/abc.js', 'abc/\\*.js'].forEach(x => { t.false($(x).isGlob); }); // should be false if it is not a glob pattern ['', '~/abc', '~/abc', '~/(abc)', '+~(abc)', '.', '@.(abc)', 'aa', 'who?', 'why!?', 'where???', 'abc!/def/!ghi.js', 'abc.js', 'abc/def/!ghi.js', 'abc/def/ghi.js'].forEach(x => { t.false($(x).isGlob); }); // should be true if the path has a regex capture group ['abc/(?!foo).js', 'abc/(?:foo).js', 'abc/(?=foo).js', 'abc/(a|b).js', 'abc/(a|b|c).js', 'abc/(foo bar)/*.js'].forEach(x => { t.true($(x).isGlob); }); // should be true if the path has parens but is not a valid capture group ['abc/(?foo).js', 'abc/(a b c).js', 'abc/(ab).js', 'abc/(abc).js', 'abc/(foo bar).js'].forEach(x => { //t.true($(x).isGlob); }); // should be false if the capture group is imbalanced ['abc/(?ab.js', 'abc/(ab.js', 'abc/(a|b.js', 'abc/(a|b|c.js'].forEach(x => { t.false($(x).isGlob); }); // should be false if the group is escaped ['abc/\\(a|b).js', 'abc/\\(a|b|c).js'].forEach(x => { t.false($(x).isGlob); }); // should be true if glob chars exist and `options.strict` is false [ '$(abc)', '&(abc)', '? (abc)', '?.js', 'abc/(?ab.js', 'abc/(ab.js', 'abc/(a|b.js', 'abc/(a|b|c.js', 'abc/(foo).js', 'abc/?.js', 'abc/[1-3.js', 'abc/[^abc.js', 'abc/[abc.js', 'abc/foo?.js', 'abc/{abc.js', 'Who?.js' ].forEach(x => { t.true($(x, {strict: false}).isGlob); }); // should be false if the first delim is escaped and options.strict is false [ ['abc/\\(a|b).js'], ['abc/(a|b\\).js', true], ['abc/\\(a|b|c).js'], ['abc/\\(a|b|c.js'], ['abc/\\[abc].js'], ['abc/\\[abc.js'] ].forEach(([x, y]) => { t.false($(x, {strict: y || false}).isGlob); }); t.true($('abc/(a|b\\).js', {strict: false})); // should be true if the path has a regex character class ['abc/[abc].js', 'abc/[^abc].js', 'abc/[1-3].js'].forEach(x => { t.true($(x).isGlob); }); // should be false if the character class is not balanced ['abc/[abc.js', 'abc/[^abc.js', 'abc/[1-3.js'].forEach(x => { t.false($(x).isGlob); }); // should be false if the character class is escaped ['abc/\\[abc].js', 'abc/\\[^abc].js', 'abc/\\[1-3].js'].forEach(x => { t.false($(x).isGlob); }); // should be true if the path has brace characters ['abc/{a,b}.js', 'abc/{a..z}.js', 'abc/{a..z..2}.js'].forEach(x => { t.true($(x).isGlob); }); // should be false if (basic) braces are not balanced ['abc/\\{a,b}.js', 'abc/\\{a..z}.js', 'abc/\\{a..z..2}.js'].forEach(x => { t.false($(x).isGlob); }); // should not be true if the path has regex characters ['$(abc)', '&(abc)', 'Who?.js', '? (abc)', '?.js', 'abc/?.js'].forEach(x => { t.false($(x).isGlob); }); [ '!&(abc)', '!*.js', '!foo', '!foo.js', '**/abc.js', '*.js', '*z(abc)', '[1-10].js', '[^abc].js', '[a-j]*[^c]b/c', '[abc].js', 'a/b/c/[a-z].js', 'abc/(aaa|bbb).js', 'abc/*.js', 'abc/{a,b}.js', 'abc/{a..z..2}.js', 'abc/{a..z}.js' ].forEach(x => { t.true($(x).isGlob); }); // should be false if regex characters are escaped [ '\\?.js', '\\[1-10\\].js', '\\[^abc\\].js', '\\[a-j\\]\\*\\[^c\\]b/c', '\\[abc\\].js', '\\a/b/c/\\[a-z\\].js', 'abc/\\(aaa|bbb).js', 'abc/\\?.js' ].forEach(x => { t.false($(x).isGlob); }); // should be true if it has an extglob [ 'abc/!(a).js', 'abc/!(a|b).js', 'abc/(ab)*.js', 'abc/(a|b).js', 'abc/*(a).js', 'abc/*(a|b).js', 'abc/+(a).js', 'abc/+(a|b).js', 'abc/?(a).js', 'abc/?(a|b).js', 'abc/@(a).js', 'abc/@(a|b).js' ].forEach(x => { t.true($(x).isGlob); }); // should be false if extglob characters are escaped [ 'abc/\\*.js', 'abc/\\*\\*.js', 'abc/\\@(a).js', 'abc/\\!(a).js', 'abc/\\+(a).js', 'abc/\\*(a).js', 'abc/\\?(a).js' ].forEach(x => { t.false($(x).isGlob); }); [ 'abc/\\@(a|b).js', 'abc/\\!(a|b).js', 'abc/\\+(a|b).js', 'abc/\\*(a|b).js', 'abc/\\?(a|b).js', 'abc/\\@(a\\|b).js', 'abc/\\!(a\\|b).js', 'abc/\\+(a\\|b).js', 'abc/\\*(a\\|b).js', 'abc/\\?(a\\|b).js' ].forEach(x => { t.true($(x).isGlob); }); // should not return true for non-extglob parens t.false($('C:/Program Files (x86)/').isGlob); // should be true if it has glob characters and is not a valid path ['abc/[*].js', 'abc/*.js'].forEach(x => t.true($(x).isGlob)); // should be false if it is a valid non-glob path [ 'abc/?.js', 'abc/!.js', 'abc/@.js', 'abc/+.js' ].forEach(x => { t.false($(x).isGlob); }); // should return true when the string has an extglob [ '?(abc)', '@(abc)', '!(abc)', '*(abc)', '+(abc)', 'xyz/?(abc)/xyz', 'xyz/@(abc)/xyz', 'xyz/!(abc)/xyz', 'xyz/*(abc)/xyz', 'xyz/+(abc)/xyz', '?(abc|xyz)/xyz', '@(abc|xyz)', '!(abc|xyz)', '*(abc|xyz)', '+(abc|xyz)' ].forEach(x => { t.true($(x).isGlob); }); // should not match escaped extglobs [ '\\?(abc)', '\\@(abc)', '\\!(abc)', '\\*(abc)', '\\+(abc)', 'xyz/\\?(abc)/xyz', 'xyz/\\@(abc)/xyz', 'xyz/\\!(abc)/xyz', 'xyz/\\*(abc)/xyz', 'xyz/\\+(abc)/xyz' ].forEach(x => { t.false($(x).isGlob); }); // should detect when an glob is in the same pattern as an escaped glob [ '\\?(abc|xyz)/xyz', '\\@(abc|xyz)', '\\!(abc|xyz)', '\\*(abc|xyz)', '\\+(abc|xyz)', '\\?(abc)/?(abc)', '\\@(abc)/@(abc)', '\\!(abc)/!(abc)', '\\*(abc)/*(abc)', '\\+(abc)/+(abc)', 'xyz/\\?(abc)/xyz/def/?(abc)/xyz', 'xyz/\\@(abc)/xyz/def/@(abc)/xyz', 'xyz/\\!(abc)/xyz/def/!(abc)/xyz', 'xyz/\\*(abc)/xyz/def/*(abc)/xyz', 'xyz/\\+(abc)/xyz/def/+(abc)/xyz', '\\?(abc|xyz)/xyz/?(abc|xyz)/xyz', '\\@(abc|xyz)/@(abc|xyz)', '\\!(abc|xyz)/!(abc|xyz)', '\\*(abc|xyz)/*(abc|xyz)', '\\+(abc|xyz)/+(abc|xyz)' ].forEach(x => { t.true($(x).isGlob); }); t.end(); });