File tree Expand file tree Collapse file tree 8 files changed +6832
-15
lines changed Expand file tree Collapse file tree 8 files changed +6832
-15
lines changed Original file line number Diff line number Diff line change
1
+ # Javascript Node CircleCI 2.0 configuration file
2
+ #
3
+ # Check https://circleci.com/docs/2.0/language-javascript/ for more details
4
+ #
5
+ version : 2.1
6
+ jobs :
7
+ build :
8
+ docker :
9
+ # - image: circleci/node:8.9.4
10
+ - image : circleci/node:8.16.0
11
+
12
+ working_directory : ~/project
13
+
14
+ steps :
15
+ - checkout
16
+
17
+ # Download and cache dependencies
18
+ - restore_cache :
19
+ keys :
20
+ - deps-{{ checksum "package-lock.json" }}
21
+ # fallback to using the latest cache if no exact match is found
22
+ - deps-
23
+
24
+ - run : npm install
25
+
26
+ - save_cache :
27
+ paths :
28
+ - frontend/node_modules
29
+ key : deps-{{ checksum "package-lock.json" }}
30
+
31
+ # run tests
32
+ - run : npm run test-node
33
+ # run lint
34
+ - run : npm run jshint
Original file line number Diff line number Diff line change 1
1
{
2
2
"curly" : true ,
3
3
"latedef" : true ,
4
- "quotmark" : true ,
5
4
"undef" : true ,
6
5
"unused" : true ,
7
6
"trailing" : true ,
Original file line number Diff line number Diff line change 1
- var attrRE = / \s ( [ ^ ' " / \s > < ] + ?) [ \s / > ] | ( [ ^ \s = ] + ) = \s ? ( " .* ?" | ' .* ?' ) / g
1
+ var attrRE = / \s ( [ ^ ' " / \s > < ] + ?) [ \s / > ] | ( [ ^ \s = ] + ) = \s ? ( " .* ?" | ' .* ?' ) / g;
2
2
3
3
// create optimized lookup object for
4
4
// void elements as listed here:
@@ -30,40 +30,45 @@ module.exports = function (tag) {
30
30
children : [ ]
31
31
} ;
32
32
33
- let tagMatch = tag . match ( / < \/ ? ( [ ^ \s ] + ?) [ / \s > ] / )
33
+ var tagMatch = tag . match ( / < \/ ? ( [ ^ \s ] + ?) [ / \s > ] / ) ;
34
34
if ( tagMatch )
35
35
{
36
36
res . name = tagMatch [ 1 ] ;
37
- if ( lookup [ tagMatch [ 1 ] . toLowerCase ( ) ] || tag . charAt ( tag . length - 2 ) === '/' )
37
+ if ( lookup [ tagMatch [ 1 ] . toLowerCase ( ) ] || tag . charAt ( tag . length - 2 ) === '/' ) {
38
38
res . voidElement = true ;
39
+ }
39
40
40
41
}
41
42
42
- let reg = new RegExp ( attrRE )
43
- let result = null ;
43
+ var reg = new RegExp ( attrRE ) ;
44
+ var result = null ;
44
45
for ( ; ; )
45
46
{
46
47
result = reg . exec ( tag ) ;
47
48
48
- if ( result === null )
49
+ if ( result === null ) {
49
50
break ;
51
+ }
50
52
51
- if ( ! result [ 0 ] . trim ( ) )
53
+ if ( ! result [ 0 ] . trim ( ) ) {
52
54
continue ;
55
+ }
53
56
54
57
if ( result [ 1 ] )
55
58
{
56
- let attr = result [ 1 ] . trim ( ) ;
57
- let arr = [ attr , "" ] ;
59
+ var attr = result [ 1 ] . trim ( ) ;
60
+ var arr = [ attr , '' ] ;
58
61
59
- if ( attr . indexOf ( "=" ) > - 1 )
60
- arr = attr . split ( "=" ) ;
62
+ if ( attr . indexOf ( '=' ) > - 1 ) {
63
+ arr = attr . split ( '=' ) ;
64
+ }
61
65
62
66
res . attrs [ arr [ 0 ] ] = arr [ 1 ] ;
63
67
reg . lastIndex -- ;
64
68
}
65
- else if ( result [ 2 ] )
69
+ else if ( result [ 2 ] ) {
66
70
res . attrs [ result [ 2 ] ] = result [ 3 ] . trim ( ) . substring ( 1 , result [ 3 ] . length - 1 ) ;
71
+ }
67
72
}
68
73
69
74
return res ;
Original file line number Diff line number Diff line change 1
1
/*jshint -W030 */
2
- var tagRE = / < (?: " [ ^ " ] * " [ ' " ] * | ' [ ^ ' ] * ' [ ' " ] * | [ ^ ' " > ] ) + > / g;
2
+ var tagRE = / < [ a - z A - Z \- \! \/ ] (?: " [ ^ " ] * " [ ' " ] * | ' [ ^ ' ] * ' [ ' " ] * | [ ^ ' " > ] ) * > / g;
3
+
3
4
var parseTag = require ( './parse-tag' ) ;
4
5
// re-used obj for quick lookups of components
5
6
var empty = Object . create ? Object . create ( null ) : { } ;
You can’t perform that action at this time.
0 commit comments