Socket
Socket
Sign inDemoInstall

data-uri-to-buffer

Package Overview
Dependencies
0
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.1 to 4.0.0

dist/index.d.ts

20

dist/src/index.d.ts

@@ -0,1 +1,7 @@

/// <reference types="node" />
export interface MimeBuffer extends Buffer {
type: string;
typeFull: string;
charset: string;
}
/**

@@ -5,14 +11,6 @@ * Returns a `Buffer` instance from the given data URI `uri`.

* @param {String} uri Data URI to turn into a Buffer instance
* @return {Buffer} Buffer instance from Data URI
* @returns {Buffer} Buffer instance from Data URI
* @api public
*/
/// <reference types="node" />
declare function dataUriToBuffer(uri: string): dataUriToBuffer.MimeBuffer;
declare namespace dataUriToBuffer {
interface MimeBuffer extends Buffer {
type: string;
typeFull: string;
charset: string;
}
}
export = dataUriToBuffer;
export declare function dataUriToBuffer(uri: string): MimeBuffer;
export default dataUriToBuffer;

@@ -1,2 +0,1 @@

"use strict";
/**

@@ -6,6 +5,6 @@ * Returns a `Buffer` instance from the given data URI `uri`.

* @param {String} uri Data URI to turn into a Buffer instance
* @return {Buffer} Buffer instance from Data URI
* @returns {Buffer} Buffer instance from Data URI
* @api public
*/
function dataUriToBuffer(uri) {
export function dataUriToBuffer(uri) {
if (!/^data:/i.test(uri)) {

@@ -54,3 +53,3 @@ throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');

}
module.exports = dataUriToBuffer;
export default dataUriToBuffer;
//# sourceMappingURL=index.js.map
{
"name": "data-uri-to-buffer",
"version": "3.0.1",
"version": "4.0.0",
"description": "Generate a Buffer instance from a Data URI string",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/src"
"dist",
"src"
],
"scripts": {
"build": "tsc",
"test": "mocha --reporter spec dist/test/*.js",
"test-lint": "eslint src --ext .js,.ts",
"test": "jest",
"prepublishOnly": "npm run build"

@@ -21,3 +22,3 @@ },

"engines": {
"node": ">= 6"
"node": ">= 12"
},

@@ -42,16 +43,22 @@ "keywords": [

"@types/es6-promisify": "^5.0.0",
"@types/mocha": "^5.2.7",
"@types/mocha": "^9.0.0",
"@types/node": "^10.5.3",
"@typescript-eslint/eslint-plugin": "1.6.0",
"@typescript-eslint/parser": "1.1.0",
"eslint": "5.16.0",
"eslint-config-airbnb": "17.1.0",
"eslint-config-prettier": "4.1.0",
"eslint-import-resolver-typescript": "1.1.1",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-react": "7.12.4",
"mocha": "^6.2.0",
"typescript": "^3.5.3"
"jest": "^27.2.2",
"ts-jest": "^27.0.5",
"typescript": "^4.4.3"
},
"jest": {
"preset": "ts-jest",
"globals": {
"ts-jest": {
"diagnostics": false,
"isolatedModules": true
}
},
"verbose": false,
"testEnvironment": "node",
"testMatch": [
"<rootDir>/test/**/*.test.ts"
]
}
}

Sorry, the diff of this file is not supported yet

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