3 ms·
Totally get that-- if it's the style you're comfortable with, go for it. Hope I didn't sound critical, just curious. Although if I may, there is a potential be
by Cushman 15y ago
Totally get that-- if it's the style you're comfortable with, go for it. Hope I didn't sound critical, just curious.
Although if I may, there is a potential benefit to using strings there in that it lets you get rid of the switch statement entirely:
unless config.clip of ClipHelpers
throw new Error "No clip mode '#{config.clip}'. Available modes are #{(k for k of ClipHelpers).join(', ')}"
clipHelper = ClipHelpers[config.clip]
This could also make it easy for a user to add helpers at runtime. Maybe overkill for this, just something to keep in mind.