@b613/utils
Advanced tools
Comparing version 1.0.0-beta27 to 1.0.0-beta28
{ | ||
"name": "color", | ||
"type": "module", | ||
"main": "./color.node.js", | ||
"browser": "./color.browser.js" | ||
} |
@@ -28,2 +28,5 @@ const EventOptions = { | ||
} | ||
export async function convert(input, format) { | ||
throw Error('Not Yet Supported'); | ||
} | ||
export async function resize(image, width, height) { | ||
@@ -49,2 +52,15 @@ return parseCanvas(image, width, height); | ||
} | ||
export function parseInput(input) { | ||
if (typeof input === 'string') { | ||
const result = parseMimeType(input); | ||
if (!result) { | ||
throw new Error('Unsupported content type'); | ||
} | ||
return { | ||
data: Buffer.from(result.data, 'base64'), | ||
contentType: result.mime, | ||
}; | ||
} | ||
return input; | ||
} | ||
//# sourceMappingURL=image.browser.js.map |
{ | ||
"name": "@b613/utils", | ||
"version": "1.0.0-beta27", | ||
"version": "1.0.0-beta28", | ||
"description": "Set of utility methods for common operations", | ||
@@ -27,4 +27,3 @@ "license": "MIT", | ||
"./image": { | ||
"import": "./lib/image/image.browser.js", | ||
"node": "./lib/image/image.node.js", | ||
"import": "./lib/image/image.node.js", | ||
"types": "./lib/image/image.node.d.ts" | ||
@@ -73,9 +72,7 @@ }, | ||
"./color": { | ||
"import": "./lib/color/color.browser.js", | ||
"node": "./lib/color/color.node.js", | ||
"import": "./lib/color/color.node.js", | ||
"types": "./lib/color/color.node.d.ts" | ||
}, | ||
"./trace": { | ||
"import": "./lib/trace/trace.browser.js", | ||
"node": "./lib/trace/trace.node.js", | ||
"import": "./lib/trace/trace.node.js", | ||
"types": "./lib/trace/trace.node.d.ts" | ||
@@ -153,2 +150,2 @@ } | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
155517
67
2641