jass-vue 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +43 -0
- data/lib/jass/vue.rb +12 -0
- data/lib/jass/vue/version.rb +5 -0
- data/vendor/node_modules/arr-diff/index.js +58 -0
- data/vendor/node_modules/arr-diff/package.json +49 -0
- data/vendor/node_modules/arr-flatten/index.js +22 -0
- data/vendor/node_modules/arr-flatten/package.json +76 -0
- data/vendor/node_modules/array-unique/index.js +28 -0
- data/vendor/node_modules/array-unique/package.json +37 -0
- data/vendor/node_modules/braces/index.js +399 -0
- data/vendor/node_modules/braces/package.json +83 -0
- data/vendor/node_modules/de-indent/index.js +45 -0
- data/vendor/node_modules/de-indent/package.json +25 -0
- data/vendor/node_modules/de-indent/test.js +30 -0
- data/vendor/node_modules/estree-walker/dist/estree-walker.es.js +55 -0
- data/vendor/node_modules/estree-walker/dist/estree-walker.es6.js +59 -0
- data/vendor/node_modules/estree-walker/dist/estree-walker.umd.js +65 -0
- data/vendor/node_modules/estree-walker/package.json +33 -0
- data/vendor/node_modules/estree-walker/src/estree-walker.js +49 -0
- data/vendor/node_modules/expand-brackets/index.js +163 -0
- data/vendor/node_modules/expand-brackets/package.json +62 -0
- data/vendor/node_modules/expand-range/index.js +43 -0
- data/vendor/node_modules/expand-range/package.json +73 -0
- data/vendor/node_modules/extglob/index.js +178 -0
- data/vendor/node_modules/extglob/package.json +60 -0
- data/vendor/node_modules/filename-regex/index.js +10 -0
- data/vendor/node_modules/filename-regex/package.json +50 -0
- data/vendor/node_modules/fill-range/index.js +408 -0
- data/vendor/node_modules/fill-range/package.json +61 -0
- data/vendor/node_modules/for-in/index.js +16 -0
- data/vendor/node_modules/for-in/package.json +68 -0
- data/vendor/node_modules/for-own/index.js +19 -0
- data/vendor/node_modules/for-own/package.json +70 -0
- data/vendor/node_modules/glob-base/index.js +51 -0
- data/vendor/node_modules/glob-base/package.json +52 -0
- data/vendor/node_modules/glob-parent/index.js +10 -0
- data/vendor/node_modules/glob-parent/package.json +35 -0
- data/vendor/node_modules/glob-parent/test.js +28 -0
- data/vendor/node_modules/he/bin/he +148 -0
- data/vendor/node_modules/he/he.js +342 -0
- data/vendor/node_modules/he/man/he.1 +78 -0
- data/vendor/node_modules/he/package.json +56 -0
- data/vendor/node_modules/is-buffer/index.js +21 -0
- data/vendor/node_modules/is-buffer/package.json +51 -0
- data/vendor/node_modules/is-dotfile/index.js +14 -0
- data/vendor/node_modules/is-dotfile/package.json +69 -0
- data/vendor/node_modules/is-equal-shallow/index.js +27 -0
- data/vendor/node_modules/is-equal-shallow/package.json +54 -0
- data/vendor/node_modules/is-extendable/index.js +13 -0
- data/vendor/node_modules/is-extendable/package.json +51 -0
- data/vendor/node_modules/is-extglob/index.js +11 -0
- data/vendor/node_modules/is-extglob/package.json +48 -0
- data/vendor/node_modules/is-glob/index.js +14 -0
- data/vendor/node_modules/is-glob/package.json +60 -0
- data/vendor/node_modules/is-number/index.js +19 -0
- data/vendor/node_modules/is-number/package.json +59 -0
- data/vendor/node_modules/is-posix-bracket/index.js +10 -0
- data/vendor/node_modules/is-posix-bracket/package.json +64 -0
- data/vendor/node_modules/is-primitive/index.js +13 -0
- data/vendor/node_modules/is-primitive/package.json +46 -0
- data/vendor/node_modules/isarray/index.js +5 -0
- data/vendor/node_modules/isarray/package.json +45 -0
- data/vendor/node_modules/isarray/test.js +20 -0
- data/vendor/node_modules/isobject/index.js +14 -0
- data/vendor/node_modules/isobject/package.json +67 -0
- data/vendor/node_modules/kind-of/index.js +116 -0
- data/vendor/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/magic-string/dist/magic-string.cjs.js +1287 -0
- data/vendor/node_modules/magic-string/dist/magic-string.es.js +1283 -0
- data/vendor/node_modules/magic-string/dist/magic-string.umd.js +1339 -0
- data/vendor/node_modules/magic-string/package.json +60 -0
- data/vendor/node_modules/magic-string/src/Bundle.js +263 -0
- data/vendor/node_modules/magic-string/src/Chunk.js +154 -0
- data/vendor/node_modules/magic-string/src/MagicString.js +618 -0
- data/vendor/node_modules/magic-string/src/index-legacy.js +6 -0
- data/vendor/node_modules/magic-string/src/index.js +4 -0
- data/vendor/node_modules/magic-string/src/utils/Mappings.js +117 -0
- data/vendor/node_modules/magic-string/src/utils/SourceMap.js +21 -0
- data/vendor/node_modules/magic-string/src/utils/Stats.js +18 -0
- data/vendor/node_modules/magic-string/src/utils/btoa.js +13 -0
- data/vendor/node_modules/magic-string/src/utils/getLocator.js +35 -0
- data/vendor/node_modules/magic-string/src/utils/getRelativePath.js +18 -0
- data/vendor/node_modules/magic-string/src/utils/guessIndent.js +25 -0
- data/vendor/node_modules/magic-string/src/utils/hasOwnProp.js +1 -0
- data/vendor/node_modules/magic-string/src/utils/isObject.js +5 -0
- data/vendor/node_modules/micromatch/index.js +431 -0
- data/vendor/node_modules/micromatch/lib/chars.js +67 -0
- data/vendor/node_modules/micromatch/lib/expand.js +304 -0
- data/vendor/node_modules/micromatch/lib/glob.js +193 -0
- data/vendor/node_modules/micromatch/lib/utils.js +149 -0
- data/vendor/node_modules/micromatch/package.json +114 -0
- data/vendor/node_modules/normalize-path/index.js +19 -0
- data/vendor/node_modules/normalize-path/package.json +78 -0
- data/vendor/node_modules/object.omit/index.js +40 -0
- data/vendor/node_modules/object.omit/package.json +67 -0
- data/vendor/node_modules/parse-glob/index.js +156 -0
- data/vendor/node_modules/parse-glob/package.json +62 -0
- data/vendor/node_modules/preserve/index.js +54 -0
- data/vendor/node_modules/preserve/package.json +48 -0
- data/vendor/node_modules/preserve/test.js +48 -0
- data/vendor/node_modules/randomatic/index.js +82 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/index.js +22 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/index.js +116 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/package.json +83 -0
- data/vendor/node_modules/randomatic/node_modules/kind-of/index.js +119 -0
- data/vendor/node_modules/randomatic/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/randomatic/package.json +78 -0
- data/vendor/node_modules/regex-cache/index.js +68 -0
- data/vendor/node_modules/regex-cache/package.json +64 -0
- data/vendor/node_modules/remove-trailing-separator/index.js +17 -0
- data/vendor/node_modules/remove-trailing-separator/package.json +37 -0
- data/vendor/node_modules/repeat-element/index.js +18 -0
- data/vendor/node_modules/repeat-element/package.json +44 -0
- data/vendor/node_modules/repeat-string/index.js +70 -0
- data/vendor/node_modules/repeat-string/package.json +77 -0
- data/vendor/node_modules/rollup-plugin-vue2/dist/rollup-plugin-vue2.common.js +164 -0
- data/vendor/node_modules/rollup-plugin-vue2/dist/rollup-plugin-vue2.es.js +160 -0
- data/vendor/node_modules/rollup-plugin-vue2/package.json +50 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.cjs.js +223 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es.js +214 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es6.js +217 -0
- data/vendor/node_modules/rollup-pluginutils/package.json +40 -0
- data/vendor/node_modules/rollup-pluginutils/src/addExtension.js +6 -0
- data/vendor/node_modules/rollup-pluginutils/src/attachScopes.js +147 -0
- data/vendor/node_modules/rollup-pluginutils/src/createFilter.js +33 -0
- data/vendor/node_modules/rollup-pluginutils/src/index.js +4 -0
- data/vendor/node_modules/rollup-pluginutils/src/makeLegalIdentifier.js +15 -0
- data/vendor/node_modules/rollup-pluginutils/src/utils/ensureArray.js +5 -0
- data/vendor/node_modules/vlq/dist/vlq.js +91 -0
- data/vendor/node_modules/vlq/package.json +27 -0
- data/vendor/node_modules/vlq/src/vlq.js +78 -0
- data/vendor/node_modules/vue-template-compiler/browser.js +5237 -0
- data/vendor/node_modules/vue-template-compiler/build.js +4835 -0
- data/vendor/node_modules/vue-template-compiler/index.js +18 -0
- data/vendor/node_modules/vue-template-compiler/package.json +27 -0
- data/vendor/node_modules/vue-template-es2015-compiler/buble.js +14112 -0
- data/vendor/node_modules/vue-template-es2015-compiler/index.js +24 -0
- data/vendor/node_modules/vue-template-es2015-compiler/package.json +28 -0
- data/vendor/package.json +9 -0
- data/vendor/yarn.lock +268 -0
- metadata +242 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
{
|
2
|
+
"name": "fill-range",
|
3
|
+
"description": "Fill in a range of numbers or letters, optionally passing an increment or multiplier to use.",
|
4
|
+
"version": "2.2.3",
|
5
|
+
"homepage": "https://github.com/jonschlinkert/fill-range",
|
6
|
+
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
7
|
+
"repository": "jonschlinkert/fill-range",
|
8
|
+
"bugs": {
|
9
|
+
"url": "https://github.com/jonschlinkert/fill-range/issues"
|
10
|
+
},
|
11
|
+
"license": "MIT",
|
12
|
+
"files": [
|
13
|
+
"index.js"
|
14
|
+
],
|
15
|
+
"main": "index.js",
|
16
|
+
"engines": {
|
17
|
+
"node": ">=0.10.0"
|
18
|
+
},
|
19
|
+
"scripts": {
|
20
|
+
"test": "mocha"
|
21
|
+
},
|
22
|
+
"dependencies": {
|
23
|
+
"is-number": "^2.1.0",
|
24
|
+
"isobject": "^2.0.0",
|
25
|
+
"randomatic": "^1.1.3",
|
26
|
+
"repeat-element": "^1.1.2",
|
27
|
+
"repeat-string": "^1.5.2"
|
28
|
+
},
|
29
|
+
"devDependencies": {
|
30
|
+
"benchmarked": "^0.1.3",
|
31
|
+
"chalk": "^0.5.1",
|
32
|
+
"should": "*"
|
33
|
+
},
|
34
|
+
"keywords": [
|
35
|
+
"alpha",
|
36
|
+
"alphabetical",
|
37
|
+
"bash",
|
38
|
+
"brace",
|
39
|
+
"expand",
|
40
|
+
"expansion",
|
41
|
+
"glob",
|
42
|
+
"match",
|
43
|
+
"matches",
|
44
|
+
"matching",
|
45
|
+
"number",
|
46
|
+
"numerical",
|
47
|
+
"range",
|
48
|
+
"ranges",
|
49
|
+
"sh"
|
50
|
+
],
|
51
|
+
"verb": {
|
52
|
+
"related": {
|
53
|
+
"list": [
|
54
|
+
"micromatch",
|
55
|
+
"expand-range",
|
56
|
+
"braces",
|
57
|
+
"is-glob"
|
58
|
+
]
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/*!
|
2
|
+
* for-in <https://github.com/jonschlinkert/for-in>
|
3
|
+
*
|
4
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
5
|
+
* Released under the MIT License.
|
6
|
+
*/
|
7
|
+
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
module.exports = function forIn(obj, fn, thisArg) {
|
11
|
+
for (var key in obj) {
|
12
|
+
if (fn.call(thisArg, obj[key], key, obj) === false) {
|
13
|
+
break;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
};
|
@@ -0,0 +1,68 @@
|
|
1
|
+
{
|
2
|
+
"name": "for-in",
|
3
|
+
"description": "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js",
|
4
|
+
"version": "1.0.2",
|
5
|
+
"homepage": "https://github.com/jonschlinkert/for-in",
|
6
|
+
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
7
|
+
"contributors": [
|
8
|
+
"Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)",
|
9
|
+
"Paul Irish (http://paulirish.com)"
|
10
|
+
],
|
11
|
+
"repository": "jonschlinkert/for-in",
|
12
|
+
"bugs": {
|
13
|
+
"url": "https://github.com/jonschlinkert/for-in/issues"
|
14
|
+
},
|
15
|
+
"license": "MIT",
|
16
|
+
"files": [
|
17
|
+
"index.js"
|
18
|
+
],
|
19
|
+
"main": "index.js",
|
20
|
+
"engines": {
|
21
|
+
"node": ">=0.10.0"
|
22
|
+
},
|
23
|
+
"scripts": {
|
24
|
+
"test": "mocha"
|
25
|
+
},
|
26
|
+
"devDependencies": {
|
27
|
+
"gulp-format-md": "^0.1.11",
|
28
|
+
"mocha": "^3.2.0"
|
29
|
+
},
|
30
|
+
"keywords": [
|
31
|
+
"for",
|
32
|
+
"for-in",
|
33
|
+
"for-own",
|
34
|
+
"has",
|
35
|
+
"has-own",
|
36
|
+
"hasOwn",
|
37
|
+
"in",
|
38
|
+
"key",
|
39
|
+
"keys",
|
40
|
+
"object",
|
41
|
+
"own",
|
42
|
+
"value"
|
43
|
+
],
|
44
|
+
"verb": {
|
45
|
+
"run": true,
|
46
|
+
"toc": false,
|
47
|
+
"layout": "default",
|
48
|
+
"tasks": [
|
49
|
+
"readme"
|
50
|
+
],
|
51
|
+
"plugins": [
|
52
|
+
"gulp-format-md"
|
53
|
+
],
|
54
|
+
"related": {
|
55
|
+
"list": [
|
56
|
+
"arr-flatten",
|
57
|
+
"collection-map",
|
58
|
+
"for-own"
|
59
|
+
]
|
60
|
+
},
|
61
|
+
"reflinks": [
|
62
|
+
"verb"
|
63
|
+
],
|
64
|
+
"lint": {
|
65
|
+
"reflinks": true
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/*!
|
2
|
+
* for-own <https://github.com/jonschlinkert/for-own>
|
3
|
+
*
|
4
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
5
|
+
* Released under the MIT License.
|
6
|
+
*/
|
7
|
+
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
var forIn = require('for-in');
|
11
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
12
|
+
|
13
|
+
module.exports = function forOwn(obj, fn, thisArg) {
|
14
|
+
forIn(obj, function(val, key) {
|
15
|
+
if (hasOwn.call(obj, key)) {
|
16
|
+
return fn.call(thisArg, obj[key], key, obj);
|
17
|
+
}
|
18
|
+
});
|
19
|
+
};
|
@@ -0,0 +1,70 @@
|
|
1
|
+
{
|
2
|
+
"name": "for-own",
|
3
|
+
"description": "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.",
|
4
|
+
"version": "0.1.5",
|
5
|
+
"homepage": "https://github.com/jonschlinkert/for-own",
|
6
|
+
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
7
|
+
"contributors": [
|
8
|
+
"Javier Cejudo <javier@javiercejudo.com> (https://www.javiercejudo.com)",
|
9
|
+
"Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)"
|
10
|
+
],
|
11
|
+
"repository": "jonschlinkert/for-own",
|
12
|
+
"bugs": {
|
13
|
+
"url": "https://github.com/jonschlinkert/for-own/issues"
|
14
|
+
},
|
15
|
+
"license": "MIT",
|
16
|
+
"files": [
|
17
|
+
"index.js"
|
18
|
+
],
|
19
|
+
"main": "index.js",
|
20
|
+
"engines": {
|
21
|
+
"node": ">=0.10.0"
|
22
|
+
},
|
23
|
+
"scripts": {
|
24
|
+
"test": "mocha"
|
25
|
+
},
|
26
|
+
"dependencies": {
|
27
|
+
"for-in": "^1.0.1"
|
28
|
+
},
|
29
|
+
"devDependencies": {
|
30
|
+
"gulp-format-md": "^0.1.11",
|
31
|
+
"mocha": "^3.2.0"
|
32
|
+
},
|
33
|
+
"keywords": [
|
34
|
+
"for",
|
35
|
+
"for-in",
|
36
|
+
"for-own",
|
37
|
+
"has",
|
38
|
+
"has-own",
|
39
|
+
"hasOwn",
|
40
|
+
"key",
|
41
|
+
"keys",
|
42
|
+
"object",
|
43
|
+
"own",
|
44
|
+
"value"
|
45
|
+
],
|
46
|
+
"verb": {
|
47
|
+
"run": true,
|
48
|
+
"toc": false,
|
49
|
+
"layout": "default",
|
50
|
+
"tasks": [
|
51
|
+
"readme"
|
52
|
+
],
|
53
|
+
"plugins": [
|
54
|
+
"gulp-format-md"
|
55
|
+
],
|
56
|
+
"related": {
|
57
|
+
"list": [
|
58
|
+
"arr-flatten",
|
59
|
+
"collection-map",
|
60
|
+
"for-in"
|
61
|
+
]
|
62
|
+
},
|
63
|
+
"reflinks": [
|
64
|
+
"verb"
|
65
|
+
],
|
66
|
+
"lint": {
|
67
|
+
"reflinks": true
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
/*!
|
2
|
+
* glob-base <https://github.com/jonschlinkert/glob-base>
|
3
|
+
*
|
4
|
+
* Copyright (c) 2015, Jon Schlinkert.
|
5
|
+
* Licensed under the MIT License.
|
6
|
+
*/
|
7
|
+
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
var path = require('path');
|
11
|
+
var parent = require('glob-parent');
|
12
|
+
var isGlob = require('is-glob');
|
13
|
+
|
14
|
+
module.exports = function globBase(pattern) {
|
15
|
+
if (typeof pattern !== 'string') {
|
16
|
+
throw new TypeError('glob-base expects a string.');
|
17
|
+
}
|
18
|
+
|
19
|
+
var res = {};
|
20
|
+
res.base = parent(pattern);
|
21
|
+
res.isGlob = isGlob(pattern);
|
22
|
+
|
23
|
+
if (res.base !== '.') {
|
24
|
+
res.glob = pattern.substr(res.base.length);
|
25
|
+
if (res.glob.charAt(0) === '/') {
|
26
|
+
res.glob = res.glob.substr(1);
|
27
|
+
}
|
28
|
+
} else {
|
29
|
+
res.glob = pattern;
|
30
|
+
}
|
31
|
+
|
32
|
+
if (!res.isGlob) {
|
33
|
+
res.base = dirname(pattern);
|
34
|
+
res.glob = res.base !== '.'
|
35
|
+
? pattern.substr(res.base.length)
|
36
|
+
: pattern;
|
37
|
+
}
|
38
|
+
|
39
|
+
if (res.glob.substr(0, 2) === './') {
|
40
|
+
res.glob = res.glob.substr(2);
|
41
|
+
}
|
42
|
+
if (res.glob.charAt(0) === '/') {
|
43
|
+
res.glob = res.glob.substr(1);
|
44
|
+
}
|
45
|
+
return res;
|
46
|
+
};
|
47
|
+
|
48
|
+
function dirname(glob) {
|
49
|
+
if (glob.slice(-1) === '/') return glob;
|
50
|
+
return path.dirname(glob);
|
51
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
{
|
2
|
+
"name": "glob-base",
|
3
|
+
"description": "Returns an object with the (non-glob) base path and the actual pattern.",
|
4
|
+
"version": "0.3.0",
|
5
|
+
"homepage": "https://github.com/jonschlinkert/glob-base",
|
6
|
+
"author": {
|
7
|
+
"name": "Jon Schlinkert",
|
8
|
+
"url": "https://github.com/jonschlinkert"
|
9
|
+
},
|
10
|
+
"repository": {
|
11
|
+
"type": "git",
|
12
|
+
"url": "git://github.com/jonschlinkert/glob-base.git"
|
13
|
+
},
|
14
|
+
"bugs": {
|
15
|
+
"url": "https://github.com/jonschlinkert/glob-base/issues"
|
16
|
+
},
|
17
|
+
"license": {
|
18
|
+
"type": "MIT",
|
19
|
+
"url": "https://github.com/jonschlinkert/glob-base/blob/master/LICENSE"
|
20
|
+
},
|
21
|
+
"files": [
|
22
|
+
"index.js"
|
23
|
+
],
|
24
|
+
"main": "index.js",
|
25
|
+
"engines": {
|
26
|
+
"node": ">=0.10.0"
|
27
|
+
},
|
28
|
+
"scripts": {
|
29
|
+
"test": "mocha"
|
30
|
+
},
|
31
|
+
"dependencies": {
|
32
|
+
"glob-parent": "^2.0.0",
|
33
|
+
"is-glob": "^2.0.0"
|
34
|
+
},
|
35
|
+
"devDependencies": {
|
36
|
+
"mocha": "*",
|
37
|
+
"should": "^5.1.0"
|
38
|
+
},
|
39
|
+
"keywords": [
|
40
|
+
"base",
|
41
|
+
"directory",
|
42
|
+
"dirname",
|
43
|
+
"expression",
|
44
|
+
"glob",
|
45
|
+
"parent",
|
46
|
+
"path",
|
47
|
+
"pattern",
|
48
|
+
"regex",
|
49
|
+
"regular",
|
50
|
+
"root"
|
51
|
+
]
|
52
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var path = require('path');
|
4
|
+
var isglob = require('is-glob');
|
5
|
+
|
6
|
+
module.exports = function globParent(str) {
|
7
|
+
str += 'a'; // preserves full path in case of trailing path separator
|
8
|
+
do {str = path.dirname(str)} while (isglob(str));
|
9
|
+
return str;
|
10
|
+
};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
{
|
2
|
+
"name": "glob-parent",
|
3
|
+
"version": "2.0.0",
|
4
|
+
"description": "Strips glob magic from a string to provide the parent path",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls"
|
8
|
+
},
|
9
|
+
"repository": {
|
10
|
+
"type": "git",
|
11
|
+
"url": "https://github.com/es128/glob-parent"
|
12
|
+
},
|
13
|
+
"keywords": [
|
14
|
+
"glob",
|
15
|
+
"parent",
|
16
|
+
"strip",
|
17
|
+
"path",
|
18
|
+
"directory",
|
19
|
+
"base"
|
20
|
+
],
|
21
|
+
"author": "Elan Shanker",
|
22
|
+
"license": "ISC",
|
23
|
+
"bugs": {
|
24
|
+
"url": "https://github.com/es128/glob-parent/issues"
|
25
|
+
},
|
26
|
+
"homepage": "https://github.com/es128/glob-parent",
|
27
|
+
"dependencies": {
|
28
|
+
"is-glob": "^2.0.0"
|
29
|
+
},
|
30
|
+
"devDependencies": {
|
31
|
+
"coveralls": "^2.11.2",
|
32
|
+
"istanbul": "^0.3.5",
|
33
|
+
"mocha": "^2.1.0"
|
34
|
+
}
|
35
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var gp = require('./');
|
4
|
+
var assert = require('assert');
|
5
|
+
|
6
|
+
describe('glob-parent', function() {
|
7
|
+
it('should strip glob magic to return parent path', function() {
|
8
|
+
assert.equal(gp('path/to/*.js'), 'path/to');
|
9
|
+
assert.equal(gp('/root/path/to/*.js'), '/root/path/to');
|
10
|
+
assert.equal(gp('/*.js'), '/');
|
11
|
+
assert.equal(gp('*.js'), '.');
|
12
|
+
assert.equal(gp('**/*.js'), '.');
|
13
|
+
assert.equal(gp('path/{to,from}'), 'path');
|
14
|
+
assert.equal(gp('path/!(to|from)'), 'path');
|
15
|
+
assert.equal(gp('path/?(to|from)'), 'path');
|
16
|
+
assert.equal(gp('path/+(to|from)'), 'path');
|
17
|
+
assert.equal(gp('path/*(to|from)'), 'path');
|
18
|
+
assert.equal(gp('path/@(to|from)'), 'path');
|
19
|
+
assert.equal(gp('path/**/*'), 'path');
|
20
|
+
assert.equal(gp('path/**/subdir/foo.*'), 'path');
|
21
|
+
});
|
22
|
+
|
23
|
+
it('should return parent dirname from non-glob paths', function() {
|
24
|
+
assert.equal(gp('path/foo/bar.js'), 'path/foo');
|
25
|
+
assert.equal(gp('path/foo/'), 'path/foo');
|
26
|
+
assert.equal(gp('path/foo'), 'path');
|
27
|
+
});
|
28
|
+
});
|
@@ -0,0 +1,148 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
(function() {
|
3
|
+
|
4
|
+
var fs = require('fs');
|
5
|
+
var he = require('../he.js');
|
6
|
+
var strings = process.argv.splice(2);
|
7
|
+
var stdin = process.stdin;
|
8
|
+
var data;
|
9
|
+
var timeout;
|
10
|
+
var action;
|
11
|
+
var options = {};
|
12
|
+
var log = console.log;
|
13
|
+
|
14
|
+
var main = function() {
|
15
|
+
var option = strings[0];
|
16
|
+
var count = 0;
|
17
|
+
|
18
|
+
if (/^(?:-h|--help|undefined)$/.test(option)) {
|
19
|
+
log(
|
20
|
+
'he v%s - https://mths.be/he',
|
21
|
+
he.version
|
22
|
+
);
|
23
|
+
log([
|
24
|
+
'\nUsage:\n',
|
25
|
+
'\the [--escape] string',
|
26
|
+
'\the [--encode] [--use-named-refs] [--everything] [--allow-unsafe] [--decimal] string',
|
27
|
+
'\the [--decode] [--attribute] [--strict] string',
|
28
|
+
'\the [-v | --version]',
|
29
|
+
'\the [-h | --help]',
|
30
|
+
'\nExamples:\n',
|
31
|
+
'\the --escape \\<img\\ src\\=\\\'x\\\'\\ onerror\\=\\"prompt\\(1\\)\\"\\>',
|
32
|
+
'\techo \'© 𝌆\' | he --decode'
|
33
|
+
].join('\n'));
|
34
|
+
return process.exit(option ? 0 : 1);
|
35
|
+
}
|
36
|
+
|
37
|
+
if (/^(?:-v|--version)$/.test(option)) {
|
38
|
+
log('v%s', he.version);
|
39
|
+
return process.exit(0);
|
40
|
+
}
|
41
|
+
|
42
|
+
strings.forEach(function(string) {
|
43
|
+
// Process options
|
44
|
+
if (string == '--escape') {
|
45
|
+
action = 'escape';
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
if (string == '--encode') {
|
49
|
+
action = 'encode';
|
50
|
+
return;
|
51
|
+
}
|
52
|
+
if (string == '--use-named-refs') {
|
53
|
+
action = 'encode';
|
54
|
+
options.useNamedReferences = true;
|
55
|
+
return;
|
56
|
+
}
|
57
|
+
if (string == '--everything') {
|
58
|
+
action = 'encode';
|
59
|
+
options.encodeEverything = true;
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
if (string == '--allow-unsafe') {
|
63
|
+
action = 'encode';
|
64
|
+
options.allowUnsafeSymbols = true;
|
65
|
+
return;
|
66
|
+
}
|
67
|
+
if (string == '--decimal') {
|
68
|
+
action = 'encode';
|
69
|
+
options.decimal = true;
|
70
|
+
return;
|
71
|
+
}
|
72
|
+
if (string == '--decode') {
|
73
|
+
action = 'decode';
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
if (string == '--attribute') {
|
77
|
+
action = 'decode';
|
78
|
+
options.isAttributeValue = true;
|
79
|
+
return;
|
80
|
+
}
|
81
|
+
if (string == '--strict') {
|
82
|
+
action = 'decode';
|
83
|
+
options.strict = true;
|
84
|
+
return;
|
85
|
+
}
|
86
|
+
// Process string(s)
|
87
|
+
var result;
|
88
|
+
if (!action) {
|
89
|
+
log('Error: he requires at least one option and a string argument.');
|
90
|
+
log('Try `he --help` for more information.');
|
91
|
+
return process.exit(1);
|
92
|
+
}
|
93
|
+
try {
|
94
|
+
result = he[action](string, options);
|
95
|
+
log(result);
|
96
|
+
count++;
|
97
|
+
} catch(error) {
|
98
|
+
log(error.message + '\n');
|
99
|
+
log('Error: failed to %s.', action);
|
100
|
+
log('If you think this is a bug in he, please report it:');
|
101
|
+
log('https://github.com/mathiasbynens/he/issues/new');
|
102
|
+
log(
|
103
|
+
'\nStack trace using he@%s:\n',
|
104
|
+
he.version
|
105
|
+
);
|
106
|
+
log(error.stack);
|
107
|
+
return process.exit(1);
|
108
|
+
}
|
109
|
+
});
|
110
|
+
if (!count) {
|
111
|
+
log('Error: he requires a string argument.');
|
112
|
+
log('Try `he --help` for more information.');
|
113
|
+
return process.exit(1);
|
114
|
+
}
|
115
|
+
// Return with exit status 0 outside of the `forEach` loop, in case
|
116
|
+
// multiple strings were passed in.
|
117
|
+
return process.exit(0);
|
118
|
+
};
|
119
|
+
|
120
|
+
if (stdin.isTTY) {
|
121
|
+
// handle shell arguments
|
122
|
+
main();
|
123
|
+
} else {
|
124
|
+
// Either the script is called from within a non-TTY context, or `stdin`
|
125
|
+
// content is being piped in.
|
126
|
+
if (!process.stdout.isTTY) {
|
127
|
+
// The script was called from a non-TTY context. This is a rather uncommon
|
128
|
+
// use case we don’t actively support. However, we don’t want the script
|
129
|
+
// to wait forever in such cases, so…
|
130
|
+
timeout = setTimeout(function() {
|
131
|
+
// …if no piped data arrived after a whole minute, handle shell
|
132
|
+
// arguments instead.
|
133
|
+
main();
|
134
|
+
}, 60000);
|
135
|
+
}
|
136
|
+
data = '';
|
137
|
+
stdin.on('data', function(chunk) {
|
138
|
+
clearTimeout(timeout);
|
139
|
+
data += chunk;
|
140
|
+
});
|
141
|
+
stdin.on('end', function() {
|
142
|
+
strings.push(data.trim());
|
143
|
+
main();
|
144
|
+
});
|
145
|
+
stdin.resume();
|
146
|
+
}
|
147
|
+
|
148
|
+
}());
|