is-urlsearchparams
Determines whether a value is a URLSearchParams instance.
Last updated 6 years ago by stevenvachon .
MIT · Repository · Bugs · Original npm
$ cnpm 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

  • 1.0.1                                ...           latest (6 years ago)

1 Versions

  • 1.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (15)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org