6c0549c6bf2917fafa0f762efb017d6a.json 16 KB

1
  1. {"ast":null,"code":"'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nexports.default = exports.test = exports.serialize = void 0;\n\nvar _collections = require('../collections');\n/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n// SENTINEL constants are from https://github.com/facebook/immutable-js\n\n\nconst IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\nconst IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';\nconst IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\nconst IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';\nconst IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';\nconst IS_RECORD_SENTINEL = '@@__IMMUTABLE_RECORD__@@'; // immutable v4\n\nconst IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';\nconst IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';\nconst IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';\n\nconst getImmutableName = name => 'Immutable.' + name;\n\nconst printAsLeaf = name => '[' + name + ']';\n\nconst SPACE = ' ';\nconst LAZY = '…'; // Seq is lazy if it calls a method like filter\n\nconst printImmutableEntries = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE + '{' + (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) + '}'; // Record has an entries method because it is a collection in immutable v3.\n// Return an iterator for Immutable Record from version v3 or v4.\n\n\nfunction getRecordEntries(val) {\n let i = 0;\n return {\n next() {\n if (i < val._keys.length) {\n const key = val._keys[i++];\n return {\n done: false,\n value: [key, val.get(key)]\n };\n }\n\n return {\n done: true,\n value: undefined\n };\n }\n\n };\n}\n\nconst printImmutableRecord = (val, config, indentation, depth, refs, printer) => {\n // _name property is defined only for an Immutable Record instance\n // which was constructed with a second optional descriptive name arg\n const name = getImmutableName(val._name || 'Record');\n return ++depth > config.maxDepth ? printAsLeaf(name) : name + SPACE + '{' + (0, _collections.printIteratorEntries)(getRecordEntries(val), config, indentation, depth, refs, printer) + '}';\n};\n\nconst printImmutableSeq = (val, config, indentation, depth, refs, printer) => {\n const name = getImmutableName('Seq');\n\n if (++depth > config.maxDepth) {\n return printAsLeaf(name);\n }\n\n if (val[IS_KEYED_SENTINEL]) {\n return name + SPACE + '{' + ( // from Immutable collection of entries or from ECMAScript object\n val._iter || val._object ? (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) : LAZY) + '}';\n }\n\n return name + SPACE + '[' + (val._iter || // from Immutable collection of values\n val._array || // from ECMAScript array\n val._collection || // from ECMAScript collection in immutable v4\n val._iterable // from ECMAScript collection in immutable v3\n ? (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) : LAZY) + ']';\n};\n\nconst printImmutableValues = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE + '[' + (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) + ']';\n\nconst serialize = (val, config, indentation, depth, refs, printer) => {\n if (val[IS_MAP_SENTINEL]) {\n return printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedMap' : 'Map');\n }\n\n if (val[IS_LIST_SENTINEL]) {\n return printImmutableValues(val, config, indentation, depth, refs, printer, 'List');\n }\n\n if (val[IS_SET_SENTINEL]) {\n return printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedSet' : 'Set');\n }\n\n if (val[IS_STACK_SENTINEL]) {\n return printImmutableValues(val, config, indentation, depth, refs, printer, 'Stack');\n }\n\n if (val[IS_SEQ_SENTINEL]) {\n return printImmutableSeq(val, config, indentation, depth, refs, printer);\n } // For compatibility with immutable v3 and v4, let record be the default.\n\n\n return printImmutableRecord(val, config, indentation, depth, refs, printer);\n}; // Explicitly comparing sentinel properties to true avoids false positive\n// when mock identity-obj-proxy returns the key as the value for any key.\n\n\nexports.serialize = serialize;\n\nconst test = val => val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);\n\nexports.test = test;\nconst plugin = {\n serialize,\n test\n};\nvar _default = plugin;\nexports.default = _default;","map":{"version":3,"sources":["/Users/jane/Documents/Курс Front-end/HW8/myproject/node_modules/pretty-format/build/plugins/Immutable.js"],"names":["Object","defineProperty","exports","value","default","test","serialize","_collections","require","IS_ITERABLE_SENTINEL","IS_LIST_SENTINEL","IS_KEYED_SENTINEL","IS_MAP_SENTINEL","IS_ORDERED_SENTINEL","IS_RECORD_SENTINEL","IS_SEQ_SENTINEL","IS_SET_SENTINEL","IS_STACK_SENTINEL","getImmutableName","name","printAsLeaf","SPACE","LAZY","printImmutableEntries","val","config","indentation","depth","refs","printer","type","maxDepth","printIteratorEntries","entries","getRecordEntries","i","next","_keys","length","key","done","get","undefined","printImmutableRecord","_name","printImmutableSeq","_iter","_object","_array","_collection","_iterable","printIteratorValues","values","printImmutableValues","plugin","_default"],"mappings":"AAAA;;AAEAA,MAAM,CAACC,cAAP,CAAsBC,OAAtB,EAA+B,YAA/B,EAA6C;AAC3CC,EAAAA,KAAK,EAAE;AADoC,CAA7C;AAGAD,OAAO,CAACE,OAAR,GAAkBF,OAAO,CAACG,IAAR,GAAeH,OAAO,CAACI,SAAR,GAAoB,KAAK,CAA1D;;AAEA,IAAIC,YAAY,GAAGC,OAAO,CAAC,gBAAD,CAA1B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,oBAAoB,GAAG,4BAA7B;AACA,MAAMC,gBAAgB,GAAG,wBAAzB;AACA,MAAMC,iBAAiB,GAAG,yBAA1B;AACA,MAAMC,eAAe,GAAG,uBAAxB;AACA,MAAMC,mBAAmB,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E,OAAR,GAAkBmD,QAAlB","sourcesContent":["'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nexports.default = exports.test = exports.serialize = void 0;\n\nvar _collections = require('../collections');\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n// SENTINEL constants are from https://github.com/facebook/immutable-js\nconst IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\nconst IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';\nconst IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\nconst IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';\nconst IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';\nconst IS_RECORD_SENTINEL = '@@__IMMUTABLE_RECORD__@@'; // immutable v4\n\nconst IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';\nconst IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';\nconst IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';\n\nconst getImmutableName = name => 'Immutable.' + name;\n\nconst printAsLeaf = name => '[' + name + ']';\n\nconst SPACE = ' ';\nconst LAZY = '…'; // Seq is lazy if it calls a method like filter\n\nconst printImmutableEntries = (\n val,\n config,\n indentation,\n depth,\n refs,\n printer,\n type\n) =>\n ++depth > config.maxDepth\n ? printAsLeaf(getImmutableName(type))\n : getImmutableName(type) +\n SPACE +\n '{' +\n (0, _collections.printIteratorEntries)(\n val.entries(),\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n '}'; // Record has an entries method because it is a collection in immutable v3.\n// Return an iterator for Immutable Record from version v3 or v4.\n\nfunction getRecordEntries(val) {\n let i = 0;\n return {\n next() {\n if (i < val._keys.length) {\n const key = val._keys[i++];\n return {\n done: false,\n value: [key, val.get(key)]\n };\n }\n\n return {\n done: true,\n value: undefined\n };\n }\n };\n}\n\nconst printImmutableRecord = (\n val,\n config,\n indentation,\n depth,\n refs,\n printer\n) => {\n // _name property is defined only for an Immutable Record instance\n // which was constructed with a second optional descriptive name arg\n const name = getImmutableName(val._name || 'Record');\n return ++depth > config.maxDepth\n ? printAsLeaf(name)\n : name +\n SPACE +\n '{' +\n (0, _collections.printIteratorEntries)(\n getRecordEntries(val),\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n '}';\n};\n\nconst printImmutableSeq = (val, config, indentation, depth, refs, printer) => {\n const name = getImmutableName('Seq');\n\n if (++depth > config.maxDepth) {\n return printAsLeaf(name);\n }\n\n if (val[IS_KEYED_SENTINEL]) {\n return (\n name +\n SPACE +\n '{' + // from Immutable collection of entries or from ECMAScript object\n (val._iter || val._object\n ? (0, _collections.printIteratorEntries)(\n val.entries(),\n config,\n indentation,\n depth,\n refs,\n printer\n )\n : LAZY) +\n '}'\n );\n }\n\n return (\n name +\n SPACE +\n '[' +\n (val._iter || // from Immutable collection of values\n val._array || // from ECMAScript array\n val._collection || // from ECMAScript collection in immutable v4\n val._iterable // from ECMAScript collection in immutable v3\n ? (0, _collections.printIteratorValues)(\n val.values(),\n config,\n indentation,\n depth,\n refs,\n printer\n )\n : LAZY) +\n ']'\n );\n};\n\nconst printImmutableValues = (\n val,\n config,\n indentation,\n depth,\n refs,\n printer,\n type\n) =>\n ++depth > config.maxDepth\n ? printAsLeaf(getImmutableName(type))\n : getImmutableName(type) +\n SPACE +\n '[' +\n (0, _collections.printIteratorValues)(\n val.values(),\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n ']';\n\nconst serialize = (val, config, indentation, depth, refs, printer) => {\n if (val[IS_MAP_SENTINEL]) {\n return printImmutableEntries(\n val,\n config,\n indentation,\n depth,\n refs,\n printer,\n val[IS_ORDERED_SENTINEL] ? 'OrderedMap' : 'Map'\n );\n }\n\n if (val[IS_LIST_SENTINEL]) {\n return printImmutableValues(\n val,\n config,\n indentation,\n depth,\n refs,\n printer,\n 'List'\n );\n }\n\n if (val[IS_SET_SENTINEL]) {\n return printImmutableValues(\n val,\n config,\n indentation,\n depth,\n refs,\n printer,\n val[IS_ORDERED_SENTINEL] ? 'OrderedSet' : 'Set'\n );\n }\n\n if (val[IS_STACK_SENTINEL]) {\n return printImmutableValues(\n val,\n config,\n indentation,\n depth,\n refs,\n printer,\n 'Stack'\n );\n }\n\n if (val[IS_SEQ_SENTINEL]) {\n return printImmutableSeq(val, config, indentation, depth, refs, printer);\n } // For compatibility with immutable v3 and v4, let record be the default.\n\n return printImmutableRecord(val, config, indentation, depth, refs, printer);\n}; // Explicitly comparing sentinel properties to true avoids false positive\n// when mock identity-obj-proxy returns the key as the value for any key.\n\nexports.serialize = serialize;\n\nconst test = val =>\n val &&\n (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);\n\nexports.test = test;\nconst plugin = {\n serialize,\n test\n};\nvar _default = plugin;\nexports.default = _default;\n"]},"metadata":{},"sourceType":"script"}