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

copytable

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

copytable - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

31

index.js

@@ -1,16 +0,23 @@

const onpaste = (e) => {
const onpaste = (e, type) => {
if (e.clipboardData) {
// console.log('谷歌')
for (let i = 0, len = e.clipboardData.items.length; i < len; i++) {
const item = e.clipboardData.items[i]
if (item.kind === 'string' && (item.type.match('^text/plain'))) {
item.getAsString((str) => {
const result = str.split('\r\n').filter(v => v).map(v => v.split('\t')) // 分隔回车,过滤空字符串
return result
})
} else if (item.kind === 'file') {
const result = item.getAsFile()
return result
return new Promise((resolve, reject) => {
// e.clipboardData.items[0].getAsString((str) => {
// const result = str.split('\r\n').filter(v => v).map(v => v.split('\t')) // 分隔回车,过滤空字符串
// resolve(result)
// })
for (let i = 0, len = e.clipboardData.items.length; i < len; i++) {
const item = e.clipboardData.items[i]
const isString = !type || (type === 'string')
if (isString && item.kind === 'string' && (item.type.match('^text/plain'))) {
item.getAsString((str) => {
const result = str.split('\r\n').filter(v => v).map(v => v.split('\t'))
resolve(result)
})
} else if (type === 'file' && item.kind === 'file') {
const result = item.getAsFile()
resolve(result)
}
}
}
}).catch((err) => console.log(err))
} else if (window.clipboardData) {

@@ -17,0 +24,0 @@ // console.log('I9及以上')

{
"name": "copytable",
"version": "1.0.0",
"version": "1.0.1",
"description": "This is a method to copy table data and return the processed array.",

@@ -5,0 +5,0 @@ "main": "index.js",

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