-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
51 lines (45 loc) · 1.22 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import uniqueString from 'unique-slug';
import { JSDOM } from 'jsdom';
import { minify as MinifyJS } from 'terser';
import csso from 'csso';
const { minify: MinifyCSS } = csso;
let document = new JSDOM().window.document;
import doc from './document.js';
const newDocument = doc({ document, MinifyJS, MinifyCSS });
import el from './element.js';
const newElement = el({ document, uniqueString });
newDocument();
/**
* The document class from {@link https://www.npmjs.com/package/jsdom jsdom}.
* @external document
* @typedef {external:document} document
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/document document}
*/
/**
* The element class from {@link https://www.npmjs.com/package/jsdom jsdom}.
* @external element
* @typedef {external:element} element
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/element element}
* @see {@link https://www.npmjs.com/package/jsdom jsdom}
* @see {@link https://dom.spec.whatwg.org/ WHATWG DOM standards}
*/
/**
* @private
* @ignore
* @type {string[]}
*/
const _jsSnippets = [];
/**
* @private
* @ignore
* @type {string[]}
*/
const _cssSnippets = [];
export {
newElement,
document,
newDocument,
_jsSnippets,
_cssSnippets
};
export default newElement;