to-query:从请求网址获取查询对象

时间:2021-05-13 00:18:48
【文件属性】:
文件名称:to-query:从请求网址获取查询对象
文件大小:102KB
文件格式:ZIP
更新时间:2021-05-13 00:18:48
JavaScript 从请求网址获取查询对象作为输入。 强调 获取任何URL的查询参数。 例如。 /?foo=bar → { foo: 'bar' } 将密钥标准化为驼峰式大小写。 例如。 /?user_agent=googlebot → { userAgent: 'googlebot' } 自动将值转换为本机类型。 例如。 /?plan_id=123 → { planId: 123 } 友好的布尔值。 例如。 /?is_enabled → { isEnabled: true } 声明默认值。 例如。 /? → { accept: '*' } 它还支持必填字段,验证,错误处理等。 安装 $ npm install to-query --save 开始使用 to-query是一种从任何请求url中获取查询参数作为输入的便捷方法。 const toQuery = require ( 'to-query'
【文件预览】:
to-query-master
----.travis.yml(698B)
----index.js(525B)
----normalize.js(794B)
----package.json(3KB)
----parse.js(383B)
----.github()
--------dependabot.yml(257B)
----test()
--------index.js(2KB)
--------normalize.js(714B)
--------parse.js(800B)
--------map.js(373B)
----media()
--------logo.svg(7KB)
--------logo.jpg(28KB)
--------logo.png(28KB)
--------logo.sketch(37KB)
----LICENSE(1KB)
----.bumpedrc(738B)
----.gitignore(463B)
----map.js(184B)
----CHANGELOG.md(5KB)
----benchmark.js(377B)
----.npmrc(59B)
----README.md(5KB)
----.editorconfig(324B)
----.gitattributes(12B)

网友评论