UNPKG

tastypie

Version:

Tastypie is a webservice API framework for Node.js based on Django's Tastypie Framework. It provides a convenient, yet powerful and highly customizable, abstraction for creating REST-style interfaces

13 lines (10 loc) 323 B
define(['./getQuery'], function (getQuery) { /** * Checks if query string contains parameter. */ function contains(url, paramName) { var regex = new RegExp('(\\?|&)'+ paramName +'=', 'g'); //matches `?param=` or `&param=` return regex.test(getQuery(url)); } return contains; });