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

@b613/utils

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@b613/utils - npm Package Compare versions

Comparing version 1.0.0-alpha7 to 1.0.0-alpha8

16

lib/image/image.browser.js
import { __awaiter } from "tslib";
export { base64MimeType } from './common';
const EventOptions = {
once: true,
};
const REGEX = /^data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+);base64,(.+)/;
export function base64MimeType(encoded) {
if (typeof encoded !== 'string') {
return null;
}
const matches = encoded.match(REGEX);
if (matches === null || matches === void 0 ? void 0 : matches.length) {
return {
mime: matches[1],
data: encoded,
raw: matches[2],
};
}
return null;
}
/**

@@ -7,0 +21,0 @@ * Compress an input image's dataurl with resizing & image quality compression

@@ -8,5 +8,19 @@ "use strict";

const jimp_1 = tslib_1.__importDefault(require("jimp"));
var common_1 = require("./common");
Object.defineProperty(exports, "base64MimeType", { enumerable: true, get: function () { return common_1.base64MimeType; } });
const download = require('image-downloader');
const REGEX = /^data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+);base64,(.+)/;
function base64MimeType(encoded) {
if (typeof encoded !== 'string') {
return null;
}
const matches = encoded.match(REGEX);
if (matches === null || matches === void 0 ? void 0 : matches.length) {
return {
mime: matches[1],
data: encoded,
raw: matches[2],
};
}
return null;
}
exports.base64MimeType = base64MimeType;
function parseBase64(imageUrl, resizeWidth) {

@@ -13,0 +27,0 @@ return tslib_1.__awaiter(this, void 0, void 0, function* () {

2

package.json
{
"name": "@b613/utils",
"version": "1.0.0-alpha7",
"version": "1.0.0-alpha8",
"description": "Set of utility methods for common operations",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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