Skip to content

Commit 9ccaaa4

Browse files
committedJul 13, 2023
address subdep security issues
1 parent 14c660c commit 9ccaaa4

File tree

4 files changed

+1436
-911
lines changed

4 files changed

+1436
-911
lines changed
 

‎package-lock.json

+1,420-901
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@open-automaton/automaton-engine",
33
"homepage": "https://github.com/open-automaton/automaton-engine",
4-
"version": "0.0.9",
4+
"version": "0.1.0",
55
"main": "src/automaton-engine.js",
66
"description": "A base class for scraping engines",
77
"keywords": [],
@@ -17,7 +17,11 @@
1717
},
1818
"dependencies": {
1919
"clone": "^2.1.2",
20-
"libxmljs": "^0.19.7"
20+
"libxmljs": "^1.0.9",
21+
"libxmljs2": "^0.32.0"
22+
},
23+
"scripts": {
24+
"test": "mocha test/test.js"
2125
},
2226
"devDependencies": {
2327
"body-parser": "^1.19.1",

‎src/dom-tool.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ DOM.next = function(node){
5454
return node.next;
5555
};
5656
DOM.xpathText = function(selector, value){
57-
if(!libs.libxmljs) libs.libxmljs = require("libxmljs");
57+
if(!libs.libxmljs) libs.libxmljs = require("libxmljs2");
5858
var xmlDoc = libs.libxmljs.parseHtmlString(value);
5959
var result = xmlDoc.find(selector);
6060
var results = [];

‎test/test.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
const should = require('chai').should();
2-
const path = require('path');
3-
const Automaton = require('@open-automaton/automaton');
4-
const fs = require('fs');
5-
const express = require('express');
6-
const bodyParser = require('body-parser');
2+
const { DOM } = require('../src/dom-tool.js');
73

84
describe('strip-mine', function(){
95
describe('automaton', function(){
10-
it.skip('generic test', function(done){
11-
6+
it('xpath works', function(){
7+
const result = DOM.xpathText(
8+
'//bar/baz/text()',
9+
'<foo><bar><baz>woot</baz></bar></foo>'
10+
);
11+
result.length.should.equal(1);
12+
should.exist(result[0]);
13+
result[0].should.equal('woot');
1214
});
1315
});
1416
});

0 commit comments

Comments
 (0)
Please sign in to comment.