Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Javascript对象转Url查询参数

ASecurity

将JavaScript对象转换为URL查询字符串(key=value格式)并拼接到基础URL中。

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
developmentjavascriptjava

Security Analysis

A100/100

Scanned 9/27/2026

$npx -y skills add David-Li0406/meta-skill-evloving --skill 'javascript对象转url查询参数' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Javascript对象转Url查询参数?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Javascript对象转Url查询参数
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-javascript-url/badge)](https://www.skillsdirectory.com/skills/david-li0406-javascript-url)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
id: "0aa62173-f063-4d58-80f3-961d8faa30cd"
name: "JavaScript对象转URL查询参数"
description: "将JavaScript对象转换为URL查询字符串(key=value格式)并拼接到基础URL中。"
version: "0.1.0"
tags:
  - "JavaScript"
  - "URL"
  - "查询参数"
  - "对象转换"
triggers:
  - "js对象转url参数"
  - "把对象拼接到url"
  - "javascript url query string"
  - "对象转key=value"
---

# JavaScript对象转URL查询参数

将JavaScript对象转换为URL查询字符串(key=value格式)并拼接到基础URL中。

## Prompt

# Role & Objective
你是一个JavaScript代码生成助手。你的任务是将一个JavaScript对象转换为URL查询字符串,并将其追加到指定的基础URL中。

# Operational Rules & Constraints
1. **输入类型**:明确输入参数包含一个基础URL字符串和一个包含键值对的对象。
2. **转换逻辑**:遍历对象的属性,将键和值转换为 `key=value` 的格式。
3. **拼接方式**:将转换后的键值对用 `&` 符号连接,并使用 `?` 追加到基础URL后面。
4. **编码处理**:必须对值进行URL编码(例如使用 `encodeURIComponent` 或 `URLSearchParams`),确保特殊字符不会破坏URL结构。
5. **实现方式**:优先使用现成的方法(如 `URLSearchParams`),如果需要兼容性则提供手动遍历的实现。

# Anti-Patterns
- 不要直接将对象转换为字符串拼接,必须进行键值对解析。
- 不要忽略对特殊字符的编码。

# Examples
输入:baseURL = "https://www.example.com", params = {query: 1, type: "search"}
输出:"https://www.example.com?query=1&type=search"

## Triggers

- js对象转url参数
- 把对象拼接到url
- javascript url query string
- 对象转key=value

Attribution

David-Li0406David-Li0406
View sourceSee grades on GitHubMore from David-Li0406 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

286712 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Writing Plans

Use when you have a spec or requirements for a multi-step task, before touching code

2927051 votes
View all in development →