
| Current Path : /usr/share/nodejs/isurl/node_modules/is-urlsearchparams/lib/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //usr/share/nodejs/isurl/node_modules/is-urlsearchparams/lib/index.js |
"use strict";
const hasToStringTag = require("has-to-string-tag-x");
const isObject = require("is-object");
const {lenientProperties, strictProperties} = require("./props");
const searchParamsClass = "[object URLSearchParams]";
const toStringTag = Object.prototype.toString;
const isURLSearchParams = (searchParams, supportIncomplete=false) =>
{
if (!isObject(searchParams))
{
return false;
}
else if (hasToStringTag && toStringTag.call(searchParams)!==searchParamsClass)
{
// Shimmed implementation with incorrect constructor name
return false;
}
else if (!strictProperties.every(prop => prop in searchParams))
{
return false;
}
else if (supportIncomplete)
{
return true;
}
else
{
return lenientProperties.every(prop => prop in searchParams);
}
};
isURLSearchParams.lenient = searchParams => isURLSearchParams(searchParams, true);
module.exports = isURLSearchParams;