Skip to content

Commit da8ecf2

Browse files
author
Vitaly Puzrin
committed
Browser files rebuild
1 parent b2f9e88 commit da8ecf2

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

dist/js-yaml.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* js-yaml 3.13.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){
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){
22
'use strict';
33

44

@@ -1007,6 +1007,8 @@ var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
10071007
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
10081008

10091009

1010+
function _class(obj) { return Object.prototype.toString.call(obj); }
1011+
10101012
function is_EOL(c) {
10111013
return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
10121014
}
@@ -1264,16 +1266,29 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu
12641266

12651267
// The output is a plain object here, so keys can only be strings.
12661268
// We need to convert keyNode to a string, but doing so can hang the process
1267-
// (deeply nested arrays that explode exponentially using aliases) or execute
1268-
// code via toString.
1269+
// (deeply nested arrays that explode exponentially using aliases).
12691270
if (Array.isArray(keyNode)) {
1271+
keyNode = Array.prototype.slice.call(keyNode);
1272+
12701273
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
12711274
if (Array.isArray(keyNode[index])) {
12721275
throwError(state, 'nested arrays are not supported inside keys');
12731276
}
1277+
1278+
if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
1279+
keyNode[index] = '[object Object]';
1280+
}
12741281
}
12751282
}
12761283

1284+
// Avoid code execution in load() via toString property
1285+
// (still use its own toString for arrays, timestamps,
1286+
// and whatever user schema extensions happen to have @@toStringTag)
1287+
if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
1288+
keyNode = '[object Object]';
1289+
}
1290+
1291+
12771292
keyNode = String(keyNode);
12781293

12791294
if (_result === null) {

0 commit comments

Comments
 (0)