3 Object.defineProperty(exports, '__esModule', {
6 exports.serialize = exports.test = undefined;
8 var _collections = require('../collections');
11 * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
13 * This source code is licensed under the MIT license found in the
14 * LICENSE file in the root directory of this source tree.
21 const COLLECTION_NAMES = ['DOMStringMap', 'NamedNodeMap'];
23 const test = (exports.test = val =>
26 COLLECTION_NAMES.indexOf(val.constructor.name) !== -1);
28 const convertCollectionToObject = collection => {
31 if (collection.constructor.name === 'NamedNodeMap') {
32 for (let i = 0; i < collection.length; i++) {
33 result[collection[i].name] = collection[i].value;
36 result = Object.assign({}, collection);
42 const serialize = (exports.serialize = (
50 if (++depth > config.maxDepth) {
51 return '[' + collection.constructor.name + ']';
55 collection.constructor.name +
58 (0, _collections.printObjectProperties)(
59 convertCollectionToObject(collection),
70 exports.default = {serialize: serialize, test: test};