stretchr / excerpt-search

Returns a highlighted excerpt from a block of text based on search terms
3 stars 2 forks source link

Consider `Stretchr` namespace #3

Open matryer opened 10 years ago

matryer commented 10 years ago

All our other JS stuff is namespaced under Stretchr:

var Stretchr = Stretchr || {};
Stretchr.excerptSearch = ...
mazondo commented 10 years ago

might could do. I hate polluting global but I've just never seen anyone do that before.

matryer commented 10 years ago

The first PR I always get does this: https://github.com/stretchr/arg.js/blob/master/src/arg.js

i.e. puts it inside (function(global){...})(window);

Not 100% sure why