happy-dom 5.0.0 → 5.3.0
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.
Potentially problematic release.
This version of happy-dom might be problematic. Click here for more details.
- package/lib/config/ElementTag.d.ts +6 -3
- package/lib/config/ElementTag.js +6 -3
- package/lib/config/ElementTag.js.map +1 -1
- package/lib/config/NonImplemenetedElementClasses.js +0 -3
- package/lib/config/NonImplemenetedElementClasses.js.map +1 -1
- package/lib/dom-token-list/DOMTokenList.d.ts +4 -0
- package/lib/dom-token-list/DOMTokenList.js +6 -0
- package/lib/dom-token-list/DOMTokenList.js.map +1 -1
- package/lib/dom-token-list/IDOMTokenList.d.ts +1 -0
- package/lib/exception/DOMExceptionNameEnum.d.ts +2 -1
- package/lib/exception/DOMExceptionNameEnum.js +1 -0
- package/lib/exception/DOMExceptionNameEnum.js.map +1 -1
- package/lib/nodes/html-input-element/HTMLInputElement.d.ts +1 -1
- package/lib/nodes/html-input-element/HTMLInputElement.js +1 -1
- package/lib/nodes/html-input-element/HTMLInputElement.js.map +1 -1
- package/lib/nodes/html-input-element/IHTMLInputElement.d.ts +1 -1
- package/lib/nodes/html-opt-group-element/HTMLOptGroupElement.d.ts +34 -0
- package/lib/nodes/html-opt-group-element/HTMLOptGroupElement.js +58 -0
- package/lib/nodes/html-opt-group-element/HTMLOptGroupElement.js.map +1 -0
- package/lib/nodes/html-opt-group-element/IHTMLOptGroupElement.d.ts +11 -0
- package/lib/nodes/html-opt-group-element/IHTMLOptGroupElement.js +3 -0
- package/lib/nodes/html-opt-group-element/IHTMLOptGroupElement.js.map +1 -0
- package/lib/nodes/html-option-element/HTMLOptionElement.d.ts +72 -0
- package/lib/nodes/html-option-element/HTMLOptionElement.js +111 -0
- package/lib/nodes/html-option-element/HTMLOptionElement.js.map +1 -0
- package/lib/nodes/html-option-element/HTMLOptionElementValueSanitizer.d.ts +11 -0
- package/lib/nodes/html-option-element/HTMLOptionElementValueSanitizer.js +18 -0
- package/lib/nodes/html-option-element/HTMLOptionElementValueSanitizer.js.map +1 -0
- package/lib/nodes/html-option-element/HTMLOptionsCollection.d.ts +43 -0
- package/lib/nodes/html-option-element/HTMLOptionsCollection.js +80 -0
- package/lib/nodes/html-option-element/HTMLOptionsCollection.js.map +1 -0
- package/lib/nodes/html-option-element/IHTMLOptionElement.d.ts +16 -0
- package/lib/nodes/html-option-element/IHTMLOptionElement.js +3 -0
- package/lib/nodes/html-option-element/IHTMLOptionElement.js.map +1 -0
- package/lib/nodes/html-option-element/IHTMLOptionsCollection.d.ts +26 -0
- package/lib/nodes/html-option-element/IHTMLOptionsCollection.js +3 -0
- package/lib/nodes/html-option-element/IHTMLOptionsCollection.js.map +1 -0
- package/lib/nodes/html-select-element/HTMLSelectElement.d.ts +128 -0
- package/lib/nodes/html-select-element/HTMLSelectElement.js +215 -0
- package/lib/nodes/html-select-element/HTMLSelectElement.js.map +1 -0
- package/lib/nodes/html-select-element/HTMLSelectElementValueSanitizer.d.ts +11 -0
- package/lib/nodes/html-select-element/HTMLSelectElementValueSanitizer.js +18 -0
- package/lib/nodes/html-select-element/HTMLSelectElementValueSanitizer.js.map +1 -0
- package/lib/nodes/html-select-element/IHTMLSelectElement.d.ts +26 -0
- package/lib/nodes/html-select-element/IHTMLSelectElement.js +3 -0
- package/lib/nodes/html-select-element/IHTMLSelectElement.js.map +1 -0
- package/lib/nodes/{html-input-element → validity-state}/ValidityState.d.ts +3 -2
- package/lib/nodes/{html-input-element → validity-state}/ValidityState.js +12 -2
- package/lib/nodes/validity-state/ValidityState.js.map +1 -0
- package/lib/window/Window.d.ts +2 -0
- package/lib/window/Window.js +4 -0
- package/lib/window/Window.js.map +1 -1
- package/lib/window/WindowBase64.d.ts +19 -0
- package/lib/window/WindowBase64.js +88 -0
- package/lib/window/WindowBase64.js.map +1 -0
- package/package.json +2 -2
- package/src/config/ElementTag.ts +6 -3
- package/src/config/NonImplemenetedElementClasses.ts +0 -3
- package/src/dom-token-list/DOMTokenList.ts +7 -0
- package/src/dom-token-list/IDOMTokenList.ts +1 -0
- package/src/exception/DOMExceptionNameEnum.ts +2 -1
- package/src/nodes/html-input-element/HTMLInputElement.ts +1 -1
- package/src/nodes/html-input-element/IHTMLInputElement.ts +1 -1
- package/src/nodes/html-opt-group-element/HTMLOptGroupElement.ts +54 -0
- package/src/nodes/html-opt-group-element/IHTMLOptGroupElement.ts +12 -0
- package/src/nodes/html-option-element/HTMLOptionElement.ts +117 -0
- package/src/nodes/html-option-element/HTMLOptionElementValueSanitizer.ts +15 -0
- package/src/nodes/html-option-element/HTMLOptionsCollection.ts +94 -0
- package/src/nodes/html-option-element/IHTMLOptionElement.ts +17 -0
- package/src/nodes/html-option-element/IHTMLOptionsCollection.ts +33 -0
- package/src/nodes/html-select-element/HTMLSelectElement.ts +239 -0
- package/src/nodes/html-select-element/HTMLSelectElementValueSanitizer.ts +15 -0
- package/src/nodes/html-select-element/IHTMLSelectElement.ts +27 -0
- package/src/nodes/{html-input-element → validity-state}/ValidityState.ts +13 -5
- package/src/window/Window.ts +5 -0
- package/src/window/WindowBase64.ts +95 -0
- package/lib/nodes/html-input-element/ValidityState.js.map +0 -1
@@ -0,0 +1,239 @@
|
|
1
|
+
import DOMException from '../../exception/DOMException';
|
2
|
+
import DOMExceptionNameEnum from '../../exception/DOMExceptionNameEnum';
|
3
|
+
import HTMLElement from '../html-element/HTMLElement';
|
4
|
+
import IHTMLElement from '../html-element/IHTMLElement';
|
5
|
+
import IHTMLFormElement from '../html-form-element/IHTMLFormElement';
|
6
|
+
import ValidityState from '../validity-state/ValidityState';
|
7
|
+
import IHTMLLabelElement from '../html-label-element/IHTMLLabelElement';
|
8
|
+
import HTMLOptGroupElement from '../html-opt-group-element/HTMLOptGroupElement';
|
9
|
+
import HTMLOptionElement from '../html-option-element/HTMLOptionElement';
|
10
|
+
import HTMLOptionsCollection from '../html-option-element/HTMLOptionsCollection';
|
11
|
+
import IHTMLOptionsCollection from '../html-option-element/IHTMLOptionsCollection';
|
12
|
+
import INodeList from '../node/INodeList';
|
13
|
+
import HTMLSelectElementValueSanitizer from './HTMLSelectElementValueSanitizer';
|
14
|
+
import IHTMLSelectElement from './IHTMLSelectElement';
|
15
|
+
|
16
|
+
/**
|
17
|
+
* HTML Select Element.
|
18
|
+
*
|
19
|
+
* Reference:
|
20
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement.
|
21
|
+
*/
|
22
|
+
export default class HTMLSelectElement extends HTMLElement implements IHTMLSelectElement {
|
23
|
+
public type: string;
|
24
|
+
public labels: INodeList<IHTMLLabelElement>;
|
25
|
+
|
26
|
+
public _value = null;
|
27
|
+
public _selectedIndex = -1;
|
28
|
+
public _options: IHTMLOptionsCollection = null;
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Returns name.
|
32
|
+
*
|
33
|
+
* @returns Name.
|
34
|
+
*/
|
35
|
+
public get name(): string {
|
36
|
+
return this.getAttributeNS(null, 'name') || '';
|
37
|
+
}
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Sets name.
|
41
|
+
*
|
42
|
+
* @param name Name.
|
43
|
+
*/
|
44
|
+
public set name(name: string) {
|
45
|
+
this.setAttributeNS(null, 'name', name);
|
46
|
+
}
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Returns disabled.
|
50
|
+
*
|
51
|
+
* @returns Disabled.
|
52
|
+
*/
|
53
|
+
public get disabled(): boolean {
|
54
|
+
return this.getAttributeNS(null, 'disabled') !== null;
|
55
|
+
}
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Sets disabled.
|
59
|
+
*
|
60
|
+
* @param disabled Disabled.
|
61
|
+
*/
|
62
|
+
public set disabled(disabled: boolean) {
|
63
|
+
if (!disabled) {
|
64
|
+
this.removeAttributeNS(null, 'disabled');
|
65
|
+
} else {
|
66
|
+
this.setAttributeNS(null, 'disabled', '');
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Returns multiple.
|
72
|
+
*
|
73
|
+
* @returns Multiple.
|
74
|
+
*/
|
75
|
+
public get multiple(): boolean {
|
76
|
+
return this.getAttributeNS(null, 'multiple') !== null;
|
77
|
+
}
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Sets multiple.
|
81
|
+
*
|
82
|
+
* @param multiple Multiple.
|
83
|
+
*/
|
84
|
+
public set multiple(multiple: boolean) {
|
85
|
+
if (!multiple) {
|
86
|
+
this.removeAttributeNS(null, 'multiple');
|
87
|
+
} else {
|
88
|
+
this.setAttributeNS(null, 'multiple', '');
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Returns autofocus.
|
94
|
+
*
|
95
|
+
* @returns Autofocus.
|
96
|
+
*/
|
97
|
+
public get autofocus(): boolean {
|
98
|
+
return this.getAttributeNS(null, 'autofocus') !== null;
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Sets autofocus.
|
103
|
+
*
|
104
|
+
* @param autofocus Autofocus.
|
105
|
+
*/
|
106
|
+
public set autofocus(autofocus: boolean) {
|
107
|
+
if (!autofocus) {
|
108
|
+
this.removeAttributeNS(null, 'autofocus');
|
109
|
+
} else {
|
110
|
+
this.setAttributeNS(null, 'autofocus', '');
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
/**
|
115
|
+
* Returns required.
|
116
|
+
*
|
117
|
+
* @returns Required.
|
118
|
+
*/
|
119
|
+
public get required(): boolean {
|
120
|
+
return this.getAttributeNS(null, 'required') !== null;
|
121
|
+
}
|
122
|
+
|
123
|
+
/**
|
124
|
+
* Sets required.
|
125
|
+
*
|
126
|
+
* @param required Required.
|
127
|
+
*/
|
128
|
+
public set required(required: boolean) {
|
129
|
+
if (!required) {
|
130
|
+
this.removeAttributeNS(null, 'required');
|
131
|
+
} else {
|
132
|
+
this.setAttributeNS(null, 'required', '');
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Returns value.
|
138
|
+
*
|
139
|
+
* @returns Value.
|
140
|
+
*/
|
141
|
+
public get value(): string {
|
142
|
+
return this._value;
|
143
|
+
}
|
144
|
+
|
145
|
+
/**
|
146
|
+
* Sets value.
|
147
|
+
*
|
148
|
+
* @param value Value.
|
149
|
+
*/
|
150
|
+
public set value(value: string) {
|
151
|
+
this._value = HTMLSelectElementValueSanitizer.sanitize(value);
|
152
|
+
|
153
|
+
const idx = this.options.findIndex((o) => o.nodeValue === value);
|
154
|
+
if (idx > -1) {
|
155
|
+
this._selectedIndex = idx;
|
156
|
+
}
|
157
|
+
}
|
158
|
+
|
159
|
+
/**
|
160
|
+
* Returns value.
|
161
|
+
*
|
162
|
+
* @returns Value.
|
163
|
+
*/
|
164
|
+
public get selectedIndex(): number {
|
165
|
+
return this._options ? this._options.selectedIndex : -1;
|
166
|
+
}
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Sets value.
|
170
|
+
*
|
171
|
+
* @param value Value.
|
172
|
+
*/
|
173
|
+
public set selectedIndex(value: number) {
|
174
|
+
if (this.options.length - 1 > value || value < 0) {
|
175
|
+
throw new DOMException(
|
176
|
+
'Select elements selected index must be valid',
|
177
|
+
DOMExceptionNameEnum.indexSizeError
|
178
|
+
);
|
179
|
+
}
|
180
|
+
|
181
|
+
this._options.selectedIndex = value;
|
182
|
+
}
|
183
|
+
|
184
|
+
/**
|
185
|
+
* Returns the parent form element.
|
186
|
+
*
|
187
|
+
* @returns Form.
|
188
|
+
*/
|
189
|
+
public get form(): IHTMLFormElement {
|
190
|
+
let parent = <IHTMLElement>this.parentNode;
|
191
|
+
while (parent && parent.tagName !== 'FORM') {
|
192
|
+
parent = <IHTMLElement>parent.parentNode;
|
193
|
+
}
|
194
|
+
return <IHTMLFormElement>parent;
|
195
|
+
}
|
196
|
+
|
197
|
+
/**
|
198
|
+
* Returns validity state.
|
199
|
+
*
|
200
|
+
* @returns Validity state.
|
201
|
+
*/
|
202
|
+
public get validity(): ValidityState {
|
203
|
+
return new ValidityState(this);
|
204
|
+
}
|
205
|
+
|
206
|
+
/**
|
207
|
+
* Returns "true" if it will validate.
|
208
|
+
*
|
209
|
+
* @returns "true" if it will validate.
|
210
|
+
*/
|
211
|
+
public get willValidate(): boolean {
|
212
|
+
return (
|
213
|
+
this.type !== 'hidden' &&
|
214
|
+
this.type !== 'reset' &&
|
215
|
+
this.type !== 'button' &&
|
216
|
+
!this.disabled &&
|
217
|
+
!this['readOnly']
|
218
|
+
);
|
219
|
+
}
|
220
|
+
|
221
|
+
/**
|
222
|
+
* Returns options.
|
223
|
+
*
|
224
|
+
* @returns Options.
|
225
|
+
*/
|
226
|
+
public get options(): IHTMLOptionsCollection {
|
227
|
+
if (this._options === null) {
|
228
|
+
this._options = new HTMLOptionsCollection();
|
229
|
+
const childs = <INodeList<IHTMLElement>>this.childNodes;
|
230
|
+
for (const child of childs) {
|
231
|
+
if (child.tagName === 'OPTION') {
|
232
|
+
this._options.add(<HTMLOptionElement | HTMLOptGroupElement>child);
|
233
|
+
}
|
234
|
+
}
|
235
|
+
}
|
236
|
+
|
237
|
+
return this._options;
|
238
|
+
}
|
239
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
const NEW_LINES_REGEXP = /[\n\r]/gm;
|
2
|
+
|
3
|
+
/**
|
4
|
+
* HTML select element value sanitizer.
|
5
|
+
*/
|
6
|
+
export default class HTMLSelectElementValueSanitizer {
|
7
|
+
/**
|
8
|
+
* Sanitizes a value.
|
9
|
+
*
|
10
|
+
* @param value Value.
|
11
|
+
*/
|
12
|
+
public static sanitize(value: string): string {
|
13
|
+
return value.replace(NEW_LINES_REGEXP, '');
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import IHTMLElement from '../html-element/IHTMLElement';
|
2
|
+
import IHTMLFormElement from '../html-form-element/IHTMLFormElement';
|
3
|
+
import IHTMLLabelElement from '../html-label-element/IHTMLLabelElement';
|
4
|
+
import INodeList from '../node/INodeList';
|
5
|
+
import IHTMLOptionsCollection from '../html-option-element/IHTMLOptionsCollection';
|
6
|
+
import ValidityState from '../validity-state/ValidityState';
|
7
|
+
|
8
|
+
/**
|
9
|
+
* HTML Select Element.
|
10
|
+
*
|
11
|
+
* Reference:
|
12
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement.
|
13
|
+
*/
|
14
|
+
export default interface IHTMLSelectElement extends IHTMLElement {
|
15
|
+
readonly form: IHTMLFormElement;
|
16
|
+
readonly labels: INodeList<IHTMLLabelElement>;
|
17
|
+
type: string;
|
18
|
+
autofocus: boolean;
|
19
|
+
disabled: boolean;
|
20
|
+
options: IHTMLOptionsCollection;
|
21
|
+
selectedIndex: number;
|
22
|
+
validity: ValidityState;
|
23
|
+
value: string;
|
24
|
+
willValidate: boolean;
|
25
|
+
name: string;
|
26
|
+
multiple: boolean;
|
27
|
+
}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import HTMLInputElement from '
|
1
|
+
import HTMLInputElement from '../html-input-element/HTMLInputElement';
|
2
|
+
import HTMLSelectElement from '../html-select-element/HTMLSelectElement';
|
2
3
|
|
3
4
|
/**
|
4
5
|
* Input validity state.
|
@@ -12,14 +13,14 @@ export default class ValidityState {
|
|
12
13
|
public rangeOverflow = false;
|
13
14
|
public rangeUnderflow = false;
|
14
15
|
public stepMismatch = false;
|
15
|
-
private element: HTMLInputElement = null;
|
16
|
+
private element: HTMLInputElement | HTMLSelectElement = null;
|
16
17
|
|
17
18
|
/**
|
18
19
|
* Constructor.
|
19
20
|
*
|
20
21
|
* @param element Input element.
|
21
22
|
*/
|
22
|
-
constructor(element: HTMLInputElement) {
|
23
|
+
constructor(element: HTMLInputElement | HTMLSelectElement) {
|
23
24
|
this.element = element;
|
24
25
|
}
|
25
26
|
|
@@ -29,7 +30,10 @@ export default class ValidityState {
|
|
29
30
|
* @returns "true" if valid.
|
30
31
|
*/
|
31
32
|
public get tooLong(): boolean {
|
32
|
-
|
33
|
+
if (this.element instanceof HTMLInputElement) {
|
34
|
+
return this.element.maxLength && this.element.value.length > this.element.maxLength;
|
35
|
+
}
|
36
|
+
return false;
|
33
37
|
}
|
34
38
|
|
35
39
|
/**
|
@@ -38,7 +42,11 @@ export default class ValidityState {
|
|
38
42
|
* @returns "true" if valid.
|
39
43
|
*/
|
40
44
|
public get tooShort(): boolean {
|
41
|
-
|
45
|
+
if (this.element instanceof HTMLInputElement) {
|
46
|
+
return this.element.minLength && this.element.value.length < this.element.minLength;
|
47
|
+
}
|
48
|
+
|
49
|
+
return false;
|
42
50
|
}
|
43
51
|
|
44
52
|
/**
|
package/src/window/Window.ts
CHANGED
@@ -92,6 +92,7 @@ import VMGlobalPropertyScript from './VMGlobalPropertyScript';
|
|
92
92
|
import * as PerfHooks from 'perf_hooks';
|
93
93
|
import VM from 'vm';
|
94
94
|
import { Buffer } from 'buffer';
|
95
|
+
import { atob, btoa } from './WindowBase64';
|
95
96
|
|
96
97
|
/**
|
97
98
|
* Browser window.
|
@@ -219,6 +220,10 @@ export default class Window extends EventTarget implements IWindow {
|
|
219
220
|
public readonly localStorage = new Storage();
|
220
221
|
public readonly performance = PerfHooks.performance;
|
221
222
|
|
223
|
+
// Atob & btoa
|
224
|
+
public atob = atob;
|
225
|
+
public btoa = btoa;
|
226
|
+
|
222
227
|
// Node.js Globals
|
223
228
|
public ArrayBuffer;
|
224
229
|
public Boolean;
|
@@ -0,0 +1,95 @@
|
|
1
|
+
import DOMException from '../exception/DOMException';
|
2
|
+
import DOMExceptionNameEnum from '../exception/DOMExceptionNameEnum';
|
3
|
+
|
4
|
+
const base64list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Btoa.
|
8
|
+
*
|
9
|
+
* Reference:
|
10
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/btoa.
|
11
|
+
*
|
12
|
+
* @param data
|
13
|
+
*/
|
14
|
+
export const btoa = (data: unknown): string => {
|
15
|
+
const str = (<string>data).toString();
|
16
|
+
if (/[^\u0000-\u00ff]/.test(str)) {
|
17
|
+
throw new DOMException(
|
18
|
+
"Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.",
|
19
|
+
DOMExceptionNameEnum.invalidCharacterError
|
20
|
+
);
|
21
|
+
}
|
22
|
+
|
23
|
+
let t = '';
|
24
|
+
let p = -6;
|
25
|
+
let a = 0;
|
26
|
+
let i = 0;
|
27
|
+
let v = 0;
|
28
|
+
let c;
|
29
|
+
while (i < str.length || p > -6) {
|
30
|
+
if (p < 0) {
|
31
|
+
if (i < str.length) {
|
32
|
+
c = str.charCodeAt(i++);
|
33
|
+
v += 8;
|
34
|
+
} else {
|
35
|
+
c = 0;
|
36
|
+
}
|
37
|
+
a = ((a & 255) << 8) | (c & 255);
|
38
|
+
p += 8;
|
39
|
+
}
|
40
|
+
t += base64list.charAt(v > 0 ? (a >> p) & 63 : 64);
|
41
|
+
p -= 6;
|
42
|
+
v -= 6;
|
43
|
+
}
|
44
|
+
return t;
|
45
|
+
};
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Atob.
|
49
|
+
*
|
50
|
+
* Reference:
|
51
|
+
* https://infra.spec.whatwg.org/#forgiving-base64-encode.
|
52
|
+
* Https://html.spec.whatwg.org/multipage/webappapis.html#btoa.
|
53
|
+
*
|
54
|
+
* @param data
|
55
|
+
*/
|
56
|
+
export const atob = (data: unknown): string => {
|
57
|
+
const str = (<string>data).toString();
|
58
|
+
|
59
|
+
if (/[^\u0000-\u00ff]/.test(str)) {
|
60
|
+
throw new DOMException(
|
61
|
+
"Failed to execute 'atob' on 'Window': The string to be decoded contains characters outside of the Latin1 range.",
|
62
|
+
DOMExceptionNameEnum.invalidCharacterError
|
63
|
+
);
|
64
|
+
}
|
65
|
+
|
66
|
+
if (/[^A-Za-z\d+/=]/.test(str) || str.length % 4 == 1) {
|
67
|
+
throw new DOMException(
|
68
|
+
"Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.",
|
69
|
+
DOMExceptionNameEnum.invalidCharacterError
|
70
|
+
);
|
71
|
+
}
|
72
|
+
|
73
|
+
let t = '';
|
74
|
+
let p = -8;
|
75
|
+
let a = 0;
|
76
|
+
let c;
|
77
|
+
let d;
|
78
|
+
for (let i = 0; i < str.length; i++) {
|
79
|
+
if ((c = base64list.indexOf(str.charAt(i))) < 0) {
|
80
|
+
continue;
|
81
|
+
}
|
82
|
+
a = (a << 6) | (c & 63);
|
83
|
+
if ((p += 6) >= 0) {
|
84
|
+
d = (a >> p) & 255;
|
85
|
+
if (c !== 64) {
|
86
|
+
t += String.fromCharCode(d);
|
87
|
+
}
|
88
|
+
a &= 63;
|
89
|
+
p -= 8;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
return t;
|
93
|
+
};
|
94
|
+
|
95
|
+
exports = { btoa: btoa, atob: atob };
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ValidityState.js","sourceRoot":"","sources":["../../../src/nodes/html-input-element/ValidityState.ts"],"names":[],"mappings":";;AAEA;;;;GAIG;AACH,MAAqB,aAAa;IASjC;;;;OAIG;IACH,YAAY,OAAyB;QAb9B,aAAQ,GAAG,KAAK,CAAC;QACjB,gBAAW,GAAG,KAAK,CAAC;QACpB,oBAAe,GAAG,KAAK,CAAC;QACxB,kBAAa,GAAG,KAAK,CAAC;QACtB,mBAAc,GAAG,KAAK,CAAC;QACvB,iBAAY,GAAG,KAAK,CAAC;QACpB,YAAO,GAAqB,IAAI,CAAC;QAQxC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACrF,CAAC;IAED;;;;OAIG;IACH,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACrF,CAAC;IAED;;;;OAIG;IACH,IAAW,YAAY;QACtB,OAAO,KAAK,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACH,IAAW,KAAK;QACf,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACpC,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE;gBACd,OAAO,KAAK,CAAC;aACb;SACD;QAED,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;IACpF,CAAC;CACD;AApED,gCAoEC"}
|