is-urlsearchparams
Determines whether a value is a URLSearchParams instance.
Last updated 6 years ago by stevenvachon .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-urlsearchparams 
SYNC missed versions from official npm registry.

is-urlsearchparams NPM Version File Size Build Status Dependency Monitor

Determines whether a value is a URLSearchParams instance.

Works cross-realm/iframe and despite Symbol.toStringTag.

Installation

Node.js >= 8 is required. To install, type this at the command line:

npm install is-urlsearchparams

Usage

const isURLSearchParams = require('is-urlsearchparams');

isURLSearchParams('param=value');  //-> false
isURLSearchParams(new URLSearchParams('param=value'));  //-> true

Optionally, acceptance can be extended to incomplete URLSearchParams implementations that lack entries, sort and values methods (which are common in many modern web browsers):

const params = new URLSearchParams('param=value');

console.log(params.sort);  //-> undefined

isURLSearchParams.lenient(params);  //-> true

Current Tags

  • 2.0.0                                ...           latest (3 months ago)
  • 2.0.0-rc                                ...           rc (3 months ago)

5 Versions

  • 2.0.0                                ...           3 months ago
  • 2.0.0-rc [deprecated]           ...           3 months ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Total 13
Today 0
This Week 0
This Month 12
Last Day 0
Last Week 8
Last Month 0
Dependencies (2)
Dev Dependencies (15)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE