Socket
Socket
Sign inDemoInstall

ali-img

Package Overview
Dependencies
1
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.5 to 1.0.6

17

lib/file.js

@@ -6,3 +6,4 @@ const fs = require('fs')

const https = require('https')
const { Transform, Readable } = require('stream')
const Stream = require('stream')
const { Transform, Readable } = Stream
const fileType = require('file-type')

@@ -12,3 +13,3 @@

const { getVal, compose } = require('./util')
const { HTTPError } = require('./error')
const { HTTPError, AliImgError } = require('./error')

@@ -212,8 +213,12 @@ // 请求网络图片时使用的代理信息

let taskList = list.map(({ src, target }) => {
if (src instanceof Readable) {
if (src instanceof Stream) {
return this.putObjectFromStream(src, target)
} else if (/https?:\/\//i.test(src)) {
return this.putObjectFromUrl(src, target)
} else if (typeof src === 'string') {
if (/https?:\/\//i.test(src)) {
return this.putObjectFromUrl(src, target)
} else {
return this.putObject(src, target)
}
} else {
return this.putObject(src, target)
throw new AliImgError('不支持该类型')
}

@@ -220,0 +225,0 @@ })

{
"name": "ali-img",
"version": "1.0.5",
"version": "1.0.6",
"description": "阿里云OSS图片处理工具",

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc