Skip to content

Commit 5542e8a

Browse files
committed
fix: update dependencies
1 parent 8610eb9 commit 5542e8a

17 files changed

+54
-232
lines changed

.eslintrc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ extends: cheminfo-typescript
22
parserOptions:
33
sourceType: module
44
env:
5-
node: true
5+
node: true
6+
jest: true

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@
3737
},
3838
"homepage": "https://github.com/cheminfo/arraybuffer-xml-parser#readme",
3939
"devDependencies": {
40-
"@types/he": "^1.1.2",
41-
"@types/jest": "^29.2.0",
42-
"cheminfo-build": "^1.1.11",
43-
"eslint": "^8.25.0",
44-
"eslint-config-cheminfo-typescript": "^11.1.0",
40+
"@types/he": "^1.2.3",
41+
"@types/jest": "^29.5.12",
42+
"cheminfo-build": "^1.2.0",
43+
"eslint": "^8.57.0",
44+
"eslint-config-cheminfo-typescript": "^12.2.0",
4545
"he": "^1.2.0",
46-
"iobuffer": "^5.2.1",
47-
"jest": "^29.2.1",
48-
"pako": "^2.0.4",
49-
"prettier": "^2.7.1",
50-
"rimraf": "^3.0.2",
51-
"ts-jest": "^29.0.3",
52-
"typescript": "^4.8.4",
46+
"iobuffer": "^5.3.2",
47+
"jest": "^29.7.0",
48+
"pako": "^2.1.0",
49+
"prettier": "^3.2.5",
50+
"rimraf": "^5.0.5",
51+
"ts-jest": "^29.1.2",
52+
"typescript": "^5.3.3",
5353
"uint8-base64": "^0.1.1"
5454
},
5555
"dependencies": {
Lines changed: 6 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable jest/no-commented-out-tests */
21
// import he from 'he';
32

43
import { parse } from '../parse';
@@ -18,7 +17,7 @@ describe('XMLParser', () => {
1817
},
1918
};
2019

21-
let result = parse(xmlData, {
20+
const result = parse(xmlData, {
2221
attributeNamePrefix: '',
2322
ignoreAttributes: false,
2423
dynamicTypingAttributeValue: true,
@@ -42,7 +41,7 @@ describe('XMLParser', () => {
4241
},
4342
};
4443

45-
let result = parse(xmlData, {
44+
const result = parse(xmlData, {
4645
attributeNamePrefix: '',
4746
ignoreAttributes: false,
4847
dynamicTypingAttributeValue: true,
@@ -66,7 +65,7 @@ describe('XMLParser', () => {
6665
},
6766
};
6867

69-
let result = parse(xmlData, {
68+
const result = parse(xmlData, {
7069
attributeNamePrefix: '',
7170
ignoreAttributes: false,
7271
dynamicTypingAttributeValue: true,
@@ -91,7 +90,7 @@ describe('XMLParser', () => {
9190
},
9291
};
9392

94-
let result = parse(xmlData, {
93+
const result = parse(xmlData, {
9594
attributeNamePrefix: '',
9695
ignoreAttributes: false,
9796
dynamicTypingAttributeValue: true,
@@ -118,7 +117,7 @@ describe('XMLParser', () => {
118117
},
119118
};
120119

121-
let result = parse(xmlData, {
120+
const result = parse(xmlData, {
122121
attributeNamePrefix: '',
123122
ignoreAttributes: false,
124123
});
@@ -143,181 +142,12 @@ describe('XMLParser', () => {
143142
},
144143
};
145144

146-
let result = parse(xmlData, {
145+
const result = parse(xmlData, {
147146
attributeNamePrefix: '',
148147
ignoreAttributes: false,
149148
ignoreNameSpace: true,
150149
});
151150

152151
expect(result).toStrictEqual(expected);
153-
154-
// result = validator.validate(xmlData, {
155-
// allowBooleanAttributes: true,
156-
// });
157-
// // expect(result).toBe(true);
158152
});
159-
160-
// it('should not parse attributes with name start with number', () => {
161-
// const xmlData = encoder.encode(
162-
// `<issue 35entity="Mjg2MzY2OTkyNA==" ></issue>`,
163-
// );
164-
165-
// const expected = {
166-
// err: {
167-
// code: 'InvalidAttr',
168-
// msg: "Attribute '35entity' is an invalid name.",
169-
// line: 1,
170-
// },
171-
// };
172-
// const result = validator.validate(xmlData);
173-
174-
// expect(result).toStrictEqual(expected);
175-
// });
176-
177-
// it('should not parse attributes with invalid char', () => {
178-
// const xmlData = encoder.encode(
179-
// `<issue enti+ty="Mjg2MzY2OTkyNA=="></issue>`,
180-
// );
181-
// const expected = {
182-
// err: {
183-
// code: 'InvalidAttr',
184-
// msg: "Attribute 'enti+ty' is an invalid name.",
185-
// line: 1,
186-
// },
187-
// };
188-
189-
// const result = validator.validate(xmlData);
190-
191-
// expect(result).toStrictEqual(expected);
192-
// });
193-
194-
// it('should not parse attributes in closing tag', () => {
195-
// const xmlData = encoder.encode(`<issue></issue invalid="true">`);
196-
// const expected = {
197-
// err: {
198-
// code: 'InvalidTag',
199-
// msg: "Closing tag 'issue' can't have attributes or invalid starting.",
200-
// line: 1,
201-
// },
202-
// };
203-
// const result = validator.validate(xmlData);
204-
205-
// expect(result).toStrictEqual(expected);
206-
// });
207-
208-
// it('should err for invalid atributes', () => {
209-
// const xmlData = encoder.encode(`<rootNode =''></rootNode>`);
210-
// const expected = {
211-
// err: {
212-
// code: 'InvalidAttr',
213-
// msg: "Attribute '''' has no space in starting.",
214-
// line: 1,
215-
// },
216-
// };
217-
// const result = validator.validate(xmlData);
218-
// expect(result).toStrictEqual(expected);
219-
// });
220-
221-
// it('should validate xml with atributes', () => {
222-
// const xmlData = encoder.encode(
223-
// `<rootNode attr="123"><tag></tag><tag>1</tag><tag>val</tag></rootNode>`,
224-
// );
225-
226-
// const result = validator.validate(xmlData);
227-
// expect(result).toBe(true);
228-
// });
229-
230-
// it("should validate xml atribute has '>' in value", () => {
231-
// const xmlData = encoder.encode(
232-
// `<rootNode attr="123>234"><tag></tag><tag>1</tag><tag>val</tag></rootNode>`,
233-
// );
234-
235-
// const result = validator.validate(xmlData);
236-
// expect(result).toBe(true);
237-
// });
238-
239-
// it('should not validate xml with invalid atributes', () => {
240-
// const xmlData = encoder.encode(
241-
// `<rootNode attr="123><tag></tag><tag>1</tag><tag>val</tag></rootNode>`,
242-
// );
243-
// const expected = {
244-
// err: {
245-
// code: 'InvalidAttr',
246-
// msg: "Attributes for 'rootNode' have open quote.",
247-
// line: 1,
248-
// },
249-
// };
250-
// const result = validator.validate(xmlData);
251-
// expect(result).toStrictEqual(expected);
252-
// });
253-
254-
// it('should not validate xml with invalid attributes when duplicate attributes present', () => {
255-
// const xmlData = encoder.encode(`<rootNode abc='123' abc="567" />`);
256-
// const expected = {
257-
// err: {
258-
// code: 'InvalidAttr',
259-
// msg: "Attribute 'abc' is repeated.",
260-
// line: 1,
261-
// },
262-
// };
263-
// const result = validator.validate(xmlData);
264-
// //console.log(JSON.stringify(result,null,4));
265-
// expect(result).toStrictEqual(expected);
266-
// });
267-
268-
// it('should not validate xml with invalid attributes when no space between 2 attributes', () => {
269-
// const xmlData = encoder.encode(`<rootNode abc='123'bc='567' />`);
270-
// const expected = {
271-
// err: {
272-
// code: 'InvalidAttr',
273-
// msg: "Attribute 'bc' has no space in starting.",
274-
// line: 1,
275-
// },
276-
// };
277-
// const result = validator.validate(xmlData);
278-
// expect(result).toStrictEqual(expected);
279-
// });
280-
281-
// it('should not validate a tag with attribute presents without value', () => {
282-
// const xmlData = encoder.encode(`<rootNode ab cd='ef'></rootNode>`);
283-
// const expected = {
284-
// err: {
285-
// code: 'InvalidAttr',
286-
// msg: "boolean attribute 'ab' is not allowed.",
287-
// line: 1,
288-
// },
289-
// };
290-
// const result = validator.validate(xmlData);
291-
// expect(result).toStrictEqual(expected);
292-
// });
293-
294-
// it('should not validate xml with invalid attributes presents without value', () => {
295-
// const xmlData = encoder.encode(`<rootNode 123 abc='123' bc='567' />`);
296-
// const expected = {
297-
// err: {
298-
// code: 'InvalidAttr',
299-
// // "msg": "attribute 123 is an invalid name."
300-
// msg: "boolean attribute '123' is not allowed.",
301-
// line: 1,
302-
// },
303-
// };
304-
// const result = validator.validate(xmlData);
305-
// //console.log(JSON.stringify(result,null,4));
306-
// expect(result).toStrictEqual(expected);
307-
// });
308-
309-
// it('should validate xml with attributeshaving openquote in value', () => {
310-
// const xmlData = encoder.encode('<rootNode 123 abc=\'1"23\' bc="56\'7" />');
311-
// const expected = {
312-
// err: {
313-
// code: 'InvalidAttr',
314-
// // "msg": "attribute 123 is an invalid name."
315-
// msg: "boolean attribute '123' is not allowed.",
316-
// line: 1,
317-
// },
318-
// };
319-
// const result = validator.validate(xmlData);
320-
// //console.log(JSON.stringify(result,null,4));
321-
// expect(result).toStrictEqual(expected);
322-
//});
323153
});

src/__tests__/cdataSpec.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('XMLParser', () => {
1010
const xmlData = encoder.encode(`<?xml version='1.0'?><root><person>lastname
1111
firstname
1212
patronymic</person></root>`);
13-
let result = parse(xmlData, {
13+
const result = parse(xmlData, {
1414
ignoreAttributes: false,
1515
});
1616

@@ -45,7 +45,7 @@ patronymic</person></root>`);
4545
},
4646
},
4747
};
48-
let result = parse(xmlData, {
48+
const result = parse(xmlData, {
4949
ignoreAttributes: false,
5050
});
5151

@@ -78,7 +78,7 @@ patronymic</person></root>`);
7878
},
7979
};
8080

81-
let result = parse(xmlData, {
81+
const result = parse(xmlData, {
8282
ignoreAttributes: false,
8383
});
8484

@@ -105,7 +105,7 @@ patronymic</person></root>`);
105105
},
106106
};
107107

108-
let result = parse(xmlData, {
108+
const result = parse(xmlData, {
109109
ignoreAttributes: false,
110110
});
111111

@@ -126,7 +126,7 @@ patronymic</person></root>`);
126126
},
127127
};
128128

129-
let result = parse(xmlData, {
129+
const result = parse(xmlData, {
130130
ignoreAttributes: false,
131131
});
132132

@@ -147,7 +147,7 @@ patronymic</person></root>`);
147147
},
148148
};
149149

150-
let result = parse(xmlData, {
150+
const result = parse(xmlData, {
151151
ignoreAttributes: false,
152152
});
153153

src/__tests__/cheminfo.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-tabs */
2-
31
import { parse } from '../parse';
42

53
describe('XMLParser', () => {
@@ -11,7 +9,7 @@ describe('XMLParser', () => {
119

1210
const expected = { AAA: { '#text': 12345678, AB: '' } };
1311

14-
let result = parse(xmlData, {});
12+
const result = parse(xmlData, {});
1513

1614
expect(result).toStrictEqual(expected);
1715
});

src/__tests__/data.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable jest/no-identical-title */
21
import { parse } from '../parse';
32

43
const encoder = new TextEncoder();
@@ -21,7 +20,7 @@ describe('XMLParser', () => {
2120
},
2221
};
2322

24-
let result = parse(xmlData, {
23+
const result = parse(xmlData, {
2524
attributeNamePrefix: '',
2625

2726
//dynamicTypingAttributeValue: true
@@ -60,7 +59,7 @@ describe('XMLParser', () => {
6059
},
6160
};
6261

63-
let result = parse(xmlData, {
62+
const result = parse(xmlData, {
6463
//attributeNamePrefix: "",
6564

6665
//dynamicTypingAttributeValue: true,
@@ -70,7 +69,7 @@ describe('XMLParser', () => {
7069
expect(result).toStrictEqual(expected);
7170
});
7271

73-
it('should parse attributes with correct names', () => {
72+
it('should parse attributes with correct names 2', () => {
7473
const xmlData =
7574
encoder.encode(`<a:root xmlns:a="urn:none" xmlns:a-b="urn:none">
7675
<a:a attr="2foo&ampbar&apos;">1</a:a>
@@ -103,7 +102,7 @@ describe('XMLParser', () => {
103102
},
104103
},
105104
};
106-
let result = parse(xmlData, {
105+
const result = parse(xmlData, {
107106
//attributeNamePrefix: "",
108107

109108
//dynamicTypingAttributeValue: true,
@@ -125,7 +124,7 @@ describe('XMLParser', () => {
125124
},
126125
};
127126

128-
let result = parse(xmlData, {
127+
const result = parse(xmlData, {
129128
allowBooleanAttributes: true,
130129
});
131130

0 commit comments

Comments
 (0)