jass-vue 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +43 -0
  4. data/lib/jass/vue.rb +12 -0
  5. data/lib/jass/vue/version.rb +5 -0
  6. data/vendor/node_modules/arr-diff/index.js +58 -0
  7. data/vendor/node_modules/arr-diff/package.json +49 -0
  8. data/vendor/node_modules/arr-flatten/index.js +22 -0
  9. data/vendor/node_modules/arr-flatten/package.json +76 -0
  10. data/vendor/node_modules/array-unique/index.js +28 -0
  11. data/vendor/node_modules/array-unique/package.json +37 -0
  12. data/vendor/node_modules/braces/index.js +399 -0
  13. data/vendor/node_modules/braces/package.json +83 -0
  14. data/vendor/node_modules/de-indent/index.js +45 -0
  15. data/vendor/node_modules/de-indent/package.json +25 -0
  16. data/vendor/node_modules/de-indent/test.js +30 -0
  17. data/vendor/node_modules/estree-walker/dist/estree-walker.es.js +55 -0
  18. data/vendor/node_modules/estree-walker/dist/estree-walker.es6.js +59 -0
  19. data/vendor/node_modules/estree-walker/dist/estree-walker.umd.js +65 -0
  20. data/vendor/node_modules/estree-walker/package.json +33 -0
  21. data/vendor/node_modules/estree-walker/src/estree-walker.js +49 -0
  22. data/vendor/node_modules/expand-brackets/index.js +163 -0
  23. data/vendor/node_modules/expand-brackets/package.json +62 -0
  24. data/vendor/node_modules/expand-range/index.js +43 -0
  25. data/vendor/node_modules/expand-range/package.json +73 -0
  26. data/vendor/node_modules/extglob/index.js +178 -0
  27. data/vendor/node_modules/extglob/package.json +60 -0
  28. data/vendor/node_modules/filename-regex/index.js +10 -0
  29. data/vendor/node_modules/filename-regex/package.json +50 -0
  30. data/vendor/node_modules/fill-range/index.js +408 -0
  31. data/vendor/node_modules/fill-range/package.json +61 -0
  32. data/vendor/node_modules/for-in/index.js +16 -0
  33. data/vendor/node_modules/for-in/package.json +68 -0
  34. data/vendor/node_modules/for-own/index.js +19 -0
  35. data/vendor/node_modules/for-own/package.json +70 -0
  36. data/vendor/node_modules/glob-base/index.js +51 -0
  37. data/vendor/node_modules/glob-base/package.json +52 -0
  38. data/vendor/node_modules/glob-parent/index.js +10 -0
  39. data/vendor/node_modules/glob-parent/package.json +35 -0
  40. data/vendor/node_modules/glob-parent/test.js +28 -0
  41. data/vendor/node_modules/he/bin/he +148 -0
  42. data/vendor/node_modules/he/he.js +342 -0
  43. data/vendor/node_modules/he/man/he.1 +78 -0
  44. data/vendor/node_modules/he/package.json +56 -0
  45. data/vendor/node_modules/is-buffer/index.js +21 -0
  46. data/vendor/node_modules/is-buffer/package.json +51 -0
  47. data/vendor/node_modules/is-dotfile/index.js +14 -0
  48. data/vendor/node_modules/is-dotfile/package.json +69 -0
  49. data/vendor/node_modules/is-equal-shallow/index.js +27 -0
  50. data/vendor/node_modules/is-equal-shallow/package.json +54 -0
  51. data/vendor/node_modules/is-extendable/index.js +13 -0
  52. data/vendor/node_modules/is-extendable/package.json +51 -0
  53. data/vendor/node_modules/is-extglob/index.js +11 -0
  54. data/vendor/node_modules/is-extglob/package.json +48 -0
  55. data/vendor/node_modules/is-glob/index.js +14 -0
  56. data/vendor/node_modules/is-glob/package.json +60 -0
  57. data/vendor/node_modules/is-number/index.js +19 -0
  58. data/vendor/node_modules/is-number/package.json +59 -0
  59. data/vendor/node_modules/is-posix-bracket/index.js +10 -0
  60. data/vendor/node_modules/is-posix-bracket/package.json +64 -0
  61. data/vendor/node_modules/is-primitive/index.js +13 -0
  62. data/vendor/node_modules/is-primitive/package.json +46 -0
  63. data/vendor/node_modules/isarray/index.js +5 -0
  64. data/vendor/node_modules/isarray/package.json +45 -0
  65. data/vendor/node_modules/isarray/test.js +20 -0
  66. data/vendor/node_modules/isobject/index.js +14 -0
  67. data/vendor/node_modules/isobject/package.json +67 -0
  68. data/vendor/node_modules/kind-of/index.js +116 -0
  69. data/vendor/node_modules/kind-of/package.json +90 -0
  70. data/vendor/node_modules/magic-string/dist/magic-string.cjs.js +1287 -0
  71. data/vendor/node_modules/magic-string/dist/magic-string.es.js +1283 -0
  72. data/vendor/node_modules/magic-string/dist/magic-string.umd.js +1339 -0
  73. data/vendor/node_modules/magic-string/package.json +60 -0
  74. data/vendor/node_modules/magic-string/src/Bundle.js +263 -0
  75. data/vendor/node_modules/magic-string/src/Chunk.js +154 -0
  76. data/vendor/node_modules/magic-string/src/MagicString.js +618 -0
  77. data/vendor/node_modules/magic-string/src/index-legacy.js +6 -0
  78. data/vendor/node_modules/magic-string/src/index.js +4 -0
  79. data/vendor/node_modules/magic-string/src/utils/Mappings.js +117 -0
  80. data/vendor/node_modules/magic-string/src/utils/SourceMap.js +21 -0
  81. data/vendor/node_modules/magic-string/src/utils/Stats.js +18 -0
  82. data/vendor/node_modules/magic-string/src/utils/btoa.js +13 -0
  83. data/vendor/node_modules/magic-string/src/utils/getLocator.js +35 -0
  84. data/vendor/node_modules/magic-string/src/utils/getRelativePath.js +18 -0
  85. data/vendor/node_modules/magic-string/src/utils/guessIndent.js +25 -0
  86. data/vendor/node_modules/magic-string/src/utils/hasOwnProp.js +1 -0
  87. data/vendor/node_modules/magic-string/src/utils/isObject.js +5 -0
  88. data/vendor/node_modules/micromatch/index.js +431 -0
  89. data/vendor/node_modules/micromatch/lib/chars.js +67 -0
  90. data/vendor/node_modules/micromatch/lib/expand.js +304 -0
  91. data/vendor/node_modules/micromatch/lib/glob.js +193 -0
  92. data/vendor/node_modules/micromatch/lib/utils.js +149 -0
  93. data/vendor/node_modules/micromatch/package.json +114 -0
  94. data/vendor/node_modules/normalize-path/index.js +19 -0
  95. data/vendor/node_modules/normalize-path/package.json +78 -0
  96. data/vendor/node_modules/object.omit/index.js +40 -0
  97. data/vendor/node_modules/object.omit/package.json +67 -0
  98. data/vendor/node_modules/parse-glob/index.js +156 -0
  99. data/vendor/node_modules/parse-glob/package.json +62 -0
  100. data/vendor/node_modules/preserve/index.js +54 -0
  101. data/vendor/node_modules/preserve/package.json +48 -0
  102. data/vendor/node_modules/preserve/test.js +48 -0
  103. data/vendor/node_modules/randomatic/index.js +82 -0
  104. data/vendor/node_modules/randomatic/node_modules/is-number/index.js +22 -0
  105. data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/index.js +116 -0
  106. data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/package.json +90 -0
  107. data/vendor/node_modules/randomatic/node_modules/is-number/package.json +83 -0
  108. data/vendor/node_modules/randomatic/node_modules/kind-of/index.js +119 -0
  109. data/vendor/node_modules/randomatic/node_modules/kind-of/package.json +90 -0
  110. data/vendor/node_modules/randomatic/package.json +78 -0
  111. data/vendor/node_modules/regex-cache/index.js +68 -0
  112. data/vendor/node_modules/regex-cache/package.json +64 -0
  113. data/vendor/node_modules/remove-trailing-separator/index.js +17 -0
  114. data/vendor/node_modules/remove-trailing-separator/package.json +37 -0
  115. data/vendor/node_modules/repeat-element/index.js +18 -0
  116. data/vendor/node_modules/repeat-element/package.json +44 -0
  117. data/vendor/node_modules/repeat-string/index.js +70 -0
  118. data/vendor/node_modules/repeat-string/package.json +77 -0
  119. data/vendor/node_modules/rollup-plugin-vue2/dist/rollup-plugin-vue2.common.js +164 -0
  120. data/vendor/node_modules/rollup-plugin-vue2/dist/rollup-plugin-vue2.es.js +160 -0
  121. data/vendor/node_modules/rollup-plugin-vue2/package.json +50 -0
  122. data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.cjs.js +223 -0
  123. data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es.js +214 -0
  124. data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es6.js +217 -0
  125. data/vendor/node_modules/rollup-pluginutils/package.json +40 -0
  126. data/vendor/node_modules/rollup-pluginutils/src/addExtension.js +6 -0
  127. data/vendor/node_modules/rollup-pluginutils/src/attachScopes.js +147 -0
  128. data/vendor/node_modules/rollup-pluginutils/src/createFilter.js +33 -0
  129. data/vendor/node_modules/rollup-pluginutils/src/index.js +4 -0
  130. data/vendor/node_modules/rollup-pluginutils/src/makeLegalIdentifier.js +15 -0
  131. data/vendor/node_modules/rollup-pluginutils/src/utils/ensureArray.js +5 -0
  132. data/vendor/node_modules/vlq/dist/vlq.js +91 -0
  133. data/vendor/node_modules/vlq/package.json +27 -0
  134. data/vendor/node_modules/vlq/src/vlq.js +78 -0
  135. data/vendor/node_modules/vue-template-compiler/browser.js +5237 -0
  136. data/vendor/node_modules/vue-template-compiler/build.js +4835 -0
  137. data/vendor/node_modules/vue-template-compiler/index.js +18 -0
  138. data/vendor/node_modules/vue-template-compiler/package.json +27 -0
  139. data/vendor/node_modules/vue-template-es2015-compiler/buble.js +14112 -0
  140. data/vendor/node_modules/vue-template-es2015-compiler/index.js +24 -0
  141. data/vendor/node_modules/vue-template-es2015-compiler/package.json +28 -0
  142. data/vendor/package.json +9 -0
  143. data/vendor/yarn.lock +268 -0
  144. metadata +242 -0
@@ -0,0 +1,214 @@
1
+ import { extname, resolve, sep } from 'path';
2
+ import { walk } from 'estree-walker';
3
+ import mm from 'micromatch';
4
+
5
+ function addExtension ( filename, ext ) {
6
+ if ( ext === void 0 ) ext = '.js';
7
+
8
+ if ( !extname( filename ) ) { filename += ext; }
9
+ return filename;
10
+ }
11
+
12
+ var blockDeclarations = {
13
+ 'const': true,
14
+ 'let': true
15
+ };
16
+
17
+ var extractors = {
18
+ Identifier: function Identifier ( names, param ) {
19
+ names.push( param.name );
20
+ },
21
+
22
+ ObjectPattern: function ObjectPattern ( names, param ) {
23
+ param.properties.forEach( function (prop) {
24
+ extractors[ prop.key.type ]( names, prop.key );
25
+ });
26
+ },
27
+
28
+ ArrayPattern: function ArrayPattern ( names, param ) {
29
+ param.elements.forEach( function (element) {
30
+ if ( element ) { extractors[ element.type ]( names, element ); }
31
+ });
32
+ },
33
+
34
+ RestElement: function RestElement ( names, param ) {
35
+ extractors[ param.argument.type ]( names, param.argument );
36
+ },
37
+
38
+ AssignmentPattern: function AssignmentPattern ( names, param ) {
39
+ return extractors[ param.left.type ]( names, param.left );
40
+ }
41
+ };
42
+
43
+ function extractNames ( param ) {
44
+ var names = [];
45
+
46
+ extractors[ param.type ]( names, param );
47
+ return names;
48
+ }
49
+
50
+ var Scope = function Scope ( options ) {
51
+ var this$1 = this;
52
+
53
+ options = options || {};
54
+
55
+ this.parent = options.parent;
56
+ this.isBlockScope = !!options.block;
57
+
58
+ this.declarations = Object.create( null );
59
+
60
+ if ( options.params ) {
61
+ options.params.forEach( function (param) {
62
+ extractNames( param ).forEach( function (name) {
63
+ this$1.declarations[ name ] = true;
64
+ });
65
+ });
66
+ }
67
+ };
68
+
69
+ Scope.prototype.addDeclaration = function addDeclaration ( node, isBlockDeclaration, isVar ) {
70
+ var this$1 = this;
71
+
72
+ if ( !isBlockDeclaration && this.isBlockScope ) {
73
+ // it's a `var` or function node, and this
74
+ // is a block scope, so we need to go up
75
+ this.parent.addDeclaration( node, isBlockDeclaration, isVar );
76
+ } else {
77
+ extractNames( node.id ).forEach( function (name) {
78
+ this$1.declarations[ name ] = true;
79
+ });
80
+ }
81
+ };
82
+
83
+ Scope.prototype.contains = function contains ( name ) {
84
+ return this.declarations[ name ] ||
85
+ ( this.parent ? this.parent.contains( name ) : false );
86
+ };
87
+
88
+
89
+ function attachScopes ( ast, propertyName ) {
90
+ if ( propertyName === void 0 ) propertyName = 'scope';
91
+
92
+ var scope = new Scope();
93
+
94
+ walk( ast, {
95
+ enter: function enter ( node, parent ) {
96
+ // function foo () {...}
97
+ // class Foo {...}
98
+ if ( /(Function|Class)Declaration/.test( node.type ) ) {
99
+ scope.addDeclaration( node, false, false );
100
+ }
101
+
102
+ // var foo = 1
103
+ if ( node.type === 'VariableDeclaration' ) {
104
+ var isBlockDeclaration = blockDeclarations[ node.kind ];
105
+
106
+ node.declarations.forEach( function (declaration) {
107
+ scope.addDeclaration( declaration, isBlockDeclaration, true );
108
+ });
109
+ }
110
+
111
+ var newScope;
112
+
113
+ // create new function scope
114
+ if ( /Function/.test( node.type ) ) {
115
+ newScope = new Scope({
116
+ parent: scope,
117
+ block: false,
118
+ params: node.params
119
+ });
120
+
121
+ // named function expressions - the name is considered
122
+ // part of the function's scope
123
+ if ( node.type === 'FunctionExpression' && node.id ) {
124
+ newScope.addDeclaration( node, false, false );
125
+ }
126
+ }
127
+
128
+ // create new block scope
129
+ if ( node.type === 'BlockStatement' && !/Function/.test( parent.type ) ) {
130
+ newScope = new Scope({
131
+ parent: scope,
132
+ block: true
133
+ });
134
+ }
135
+
136
+ // catch clause has its own block scope
137
+ if ( node.type === 'CatchClause' ) {
138
+ newScope = new Scope({
139
+ parent: scope,
140
+ params: [ node.param ],
141
+ block: true
142
+ });
143
+ }
144
+
145
+ if ( newScope ) {
146
+ Object.defineProperty( node, propertyName, {
147
+ value: newScope,
148
+ configurable: true
149
+ });
150
+
151
+ scope = newScope;
152
+ }
153
+ },
154
+ leave: function leave ( node ) {
155
+ if ( node[ propertyName ] ) { scope = scope.parent; }
156
+ }
157
+ });
158
+
159
+ return scope;
160
+ }
161
+
162
+ function ensureArray ( thing ) {
163
+ if ( Array.isArray( thing ) ) { return thing; }
164
+ if ( thing == undefined ) { return []; }
165
+ return [ thing ];
166
+ }
167
+
168
+ function createFilter ( include, exclude ) {
169
+ var getMatcher = function (id) { return ( isRegexp( id ) ? id : { test: mm.matcher( resolve( id ) ) } ); };
170
+ include = ensureArray( include ).map( getMatcher );
171
+ exclude = ensureArray( exclude ).map( getMatcher );
172
+
173
+ return function ( id ) {
174
+
175
+ if ( typeof id !== 'string' ) { return false; }
176
+ if ( /\0/.test( id ) ) { return false; }
177
+
178
+ id = id.split( sep ).join( '/' );
179
+
180
+ for ( var i = 0; i < exclude.length; ++i ) {
181
+ var matcher = exclude[i];
182
+ if ( matcher.test( id ) ) { return false; }
183
+ }
184
+
185
+ for ( var i$1 = 0; i$1 < include.length; ++i$1 ) {
186
+ var matcher$1 = include[i$1];
187
+ if ( matcher$1.test( id ) ) { return true; }
188
+ }
189
+
190
+ return !include.length;
191
+ };
192
+ }
193
+
194
+ function isRegexp ( val ) {
195
+ return val instanceof RegExp;
196
+ }
197
+
198
+ var reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split( ' ' );
199
+ var builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split( ' ' );
200
+
201
+ var blacklisted = Object.create( null );
202
+ reservedWords.concat( builtins ).forEach( function (word) { return blacklisted[ word ] = true; } );
203
+
204
+ function makeLegalIdentifier ( str ) {
205
+ str = str
206
+ .replace( /-(\w)/g, function ( _, letter ) { return letter.toUpperCase(); } )
207
+ .replace( /[^$_a-zA-Z0-9]/g, '_' );
208
+
209
+ if ( /\d/.test( str[0] ) || blacklisted[ str ] ) { str = "_" + str; }
210
+
211
+ return str;
212
+ }
213
+
214
+ export { addExtension, attachScopes, createFilter, makeLegalIdentifier };
@@ -0,0 +1,217 @@
1
+ import { walk } from 'estree-walker';
2
+ import { sep, resolve } from 'path';
3
+ import { Minimatch } from 'minimatch';
4
+
5
+ function basename ( path ) {
6
+ return path.split( /(\/|\\)/ ).pop();
7
+ }
8
+
9
+ function extname ( path ) {
10
+ var match = /\.[^\.]+$/.exec( basename( path ) );
11
+ if ( !match ) return '';
12
+ return match[0];
13
+ }
14
+
15
+ function addExtension ( filename, ext ) {
16
+ if ( ext === void 0 ) ext = '.js';
17
+
18
+ if ( !extname( filename ) ) filename += ext;
19
+ return filename;
20
+ }
21
+
22
+ var blockDeclarations = {
23
+ 'const': true,
24
+ 'let': true
25
+ };
26
+
27
+ var extractors = {
28
+ Identifier: function Identifier ( names, param ) {
29
+ names.push( param.name );
30
+ },
31
+
32
+ ObjectPattern: function ObjectPattern ( names, param ) {
33
+ param.properties.forEach( function (prop) {
34
+ extractors[ prop.key.type ]( names, prop.key );
35
+ });
36
+ },
37
+
38
+ ArrayPattern: function ArrayPattern ( names, param ) {
39
+ param.elements.forEach( function (element) {
40
+ if ( element ) extractors[ element.type ]( names, element );
41
+ });
42
+ },
43
+
44
+ RestElement: function RestElement ( names, param ) {
45
+ extractors[ param.argument.type ]( names, param.argument );
46
+ },
47
+
48
+ AssignmentPattern: function AssignmentPattern ( names, param ) {
49
+ return extractors[ param.left.type ]( names, param.left );
50
+ }
51
+ };
52
+
53
+ function extractNames ( param ) {
54
+ var names = [];
55
+
56
+ extractors[ param.type ]( names, param );
57
+ return names;
58
+ }
59
+
60
+ var Scope = function Scope ( options ) {
61
+ var this$1 = this;
62
+
63
+ options = options || {};
64
+
65
+ this.parent = options.parent;
66
+ this.isBlockScope = !!options.block;
67
+
68
+ this.declarations = Object.create( null );
69
+
70
+ if ( options.params ) {
71
+ options.params.forEach( function (param) {
72
+ extractNames( param ).forEach( function (name) {
73
+ this$1.declarations[ name ] = true;
74
+ });
75
+ });
76
+ }
77
+ };
78
+
79
+ Scope.prototype.addDeclaration = function addDeclaration ( node, isBlockDeclaration, isVar ) {
80
+ var this$1 = this;
81
+
82
+ if ( !isBlockDeclaration && this.isBlockScope ) {
83
+ // it's a `var` or function node, and this
84
+ // is a block scope, so we need to go up
85
+ this.parent.addDeclaration( node, isBlockDeclaration, isVar );
86
+ } else {
87
+ extractNames( node.id ).forEach( function (name) {
88
+ this$1.declarations[ name ] = true;
89
+ });
90
+ }
91
+ };
92
+
93
+ Scope.prototype.contains = function contains ( name ) {
94
+ return this.declarations[ name ] ||
95
+ ( this.parent ? this.parent.contains( name ) : false );
96
+ };
97
+
98
+
99
+ function attachScopes ( ast, propertyName ) {
100
+ if ( propertyName === void 0 ) propertyName = 'scope';
101
+
102
+ var scope = new Scope();
103
+
104
+ walk( ast, {
105
+ enter: function enter ( node, parent ) {
106
+ // function foo () {...}
107
+ // class Foo {...}
108
+ if ( /(Function|Class)Declaration/.test( node.type ) ) {
109
+ scope.addDeclaration( node, false, false );
110
+ }
111
+
112
+ // var foo = 1
113
+ if ( node.type === 'VariableDeclaration' ) {
114
+ var isBlockDeclaration = blockDeclarations[ node.kind ];
115
+
116
+ node.declarations.forEach( function (declaration) {
117
+ scope.addDeclaration( declaration, isBlockDeclaration, true );
118
+ });
119
+ }
120
+
121
+ var newScope;
122
+
123
+ // create new function scope
124
+ if ( /Function/.test( node.type ) ) {
125
+ newScope = new Scope({
126
+ parent: scope,
127
+ block: false,
128
+ params: node.params
129
+ });
130
+
131
+ // named function expressions - the name is considered
132
+ // part of the function's scope
133
+ if ( node.type === 'FunctionExpression' && node.id ) {
134
+ newScope.addDeclaration( node, false, false );
135
+ }
136
+ }
137
+
138
+ // create new block scope
139
+ if ( node.type === 'BlockStatement' && !/Function/.test( parent.type ) ) {
140
+ newScope = new Scope({
141
+ parent: scope,
142
+ block: true
143
+ });
144
+ }
145
+
146
+ // catch clause has its own block scope
147
+ if ( node.type === 'CatchClause' ) {
148
+ newScope = new Scope({
149
+ parent: scope,
150
+ params: [ node.param ],
151
+ block: true
152
+ });
153
+ }
154
+
155
+ if ( newScope ) {
156
+ Object.defineProperty( node, propertyName, {
157
+ value: newScope,
158
+ configurable: true
159
+ });
160
+
161
+ scope = newScope;
162
+ }
163
+ },
164
+ leave: function leave ( node ) {
165
+ if ( node[ propertyName ] ) scope = scope.parent;
166
+ }
167
+ });
168
+
169
+ return scope;
170
+ }
171
+
172
+ function ensureArray ( thing ) {
173
+ if ( Array.isArray( thing ) ) return thing;
174
+ if ( thing == undefined ) return [];
175
+ return [ thing ];
176
+ }
177
+
178
+ function createFilter ( include, exclude ) {
179
+ include = ensureArray( include ).map( function (id) { return resolve( id ); } ).map( function (id) { return new Minimatch(id); } );
180
+ exclude = ensureArray( exclude ).map( function (id) { return resolve( id ); } ).map( function (id) { return new Minimatch(id); } );
181
+
182
+ return function ( id ) {
183
+ if ( typeof id !== 'string' ) return false;
184
+ if ( /\0/.test( id ) ) return false;
185
+
186
+ var included = !include.length;
187
+ id = id.split(sep).join('/');
188
+
189
+ include.forEach( function (minimatch) {
190
+ if ( minimatch.match( id ) ) included = true;
191
+ });
192
+
193
+ exclude.forEach( function (minimatch) {
194
+ if ( minimatch.match( id ) ) included = false;
195
+ });
196
+
197
+ return included;
198
+ };
199
+ }
200
+
201
+ var reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split( ' ' );
202
+ var builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split( ' ' );
203
+
204
+ var blacklisted = Object.create( null );
205
+ reservedWords.concat( builtins ).forEach( function (word) { return blacklisted[ word ] = true; } );
206
+
207
+ function makeLegalIdentifier ( str ) {
208
+ str = str
209
+ .replace( /-(\w)/g, function ( _, letter ) { return letter.toUpperCase(); } )
210
+ .replace( /[^$_a-zA-Z0-9]/g, '_' );
211
+
212
+ if ( /\d/.test( str[0] ) || blacklisted[ str ] ) str = "_" + str;
213
+
214
+ return str;
215
+ }
216
+
217
+ export { addExtension, attachScopes, createFilter, makeLegalIdentifier };
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "rollup-pluginutils",
3
+ "description": "Functionality commonly needed by Rollup plugins",
4
+ "version": "2.0.1",
5
+ "main": "dist/pluginutils.cjs.js",
6
+ "module": "dist/pluginutils.es.js",
7
+ "jsnext:main": "dist/pluginutils.es.js",
8
+ "files": [
9
+ "src",
10
+ "dist",
11
+ "README.md"
12
+ ],
13
+ "devDependencies": {
14
+ "eslint": "^3.12.2",
15
+ "mocha": "^3.2.0",
16
+ "rollup": "^0.40.0",
17
+ "rollup-plugin-buble": "^0.15.0"
18
+ },
19
+ "scripts": {
20
+ "test": "mocha",
21
+ "build": "rollup -c",
22
+ "pretest": "npm run build",
23
+ "prepublish": "npm test"
24
+ },
25
+ "dependencies": {
26
+ "estree-walker": "^0.3.0",
27
+ "micromatch": "^2.3.11"
28
+ },
29
+ "repository": "rollup/rollup-pluginutils",
30
+ "keywords": [
31
+ "rollup",
32
+ "utils"
33
+ ],
34
+ "author": "Rich Harris <richard.a.harris@gmail.com>",
35
+ "license": "MIT",
36
+ "bugs": {
37
+ "url": "https://github.com/rollup/rollup-pluginutils/issues"
38
+ },
39
+ "homepage": "https://github.com/rollup/rollup-pluginutils#readme"
40
+ }