Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@contentful/mimetype
Advanced tools
Mimetype handling and identification
This is mostly used by the UI to figure out which icons to show for different filetypes.
It does a best effort guess to figure out which icon to show, which might not always come out very accurate.
It should be updated over time with relevant file types and mime types and it is by no means a definitive representation of all available file types.
fileGroups.json
and groupNames.json
The methods that take this object as a parameter will always try to use the type if available. If the type is not available or is undefined, it will use the file extension as a fallback. You can also provide a fallback file name from which the extension will be extracted if not provided.
/**
* @typedef {object} mimetypeParams
* @prop {string} type Content MIME type
* @prop {string} fallbackExt Fallback extension
* @prop {string} fallbackFileName Fallback file name
*/
/**
* Gets list of names for groups of mimetypes
*
* @returns {object}
*/
/**
* Gets name of group file belongs to
*
* @param {mimetypeParams} mimetypeParams MIME type parameters
* @returns {string}
*/
/**
* Gets list of labels for groups
*
* @returns {array}
*/
/**
* Gets label for group the file belongs to
*
* @param {mimetypeParams} mimetypeParams MIME type parameters
* @returns {string}
*/
/**
* Gets extension for a given filename
*
* @param {string} fileName
* @returns {string} Extracted extension
*/
/**
* Gets list of mimetypes for a group
*
* @param {string} groupLabel
* @returns {array}
*/
/**
* Checks if file type is considered previewable
*
* @param {mimetypeParams} mimetypeParams MIME type parameters
* @returns {boolean}
*/
/**
* Checks if type exists
*
* @param {mimetypeParams} mimetypeParams MIME type parameters
* @returns {boolean}
*/
/**
* Gets list of types for all groups
*
* @returns {array}
*/
This repository is published under the MIT license.
FAQs
"Identify mimetypes and associate them with filegroups"
The npm package @contentful/mimetype receives a total of 8,670 weekly downloads. As such, @contentful/mimetype popularity was classified as popular.
We found that @contentful/mimetype demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.