Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detection for Sugar #195

Merged
merged 3 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added icons/sugar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions library/libraries.js
Original file line number Diff line number Diff line change
Expand Up @@ -1862,5 +1862,16 @@ var d41d8cd98f00b204e9800998ecf8427e_LibraryDetectorTests = {

return false;
}
},
'Sugar': {
id: 'sugar',
icon: 'sugar',
url: 'https://sugarjs.com',
npm: 'sugar',
test: function (win) {
if (!win.Sugar) return false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Versions up to 1.3.9 don't seem to include a Sugar global, but instead patch directly onto prototypes. Eg, Array.SugarMethods would exist.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

if (win.Sugar.VERSION) return { version: win.Sugar.VERSION };
return { version: UNKNOWN_VERSION };
}
}
};