@dicebear/converter
Advanced tools
Comparing version 5.0.0-alpha.20 to 5.0.0-alpha.21
import { getMimeType } from './utils/mime-type.js'; | ||
import { ensureSize } from './utils/svg.js'; | ||
export const toFormat = function (svg, format, exif) { | ||
const blob = toBlob(svg, format, exif); | ||
return { | ||
toDataUri: async () => toDataUri(await blob), | ||
toFile: async (name) => toFile(await blob, name), | ||
toArrayBuffer: async () => (await blob).arrayBuffer(), | ||
toDataUri: async () => { | ||
return toDataUri(await toBlob(svg, format, exif)); | ||
}, | ||
toFile: async (name) => { | ||
return toFile(await toBlob(svg, format, exif), name); | ||
}, | ||
toArrayBuffer: async () => { | ||
return (await toBlob(svg, format, exif)).arrayBuffer(); | ||
}, | ||
}; | ||
@@ -10,0 +15,0 @@ }; |
@@ -8,7 +8,12 @@ import { promises as fs } from 'node:fs'; | ||
export const toFormat = function (svg, format, exif) { | ||
const blob = toBlob(svg, format, exif); | ||
return { | ||
toDataUri: async () => toDataUri(await blob), | ||
toFile: async (name) => toFile(await blob, name), | ||
toArrayBuffer: async () => (await blob).arrayBuffer(), | ||
toDataUri: async () => { | ||
return toDataUri(await toBlob(svg, format, exif)); | ||
}, | ||
toFile: async (name) => { | ||
return toFile(await toBlob(svg, format, exif), name); | ||
}, | ||
toArrayBuffer: async () => { | ||
return (await toBlob(svg, format, exif)).arrayBuffer(); | ||
}, | ||
}; | ||
@@ -15,0 +20,0 @@ }; |
@@ -1,3 +0,3 @@ | ||
export declare type ToFormat = (svg: string, format: Format, exif?: Exif) => BinaryResult; | ||
export interface BinaryResult { | ||
export declare type ToFormat = (svg: string, format: Format, exif?: Exif) => Result; | ||
export interface Result { | ||
toDataUri(): Promise<string>; | ||
@@ -4,0 +4,0 @@ toFile(name: string): Promise<void>; |
{ | ||
"name": "@dicebear/converter", | ||
"version": "5.0.0-alpha.20", | ||
"version": "5.0.0-alpha.21", | ||
"description": "SVG Converter for DiceBear", | ||
@@ -56,3 +56,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "6b1c2bd64294365be21d0a133a362ede5ed62b5a" | ||
"gitHead": "40b7190a19ba3c6c355178f1ae6c422229634e06" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
545769
233