pax_global_header00006660000000000000000000000064127023376300014515gustar00rootroot0000000000000052 comment=8962715152d8438fac975f90ac218017b41fea20 unc-path-regex-0.1.2/000077500000000000000000000000001270233763000143445ustar00rootroot00000000000000unc-path-regex-0.1.2/.editorconfig000066400000000000000000000006371270233763000170270ustar00rootroot00000000000000# http://editorconfig.org root = true [*] indent_style = space end_of_line = lf charset = utf-8 indent_size = 2 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false insert_final_newline = false [{,test/}{actual,fixtures}/**] trim_trailing_whitespace = false insert_final_newline = false [templates/**] trim_trailing_whitespace = false insert_final_newline = false unc-path-regex-0.1.2/.gitattributes000066400000000000000000000002001270233763000172270ustar00rootroot00000000000000# Enforce Unix newlines * text eol=lf # binaries *.ai binary *.psd binary *.jpg binary *.gif binary *.png binary *.jpeg binary unc-path-regex-0.1.2/.gitignore000066400000000000000000000002211270233763000163270ustar00rootroot00000000000000*.DS_Store *.sublime-* _gh_pages bower_components node_modules npm-debug.log actual test/actual temp tmp TODO.md vendor .idea benchmark coverage unc-path-regex-0.1.2/.jshintrc000066400000000000000000000004321270233763000161700ustar00rootroot00000000000000{ "asi": false, "boss": true, "curly": true, "eqeqeq": true, "eqnull": true, "esnext": true, "immed": true, "latedef": false, "laxcomma": false, "mocha": true, "newcap": true, "noarg": true, "node": true, "sub": true, "undef": true, "unused": true } unc-path-regex-0.1.2/.travis.yml000066400000000000000000000002271270233763000164560ustar00rootroot00000000000000sudo: false language: node_js node_js: - "0.10" - "0.12" - "0.13" - "iojs" matrix: fast_finish: true allow_failures: - node_js: "0.13" unc-path-regex-0.1.2/.verb.md000066400000000000000000000022541270233763000157050ustar00rootroot00000000000000# {%= name %} {%= badge("fury") %} {%= badge("travis") %} > {%= description %} Visit the MSDN reference for [Common Data Types 2.2.57 UNC](https://msdn.microsoft.com/en-us/library/gg465305.aspx) for more information about UNC paths. ## Install {%= include("install-npm", {save: true}) %} ## Usage ```js // unc-path-regex returns a function var regex = require('{%= name %}')(); ``` **true** Returns true for windows UNC paths: ```js regex.test('\\/foo/bar'); regex.test('\\\\foo/bar'); regex.test('\\\\foo\\admin$'); regex.test('\\\\foo\\admin$\\system32'); regex.test('\\\\foo\\temp'); regex.test('\\\\/foo/bar'); regex.test('\\\\\\/foo/bar'); ``` **false** Returns false for non-UNC paths: ```js regex.test('/foo/bar'); regex.test('/'); regex.test('/foo'); regex.test('/foo/'); regex.test('c:'); regex.test('c:.'); regex.test('c:./'); regex.test('c:./file'); regex.test('c:/'); regex.test('c:/file'); ``` ## Related projects {%= related(verb.related.list, {remove: name}) %} ## Running tests {%= include("tests") %} ## Contributing {%= include("contributing") %} ## Author {%= include("author") %} ## License {%= copyright() %} {%= license() %} *** {%= include("footer") %} unc-path-regex-0.1.2/LICENSE000066400000000000000000000020731270233763000153530ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2015, Jon Schlinkert. 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. unc-path-regex-0.1.2/README.md000066400000000000000000000050221270233763000156220ustar00rootroot00000000000000# unc-path-regex [![NPM version](https://badge.fury.io/js/unc-path-regex.svg)](http://badge.fury.io/js/unc-path-regex) [![Build Status](https://travis-ci.org/jonschlinkert/unc-path-regex.svg)](https://travis-ci.org/jonschlinkert/unc-path-regex) > Regular expression for testing if a file path is a windows UNC file path. Can also be used as a component of another regexp via the `.source` property. Visit the MSDN reference for [Common Data Types 2.2.57 UNC](https://msdn.microsoft.com/en-us/library/gg465305.aspx) for more information about UNC paths. ## Install Install with [npm](https://www.npmjs.com/) ```sh $ npm i unc-path-regex --save ``` ## Usage ```js // unc-path-regex returns a function var regex = require('unc-path-regex')(); ``` **true** Returns true for windows UNC paths: ```js regex.test('\\/foo/bar'); regex.test('\\\\foo/bar'); regex.test('\\\\foo\\admin$'); regex.test('\\\\foo\\admin$\\system32'); regex.test('\\\\foo\\temp'); regex.test('\\\\/foo/bar'); regex.test('\\\\\\/foo/bar'); ``` **false** Returns false for non-UNC paths: ```js regex.test('/foo/bar'); regex.test('/'); regex.test('/foo'); regex.test('/foo/'); regex.test('c:'); regex.test('c:.'); regex.test('c:./'); regex.test('c:./file'); regex.test('c:/'); regex.test('c:/file'); ``` ## Related projects * [dotfile-regex](https://github.com/regexps/dotfile-regex): Regular expresson for matching dotfiles. * [dotdir-regex](https://github.com/regexps/dotdir-regex): Regex for matching dot-directories, like `.git/` * [dirname-regex](https://github.com/regexps/dirname-regex): Regular expression for matching the directory part of a file path. * [is-unc-path](https://github.com/jonschlinkert/is-unc-path): Returns true if a filepath is a windows UNC file path. * [is-glob](https://github.com/jonschlinkert/is-glob): Returns `true` if the given string looks like a glob pattern. * [path-regex](https://github.com/regexps/path-regex): Regular expression for matching the parts of a file path. ## Running tests Install dev dependencies: ```sh $ npm i -d && npm test ``` ## Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/unc-path-regex/issues/new) ## Author **Jon Schlinkert** + [github/jonschlinkert](https://github.com/jonschlinkert) + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright © 2015 Jon Schlinkert Released under the MIT license. *** _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 07, 2015._unc-path-regex-0.1.2/index.js000066400000000000000000000001541270233763000160110ustar00rootroot00000000000000'use strict'; module.exports = function uncPathRegex() { return /^[\\\/]{2,}[^\\\/]+[\\\/]+[^\\\/]+/; }; unc-path-regex-0.1.2/package.json000066400000000000000000000022121270233763000166270ustar00rootroot00000000000000{ "name": "unc-path-regex", "description": "Regular expression for testing if a file path is a windows UNC file path. Can also be used as a component of another regexp via the `.source` property.", "version": "0.1.2", "homepage": "https://github.com/regexhq/unc-path-regex", "author": "Jon Schlinkert (https://github.com/jonschlinkert)", "repository": { "type" : "git", "url": "https://github.com/regexhq/unc-path-regex.git" }, "bugs": { "url": "https://github.com/regexhq/unc-path-regex/issues" }, "license": "MIT", "files": [ "index.js" ], "main": "index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha" }, "devDependencies": { "mocha": "*" }, "keywords": [ "absolute", "expression", "file", "filepath", "match", "matching", "path", "regex", "regexp", "regular", "unc", "win", "windows" ], "verb": { "related": { "list": [ "dotfile-regex", "is-unc-path", "unc-path-regex", "dotdir-regex", "path-regex", "dirname-regex", "is-glob" ] } } } unc-path-regex-0.1.2/test.js000066400000000000000000000020101270233763000156520ustar00rootroot00000000000000'use strict'; /* deps:mocha */ var assert = require('assert'); var regex = require('./'); function unc(str) { return regex().test(str); } describe('UNC path regex', function () { it('should return true for UNC paths', function () { assert.equal(unc('\\/foo/bar'), true); assert.equal(unc('\\\\foo/bar'), true); assert.equal(unc('\\\\foo\\admin$'), true); assert.equal(unc('\\\\foo\\admin$\\system32'), true); assert.equal(unc('\\\\foo\\temp'), true); assert.equal(unc('\\\\/foo/bar'), true); assert.equal(unc('\\\\\\/foo/bar'), true); }); it('should return false for non-UNC paths', function () { assert.equal(unc('/foo/bar'), false); assert.equal(unc('/'), false); assert.equal(unc('/foo'), false); assert.equal(unc('/foo/'), false); assert.equal(unc('c:'), false); assert.equal(unc('c:.'), false); assert.equal(unc('c:./'), false); assert.equal(unc('c:./file'), false); assert.equal(unc('c:/'), false); assert.equal(unc('c:/file'), false); }); });