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 (9 loc) 323 B
var getQuery = require('./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)); } module.exports = contains;