1
- /* js-yaml 3.13.1 https://github.com/nodeca/js-yaml */ ( function ( f ) { if ( typeof exports === "object" && typeof module !== "undefined" ) { module . exports = f ( ) } else if ( typeof define === "function" && define . amd ) { define ( [ ] , f ) } else { var g ; if ( typeof window !== "undefined" ) { g = window } else if ( typeof global !== "undefined" ) { g = global } else if ( typeof self !== "undefined" ) { g = self } else { g = this } g . jsyaml = f ( ) } } ) ( function ( ) { var define , module , exports ; return ( function ( ) { function r ( e , n , t ) { function o ( i , f ) { if ( ! n [ i ] ) { if ( ! e [ i ] ) { var c = "function" == typeof require && require ; if ( ! f && c ) return c ( i , ! 0 ) ; if ( u ) return u ( i , ! 0 ) ; var a = new Error ( "Cannot find module '" + i + "'" ) ; throw a . code = "MODULE_NOT_FOUND" , a } var p = n [ i ] = { exports :{ } } ; e [ i ] [ 0 ] . call ( p . exports , function ( r ) { var n = e [ i ] [ 1 ] [ r ] ; return o ( n || r ) } , p , p . exports , r , e , n , t ) } return n [ i ] . exports } for ( var u = "function" == typeof require && require , i = 0 ; i < t . length ; i ++ ) o ( t [ i ] ) ; return o } return r } ) ( ) ( { 1 :[ function ( require , module , exports ) {
1
+ /* js-yaml 3.14.0 https://github.com/nodeca/js-yaml */ ( function ( f ) { if ( typeof exports === "object" && typeof module !== "undefined" ) { module . exports = f ( ) } else if ( typeof define === "function" && define . amd ) { define ( [ ] , f ) } else { var g ; if ( typeof window !== "undefined" ) { g = window } else if ( typeof global !== "undefined" ) { g = global } else if ( typeof self !== "undefined" ) { g = self } else { g = this } g . jsyaml = f ( ) } } ) ( function ( ) { var define , module , exports ; return ( function ( ) { function r ( e , n , t ) { function o ( i , f ) { if ( ! n [ i ] ) { if ( ! e [ i ] ) { var c = "function" == typeof require && require ; if ( ! f && c ) return c ( i , ! 0 ) ; if ( u ) return u ( i , ! 0 ) ; var a = new Error ( "Cannot find module '" + i + "'" ) ; throw a . code = "MODULE_NOT_FOUND" , a } var p = n [ i ] = { exports :{ } } ; e [ i ] [ 0 ] . call ( p . exports , function ( r ) { var n = e [ i ] [ 1 ] [ r ] ; return o ( n || r ) } , p , p . exports , r , e , n , t ) } return n [ i ] . exports } for ( var u = "function" == typeof require && require , i = 0 ; i < t . length ; i ++ ) o ( t [ i ] ) ; return o } return r } ) ( ) ( { 1 :[ function ( require , module , exports ) {
2
2
'use strict' ;
3
3
4
4
@@ -115,6 +115,7 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty;
115
115
116
116
var CHAR_TAB = 0x09 ; /* Tab */
117
117
var CHAR_LINE_FEED = 0x0A ; /* LF */
118
+ var CHAR_CARRIAGE_RETURN = 0x0D ; /* CR */
118
119
var CHAR_SPACE = 0x20 ; /* Space */
119
120
var CHAR_EXCLAMATION = 0x21 ; /* ! */
120
121
var CHAR_DOUBLE_QUOTE = 0x22 ; /* " */
@@ -126,6 +127,7 @@ var CHAR_ASTERISK = 0x2A; /* * */
126
127
var CHAR_COMMA = 0x2C ; /* , */
127
128
var CHAR_MINUS = 0x2D ; /* - */
128
129
var CHAR_COLON = 0x3A ; /* : */
130
+ var CHAR_EQUALS = 0x3D ; /* = */
129
131
var CHAR_GREATER_THAN = 0x3E ; /* > */
130
132
var CHAR_QUESTION = 0x3F ; /* ? */
131
133
var CHAR_COMMERCIAL_AT = 0x40 ; /* @ */
@@ -291,8 +293,23 @@ function isPrintable(c) {
291
293
|| ( 0x10000 <= c && c <= 0x10FFFF ) ;
292
294
}
293
295
296
+ // [34] ns-char ::= nb-char - s-white
297
+ // [27] nb-char ::= c-printable - b-char - c-byte-order-mark
298
+ // [26] b-char ::= b-line-feed | b-carriage-return
299
+ // [24] b-line-feed ::= #xA /* LF */
300
+ // [25] b-carriage-return ::= #xD /* CR */
301
+ // [3] c-byte-order-mark ::= #xFEFF
302
+ function isNsChar ( c ) {
303
+ return isPrintable ( c ) && ! isWhitespace ( c )
304
+ // byte-order-mark
305
+ && c !== 0xFEFF
306
+ // b-char
307
+ && c !== CHAR_CARRIAGE_RETURN
308
+ && c !== CHAR_LINE_FEED ;
309
+ }
310
+
294
311
// Simplified test for values allowed after the first character in plain style.
295
- function isPlainSafe ( c ) {
312
+ function isPlainSafe ( c , prev ) {
296
313
// Uses a subset of nb-char - c-flow-indicator - ":" - "#"
297
314
// where nb-char ::= c-printable - b-char - c-byte-order-mark.
298
315
return isPrintable ( c ) && c !== 0xFEFF
@@ -303,8 +320,9 @@ function isPlainSafe(c) {
303
320
&& c !== CHAR_LEFT_CURLY_BRACKET
304
321
&& c !== CHAR_RIGHT_CURLY_BRACKET
305
322
// - ":" - "#"
323
+ // /* An ns-char preceding */ "#"
306
324
&& c !== CHAR_COLON
307
- && c !== CHAR_SHARP ;
325
+ && ( ( c !== CHAR_SHARP ) || ( prev && isNsChar ( prev ) ) ) ;
308
326
}
309
327
310
328
// Simplified test for values allowed as the first character in plain style.
@@ -323,12 +341,13 @@ function isPlainSafeFirst(c) {
323
341
&& c !== CHAR_RIGHT_SQUARE_BRACKET
324
342
&& c !== CHAR_LEFT_CURLY_BRACKET
325
343
&& c !== CHAR_RIGHT_CURLY_BRACKET
326
- // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"”
344
+ // | “#” | “&” | “*” | “!” | “|” | “=” | “ >” | “'” | “"”
327
345
&& c !== CHAR_SHARP
328
346
&& c !== CHAR_AMPERSAND
329
347
&& c !== CHAR_ASTERISK
330
348
&& c !== CHAR_EXCLAMATION
331
349
&& c !== CHAR_VERTICAL_LINE
350
+ && c !== CHAR_EQUALS
332
351
&& c !== CHAR_GREATER_THAN
333
352
&& c !== CHAR_SINGLE_QUOTE
334
353
&& c !== CHAR_DOUBLE_QUOTE
@@ -359,7 +378,7 @@ var STYLE_PLAIN = 1,
359
378
// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
360
379
function chooseScalarStyle ( string , singleLineOnly , indentPerLevel , lineWidth , testAmbiguousType ) {
361
380
var i ;
362
- var char ;
381
+ var char , prev_char ;
363
382
var hasLineBreak = false ;
364
383
var hasFoldableLine = false ; // only checked if shouldTrackWidth
365
384
var shouldTrackWidth = lineWidth !== - 1 ;
@@ -375,7 +394,8 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te
375
394
if ( ! isPrintable ( char ) ) {
376
395
return STYLE_DOUBLE ;
377
396
}
378
- plain = plain && isPlainSafe ( char ) ;
397
+ prev_char = i > 0 ? string . charCodeAt ( i - 1 ) : null ;
398
+ plain = plain && isPlainSafe ( char , prev_char ) ;
379
399
}
380
400
} else {
381
401
// Case: block styles permitted.
@@ -394,7 +414,8 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te
394
414
} else if ( ! isPrintable ( char ) ) {
395
415
return STYLE_DOUBLE ;
396
416
}
397
- plain = plain && isPlainSafe ( char ) ;
417
+ prev_char = i > 0 ? string . charCodeAt ( i - 1 ) : null ;
418
+ plain = plain && isPlainSafe ( char , prev_char ) ;
398
419
}
399
420
// in case the end is missing a \n
400
421
hasFoldableLine = hasFoldableLine || ( shouldTrackWidth &&
@@ -651,10 +672,12 @@ function writeFlowMapping(state, level, object) {
651
672
pairBuffer ;
652
673
653
674
for ( index = 0 , length = objectKeyList . length ; index < length ; index += 1 ) {
654
- pairBuffer = state . condenseFlow ? '"' : '' ;
655
675
676
+ pairBuffer = '' ;
656
677
if ( index !== 0 ) pairBuffer += ', ' ;
657
678
679
+ if ( state . condenseFlow ) pairBuffer += '"' ;
680
+
658
681
objectKey = objectKeyList [ index ] ;
659
682
objectValue = object [ objectKey ] ;
660
683
@@ -2370,13 +2393,19 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact
2370
2393
2371
2394
if ( state . tag !== null && state . tag !== '!' ) {
2372
2395
if ( state . tag === '?' ) {
2396
+ // Implicit resolving is not allowed for non-scalar types, and '?'
2397
+ // non-specific tag is only automatically assigned to plain scalars.
2398
+ //
2399
+ // We only need to check kind conformity in case user explicitly assigns '?'
2400
+ // tag, for example like this: "!<?> [0]"
2401
+ //
2402
+ if ( state . result !== null && state . kind !== 'scalar' ) {
2403
+ throwError ( state , 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state . kind + '"' ) ;
2404
+ }
2405
+
2373
2406
for ( typeIndex = 0 , typeQuantity = state . implicitTypes . length ; typeIndex < typeQuantity ; typeIndex += 1 ) {
2374
2407
type = state . implicitTypes [ typeIndex ] ;
2375
2408
2376
- // Implicit resolving is not allowed for non-scalar types, and '?'
2377
- // non-specific tag is only assigned to plain scalars. So, it isn't
2378
- // needed to check for 'kind' conformity.
2379
-
2380
2409
if ( type . resolve ( state . result ) ) { // `state.result` updated in resolver if matched
2381
2410
state . result = type . construct ( state . result ) ;
2382
2411
state . tag = type . tag ;
@@ -2540,6 +2569,13 @@ function loadDocuments(input, options) {
2540
2569
2541
2570
var state = new State ( input , options ) ;
2542
2571
2572
+ var nullpos = input . indexOf ( '\0' ) ;
2573
+
2574
+ if ( nullpos !== - 1 ) {
2575
+ state . position = nullpos ;
2576
+ throwError ( state , 'null byte is not allowed in input' ) ;
2577
+ }
2578
+
2543
2579
// Use 0 as string terminator. That significantly simplifies bounds check.
2544
2580
state . input += '\0' ;
2545
2581
@@ -2557,13 +2593,18 @@ function loadDocuments(input, options) {
2557
2593
2558
2594
2559
2595
function loadAll ( input , iterator , options ) {
2560
- var documents = loadDocuments ( input , options ) , index , length ;
2596
+ if ( iterator !== null && typeof iterator === 'object' && typeof options === 'undefined' ) {
2597
+ options = iterator ;
2598
+ iterator = null ;
2599
+ }
2600
+
2601
+ var documents = loadDocuments ( input , options ) ;
2561
2602
2562
2603
if ( typeof iterator !== 'function' ) {
2563
2604
return documents ;
2564
2605
}
2565
2606
2566
- for ( index = 0 , length = documents . length ; index < length ; index += 1 ) {
2607
+ for ( var index = 0 , length = documents . length ; index < length ; index += 1 ) {
2567
2608
iterator ( documents [ index ] ) ;
2568
2609
}
2569
2610
}
@@ -2582,12 +2623,13 @@ function load(input, options) {
2582
2623
}
2583
2624
2584
2625
2585
- function safeLoadAll ( input , output , options ) {
2586
- if ( typeof output === 'function' ) {
2587
- loadAll ( input , output , common . extend ( { schema : DEFAULT_SAFE_SCHEMA } , options ) ) ;
2588
- } else {
2589
- return loadAll ( input , common . extend ( { schema : DEFAULT_SAFE_SCHEMA } , options ) ) ;
2626
+ function safeLoadAll ( input , iterator , options ) {
2627
+ if ( typeof iterator === 'object' && iterator !== null && typeof options === 'undefined' ) {
2628
+ options = iterator ;
2629
+ iterator = null ;
2590
2630
}
2631
+
2632
+ return loadAll ( input , iterator , common . extend ( { schema : DEFAULT_SAFE_SCHEMA } , options ) ) ;
2591
2633
}
2592
2634
2593
2635
@@ -3462,7 +3504,8 @@ try {
3462
3504
var _require = require ;
3463
3505
esprima = _require ( 'esprima' ) ;
3464
3506
} catch ( _ ) {
3465
- /*global window */
3507
+ /* eslint-disable no-redeclare */
3508
+ /* global window */
3466
3509
if ( typeof window !== 'undefined' ) esprima = window . esprima ;
3467
3510
}
3468
3511
0 commit comments