
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
@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"
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 5 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.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.