Sha256: 242bd20ea0da84e597470ad1ac184a9149797aa22d20df9e2ff95623b31b58d2

Contents?: true

Size: 382 Bytes

Versions: 3

Compression:

Stored size: 382 Bytes

Contents

#= require ./base

class Ultimate.Backbone.Router extends Backbone.Router

  namedParam    = /:\w+/g
  splatParam    = /\*\w+/g
  escapeRegExp  = /[-[\]{}()+?.,\\^$|#\s]/g

  _routeToRegExp: (route) ->
    route = route.replace(escapeRegExp, '\\$&')
                 .replace(namedParam, '([^\/]+)')
                 .replace(splatParam, '(.*?)')
    new RegExp("^\/?#{route}\/?$")

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ultimate-base-0.7.2 app/assets/javascripts/ultimate/backbone/router.js.coffee
ultimate-base-0.6.2 app/assets/javascripts/ultimate/backbone/router.js.coffee
ultimate-base-0.6.0 app/assets/javascripts/ultimate/backbone/router.js.coffee