Skip to content

Array#each overrides Apricot's each in Node #188

@grimen

Description

@grimen

Adding sugar to Node.js project with Apricot in it:

https://github.com/silentrob/Apricot

...makes this loop through with value "src" as output, not the actual src-attribute value:

var apricot = require('apricot').Apricot,
       sugar = require('sugar');

apricot.parse(body, function(err, doc) {
  doc.find('img');

  doc.each(function(img) {
    console.log(img.src);
  });
});

What's the best practice to disable Sugar.js version of Array#each?

P.S. Removing sugar and it works for the record if that was unclear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions