andris9/NodePie

Object xxx has no method 'trim' error against Atom 1.0 feed

Closed this issue · 2 comments

m1ci commented

Hi!

I tried the usage example and I get following error:

node.js:205
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object

    <title>Example Feed</title>
    <subtitle>A subtitle.</subtitle>
    <link href="http://example.org/feed/" rel="self" />
    <link href="http://example.org/" />
    <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
    <updated>2003-12-13T18:30:02Z</updated>
    <author>
            <name>John Doe</name>
            <email>johndoe@example.com</email>
    </author>

    <entry>
            <title>Atom-Powered Robots Run Amok</title>
            <link href="http://example.org/2003/12/13/atom03" />
            <link rel="alternate" type="text/html" href="http://example.org/2003/12/13/atom03.html"/>
            <link rel="edit" href="http://example.org/2003/12/13/atom03/edit"/>
            <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
            <updated>2003-12-13T18:30:02Z</updated>
            <summary>Some text.</summary>
    </entry>
has no method 'trim' at new NodePie (/home/m1ci/node/Linked-Published-Data/node_modules/NodePie/lib/nodepie.js:25:28) at Object. (/home/m1ci/node/Linked-Published-Data/testnodepie.js:7:8) at Module._compile (module.js:416:26) at Object..js (module.js:434:10) at Module.load (module.js:335:31) at Function._load (module.js:294:12) at Array. (module.js:454:10) at EventEmitter._tickCallback (node.js:197:26)

Hi, I'm not really sure what causes it but probably if you're not dealing with String and Buffer objects but with SlowBuffer etc then it might happen. Anyhow I fixed the trim command to convert input to string first, hope it solved the problem 9c30900

m1ci commented

It works now. Great job!