@tramvai/test-helpers 7.21.1 → 7.26.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import type { Options as ParserOptions } from 'node-html-parser';
2
2
  export type ParseOptions = Partial<ParserOptions>;
3
3
  export declare const parseHtml: (html: string, parserOptions?: ParseOptions) => {
4
- parsed: import("node-html-parser").HTMLElement;
5
- body: string;
6
- head: string;
7
- application: string;
4
+ parsed: any;
5
+ body: any;
6
+ head: any;
7
+ application: any;
8
8
  } | null;
9
9
  //# sourceMappingURL=parseHtml.d.ts.map
@@ -1,12 +1,11 @@
1
- import { parse } from 'node-html-parser';
2
- import prettier from 'prettier';
3
-
4
1
  const parseHtml = (html, parserOptions = {
5
2
  blockTextElements: { script: false, style: false },
6
3
  }) => {
7
4
  if (!html) {
8
5
  return null;
9
6
  }
7
+ const prettier = require('prettier');
8
+ const { parse } = require('node-html-parser');
10
9
  const prettyHtml = prettier.format(html, { parser: 'html', printWidth: 120 });
11
10
  // @ts-ignore - используется тайпинг от 3 prettier, а в проекте 2
12
11
  const parsed = parse(prettyHtml, parserOptions);
package/lib/parseHtml.js CHANGED
@@ -2,22 +2,17 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var nodeHtmlParser = require('node-html-parser');
6
- var prettier = require('prettier');
7
-
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var prettier__default = /*#__PURE__*/_interopDefaultLegacy(prettier);
11
-
12
5
  const parseHtml = (html, parserOptions = {
13
6
  blockTextElements: { script: false, style: false },
14
7
  }) => {
15
8
  if (!html) {
16
9
  return null;
17
10
  }
18
- const prettyHtml = prettier__default["default"].format(html, { parser: 'html', printWidth: 120 });
11
+ const prettier = require('prettier');
12
+ const { parse } = require('node-html-parser');
13
+ const prettyHtml = prettier.format(html, { parser: 'html', printWidth: 120 });
19
14
  // @ts-ignore - используется тайпинг от 3 prettier, а в проекте 2
20
- const parsed = nodeHtmlParser.parse(prettyHtml, parserOptions);
15
+ const parsed = parse(prettyHtml, parserOptions);
21
16
  return {
22
17
  parsed,
23
18
  body: parsed.querySelector('body')?.innerHTML,
package/lib/render.d.ts CHANGED
@@ -8,9 +8,9 @@ export declare const renderFactory: (request: ReturnType<typeof requestFactory>,
8
8
  parserOptions?: Partial<import("node-html-parser").Options> | undefined;
9
9
  }) => Promise<{
10
10
  initialState: any;
11
- parsed: import("node-html-parser").HTMLElement;
12
- body: string;
13
- head: string;
14
- application: string;
11
+ parsed: any;
12
+ body: any;
13
+ head: any;
14
+ application: any;
15
15
  }>;
16
16
  //# sourceMappingURL=render.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/test-helpers",
3
- "version": "7.21.1",
3
+ "version": "7.26.9",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -17,8 +17,8 @@
17
17
  "watch": "tsc -w"
18
18
  },
19
19
  "dependencies": {
20
- "@tramvai/core": "7.21.1",
21
- "@tramvai/test-mocks": "7.21.1",
20
+ "@tramvai/core": "7.26.9",
21
+ "@tramvai/test-mocks": "7.26.9",
22
22
  "@types/express": "^4.17.1",
23
23
  "@types/supertest": "^6.0.3",
24
24
  "fastify": "^5.6.2",