Skip to content

Commit

Permalink
Merge pull request #137 from hexojs/dependabot/npm_and_yarn/camaro-5.0.0
Browse files Browse the repository at this point in the history
chore(deps-dev): bump camaro from 4.2.0 to 5.0.0
  • Loading branch information
SukkaW authored Apr 29, 2020
2 parents 42d865e + 0d9410e commit ac3e7da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"camaro": "^4.1.2",
"camaro": "^5.0.0",
"chai": "^4.2.0",
"cheerio": "^0.22.0",
"eslint": "^6.0.1",
Expand Down
4 changes: 3 additions & 1 deletion test/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/


const { transform } = require('camaro');
const { ready, transform } = require('camaro');

const template = {
rss: {
Expand Down Expand Up @@ -53,6 +53,7 @@ const template = {
};

const detectFeedType = async xml => {
await ready();
const sample = await transform(xml, {
rss: 'rss/channel/title',
atom: 'feed/title'
Expand All @@ -64,6 +65,7 @@ const detectFeedType = async xml => {
};

const parseFeed = async xml => {
await ready();
const type = await detectFeedType(xml);
const output = await transform(xml, template[type]);
return output;
Expand Down

0 comments on commit ac3e7da

Please sign in to comment.