Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clipboard-parser

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clipboard-parser

剪贴板内容解析器

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

clipboard-parser

支持解析@RequestParam/@ApiModelProperty 接口定义代码、Word、Excel 以及其他表格类数据

NPM version Codacy Badge build status Test coverage David deps Known Vulnerabilities npm download gzip License

Sonar

完整文档请查阅: API 完整文档

安装

# 通过npm安装
npm install -S clipboard-parser

# 或者通过yarn安装
yarn add clipboard-parser

使用

# vue页面
<template>
    <textarea @paste="handlePaste"></textarea>
</template>
<script>
import clipboardParser from 'clipboard-parser'
export default {
    methods: {
        handlePaste(e) {
            const result = clipboardParser(e)
            // ...
        }
    }
}
</script>

示例

1. 解析@RequestParam 格式代码

输入

@RequestParam("rowCount")
@ApiParam(required = false, name = "rowCount", value = "每页容量大小",defaultValue = 10)
    String rowCount,
@RequestParam(value = "current")
@ApiParam(required = false, name = "current", value = "开始页",defaultValue = 1)
    String current,

返回结果

[
    {
        "type": "String",
        "required": true,
        "name": "rowCount",
        "defaultValue": 10,
        "description": "每页容量大小"
    },
    {
        "type": "String",
        "required": true,
        "name": "current",
        "defaultValue": 1,
        "description": "开始页"
    }
]

2. 解析@ApiModelProperty 格式代码

输入

@ApiModelProperty(value = "id主键", required = true)
    private String id;
@ApiModelProperty(value = "名称")
    private String name;

返回结果

[
    {
        "required": true,
        "type": "String",
        "description": "id主键",
        "defaultValue": "",
        "name": "id"
    },
    {
        "required": true,
        "type": "String",
        "description": "名称",
        "defaultValue": "",
        "name": "name"
    }
]

3. 解析 word/excel/网页 table 等表格类数据

输入

参数说明类型可选值必填默认
type分支类型Stringfeature/bugfix/supportfalse当前分支类型
name分支名称String-false当前分支名称

返回结果

[
    {
        "name": "type",
        "type": "String",
        "required": false,
        "defaultValue": "",
        "description": "分支类型"
    },
    {
        "name": "name",
        "type": "String",
        "required": false,
        "defaultValue": "",
        "description": "分支名称"
    }
]

Keywords

FAQs

Package last updated on 21 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc