Sha256: f3e25bc60a190cc446f1ef7a4e4c80a4911496b43c59861b31a3324880f5e2fb

Contents?: true

Size: 399 Bytes

Versions: 1

Compression:

Stored size: 399 Bytes

Contents

(@Ultimate ||= {}).Backbone ||= {}

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

1 entries across 1 versions & 1 rubygems

Version Path
ultimate-base-0.2.2 app/assets/javascripts/ultimate/backbone/router.js.coffee