6c76e1edbd759fd71910949102a42bcc.json 8.5 KB

1
  1. {"ast":null,"code":"'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nexports.default = exports.serialize = exports.test = void 0;\n\nvar _ansiRegex = _interopRequireDefault(require('ansi-regex'));\n\nvar _ansiStyles = _interopRequireDefault(require('ansi-styles'));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\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\n\nconst toHumanReadableAnsi = text => text.replace((0, _ansiRegex.default)(), match => {\n switch (match) {\n case _ansiStyles.default.red.close:\n case _ansiStyles.default.green.close:\n case _ansiStyles.default.cyan.close:\n case _ansiStyles.default.gray.close:\n case _ansiStyles.default.white.close:\n case _ansiStyles.default.yellow.close:\n case _ansiStyles.default.bgRed.close:\n case _ansiStyles.default.bgGreen.close:\n case _ansiStyles.default.bgYellow.close:\n case _ansiStyles.default.inverse.close:\n case _ansiStyles.default.dim.close:\n case _ansiStyles.default.bold.close:\n case _ansiStyles.default.reset.open:\n case _ansiStyles.default.reset.close:\n return '</>';\n\n case _ansiStyles.default.red.open:\n return '<red>';\n\n case _ansiStyles.default.green.open:\n return '<green>';\n\n case _ansiStyles.default.cyan.open:\n return '<cyan>';\n\n case _ansiStyles.default.gray.open:\n return '<gray>';\n\n case _ansiStyles.default.white.open:\n return '<white>';\n\n case _ansiStyles.default.yellow.open:\n return '<yellow>';\n\n case _ansiStyles.default.bgRed.open:\n return '<bgRed>';\n\n case _ansiStyles.default.bgGreen.open:\n return '<bgGreen>';\n\n case _ansiStyles.default.bgYellow.open:\n return '<bgYellow>';\n\n case _ansiStyles.default.inverse.open:\n return '<inverse>';\n\n case _ansiStyles.default.dim.open:\n return '<dim>';\n\n case _ansiStyles.default.bold.open:\n return '<bold>';\n\n default:\n return '';\n }\n});\n\nconst test = val => typeof val === 'string' && !!val.match((0, _ansiRegex.default)());\n\nexports.test = test;\n\nconst serialize = (val, config, indentation, depth, refs, printer) => printer(toHumanReadableAnsi(val), config, indentation, depth, refs);\n\nexports.serialize = serialize;\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/ConvertAnsi.js"],"names":["Object","defineProperty","exports","value","default","serialize","test","_ansiRegex","_interopRequireDefault","require","_ansiStyles","obj","__esModule","toHumanReadableAnsi","text","replace","match","red","close","green","cyan","gray","white","yellow","bgRed","bgGreen","bgYellow","inverse","dim","bold","reset","open","val","config","indentation","depth","refs","printer","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,SAAR,GAAoBH,OAAO,CAACI,IAAR,GAAe,KAAK,CAA1D;;AAEA,IAAIC,UAAU,GAAGC,sBAAsB,CAACC,OAAO,CAAC,YAAD,CAAR,CAAvC;;AAEA,IAAIC,WAAW,GAAGF,sBAAsB,CAACC,OAAO,CAAC,aAAD,CAAR,CAAxC;;AAEA,SAASD,sBAAT,CAAgCG,GAAhC,EAAqC;AACnC,SAAOA,GAAG,IAAIA,GAAG,CAACC,UAAX,GAAwBD,GAAxB,GAA8B;AAACP,IAAAA,OAAO,EAAEO;AAAV,GAArC;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,mBAAmB,GAAGC,IAAI,IAC9BA,IAAI,CAACC,OAAL,CAAa,CAAC,GAAGR,UAAU,CAACH,OAAf,GAAb,EAAwCY,KAAK,IAAI;AAC/C,UAAQA,KAAR;AACE,SAAKN,WAAW,CAACN,OAAZ,CAAoBa,GAApB,CAAwBC,KAA7B;AACA,SAAKR,WAAW,CAACN,OA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","sourcesContent":["'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nexports.default = exports.serialize = exports.test = void 0;\n\nvar _ansiRegex = _interopRequireDefault(require('ansi-regex'));\n\nvar _ansiStyles = _interopRequireDefault(require('ansi-styles'));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {default: obj};\n}\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 */\nconst toHumanReadableAnsi = text =>\n text.replace((0, _ansiRegex.default)(), match => {\n switch (match) {\n case _ansiStyles.default.red.close:\n case _ansiStyles.default.green.close:\n case _ansiStyles.default.cyan.close:\n case _ansiStyles.default.gray.close:\n case _ansiStyles.default.white.close:\n case _ansiStyles.default.yellow.close:\n case _ansiStyles.default.bgRed.close:\n case _ansiStyles.default.bgGreen.close:\n case _ansiStyles.default.bgYellow.close:\n case _ansiStyles.default.inverse.close:\n case _ansiStyles.default.dim.close:\n case _ansiStyles.default.bold.close:\n case _ansiStyles.default.reset.open:\n case _ansiStyles.default.reset.close:\n return '</>';\n\n case _ansiStyles.default.red.open:\n return '<red>';\n\n case _ansiStyles.default.green.open:\n return '<green>';\n\n case _ansiStyles.default.cyan.open:\n return '<cyan>';\n\n case _ansiStyles.default.gray.open:\n return '<gray>';\n\n case _ansiStyles.default.white.open:\n return '<white>';\n\n case _ansiStyles.default.yellow.open:\n return '<yellow>';\n\n case _ansiStyles.default.bgRed.open:\n return '<bgRed>';\n\n case _ansiStyles.default.bgGreen.open:\n return '<bgGreen>';\n\n case _ansiStyles.default.bgYellow.open:\n return '<bgYellow>';\n\n case _ansiStyles.default.inverse.open:\n return '<inverse>';\n\n case _ansiStyles.default.dim.open:\n return '<dim>';\n\n case _ansiStyles.default.bold.open:\n return '<bold>';\n\n default:\n return '';\n }\n });\n\nconst test = val =>\n typeof val === 'string' && !!val.match((0, _ansiRegex.default)());\n\nexports.test = test;\n\nconst serialize = (val, config, indentation, depth, refs, printer) =>\n printer(toHumanReadableAnsi(val), config, indentation, depth, refs);\n\nexports.serialize = serialize;\nconst plugin = {\n serialize,\n test\n};\nvar _default = plugin;\nexports.default = _default;\n"]},"metadata":{},"sourceType":"script"}