Socket
Book a DemoInstallSign in
Socket

@shapediver/viewer.utils.mime-type

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shapediver/viewer.utils.mime-type

This package is part of the [`@shapediver/viewer`](https://www.npmjs.com/package/@shapediver/viewer). It is used to expand the format property of the [ShapeDiver](www.shapediver.com) file parameters. Additionally, it can be used to to find additional mi

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
294
-14.29%
Maintainers
0
Weekly downloads
 
Created
Source

@shapediver/viewer.utils.mime-type

This package is part of the @shapediver/viewer. It is used to expand the format property of the ShapeDiver file parameters. Additionally, it can be used to to find additional mime-types for provided file endings.

Install

npm install @shapediver/viewer.utils.mime-type

Usage

extendMimeTypes(mimeTypes: string[]): string[]

Returns an extended array of mime types. The provided mime types are are mapped to file endings and the corresponding mime types are added. The types are filtered to only contain unique values.

Example:

import { extendMimeTypes } from "@shapediver/viewer.utils.mime-type"

const currentFormats = ['application/dxf', 'application/x-autocad'];
const completeFormats = extendMimeTypes(currentFormats);

guessMimeTypeFromFilename(filename: string): string[]

Try to guess mime types from a file name

Example:

import { guessMimeTypeFromFilename } from "@shapediver/viewer.utils.mime-type"

const types = guessMimeTypeFromFilename(fileName);

mapMimeTypeToFileEndings(mimeTypes: string[]): string[]

Returns the corresponding file endings for each mime type.

Example:

import { mapMimeTypeToFileEndings } from "@shapediver/viewer.utils.mime-type"

const currentFormats = ['model/vnd.sdtf'];
const fileEndings = mapMimeTypeToFileEndings(currentFormats);

FAQs

Package last updated on 21 Jun 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.