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

google-cloud-bucket

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-cloud-bucket - npm Package Compare versions

Comparing version 0.15.2 to 0.15.3

src/utils/fileHelper.js

9

CHANGELOG.md

@@ -5,2 +5,11 @@ # Changelog

### [0.15.3](https://github.com/nicolasdao/google-cloud-bucket/compare/v0.15.2...v0.15.3) (2019-11-07)
### Bug Fixes
* Some popular file extensions are not supported (e.g., '.webp') ([c29b4a6](https://github.com/nicolasdao/google-cloud-bucket/commit/c29b4a6))
### [0.15.2](https://github.com/nicolasdao/google-cloud-bucket/compare/v0.15.1...v0.15.2) (2019-10-27)

@@ -7,0 +16,0 @@

3

package.json
{
"name": "google-cloud-bucket",
"version": "0.15.2",
"version": "0.15.3",
"description": "Nodejs package to manage Google Cloud Buckets and its objects.",

@@ -48,2 +48,3 @@ "main": "index.js",

"google-auto-auth": "^0.10.1",
"mime-types": "^2.1.24",
"node-fetch": "^2.2.0",

@@ -50,0 +51,0 @@ "shortid": "^2.2.13"

@@ -14,3 +14,4 @@ /**

promise: require('./promise'),
urlHelper: require('./urlHelper')
urlHelper: require('./urlHelper'),
fileHelper: require('./fileHelper')
})
const url = require('url')
const path = require('path')
const { getMimeType } = require('./fileHelper')

@@ -80,3 +81,4 @@ const getUrlInfo = (uri, option={}) => {

ext == '.tif' ||
ext == '.tiff'
ext == '.tiff' ||
ext == '.webp'

@@ -104,63 +106,2 @@ const isPopularFontExt = ext =>

const _supportedContentType = {
// web pages
'.asp': 'text/html',
'.aspx': 'text/html',
'.axd': 'text/html',
'.asx': 'text/html',
'.asmx': 'text/html',
'.ashx': 'text/html',
'.yaws': 'text/html',
'.html': 'text/html',
'.htm': 'text/html',
'.xhtml': 'text/html',
'.jhtml': 'text/html',
'.jsp': 'text/html',
'.jspx': 'text/html',
'.pl': 'text/html',
'.php': 'text/html',
'.php4': 'text/html',
'.php3': 'text/html',
'.phtml': 'text/html',
'.py': 'text/html',
'.rb': 'text/html',
'.rhtml': 'text/html',
'.shtml': 'text/html',
// web files
'.css': 'text/css',
'.js': 'text/javascript',
'.json': 'application/json',
'.xml': 'text/xml',
'.rss': 'text/xml',
'.pdf': 'application/pdf',
'.doc': 'application/msword',
'.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'.xls': 'application/vnd.ms-excel',
'.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'.ppt': 'application/vnd.ms-powerpoint',
'.pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'.csv': 'text/csv',
// images
'.ai': 'application/postscript',
'.bmp': 'image/bmp',
'.gif': 'image/gif',
'.ico': 'image/x-icon',
'.jpeg': 'image/jpeg',
'.jpg': 'image/jpeg',
'.png': 'image/png',
'.ps': 'application/postscript',
'.psd': 'application/octet-stream',
'.svg': 'image/svg+xml',
'.tif': 'image/tiff',
'.tiff': 'image/tiff',
// font
'.eot': 'application/vnd.ms-fontobject',
'.woff2': 'font/woff2',
'.woff': 'application/font-woff',
'.ttf': 'application/font-sfnt',
'.otf': 'application/font-sfnt',
// text
'.txt': 'text/plain',
'.md': 'text/plain'
}
const _getContentType = (ext) => {

@@ -170,3 +111,3 @@ if (!ext)

const contentType = _supportedContentType[ext.toLowerCase()]
const contentType = getMimeType(ext.toLowerCase().replace(/^\./, ''))
return contentType || 'application/octet-stream'

@@ -173,0 +114,0 @@ }

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