| 10733 | } |
| 10734 | |
| 10735 | function writeFlowMapping(state, level, object) { |
| 10736 | var _result = '', |
| 10737 | _tag = state.tag, |
| 10738 | objectKeyList = Object.keys(object), |
| 10739 | index, |
| 10740 | length, |
| 10741 | objectKey, |
| 10742 | objectValue, |
| 10743 | pairBuffer; |
| 10744 | |
| 10745 | for (index = 0, length = objectKeyList.length; index < length; index += 1) { |
| 10746 | pairBuffer = ''; |
| 10747 | |
| 10748 | if (index !== 0) pairBuffer += ', '; |
| 10749 | |
| 10750 | objectKey = objectKeyList[index]; |
| 10751 | objectValue = object[objectKey]; |
| 10752 | |
| 10753 | if (!writeNode(state, level, objectKey, false, false)) { |
| 10754 | continue; // Skip this pair because of invalid key; |
| 10755 | } |
| 10756 | |
| 10757 | if (state.dump.length > 1024) pairBuffer += '? '; |
| 10758 | |
| 10759 | pairBuffer += state.dump + ': '; |
| 10760 | |
| 10761 | if (!writeNode(state, level, objectValue, false, false)) { |
| 10762 | continue; // Skip this pair because of invalid value. |
| 10763 | } |
| 10764 | |
| 10765 | pairBuffer += state.dump; |
| 10766 | |
| 10767 | // Both key and value are valid. |
| 10768 | _result += pairBuffer; |
| 10769 | } |
| 10770 | |
| 10771 | state.tag = _tag; |
| 10772 | state.dump = '{' + _result + '}'; |
| 10773 | } |
| 10774 | |
| 10775 | function writeBlockMapping(state, level, object, compact) { |
| 10776 | var _result = '', |