@dicebear/converter 9.0.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/node/core.js +4 -5
  2. package/package.json +2 -2
package/lib/node/core.js CHANGED
@@ -32,13 +32,12 @@ async function toArrayBuffer(rawSvg, format, exif, options) {
32
32
  return (await toBuffer(rawSvg, format, exif, options)).buffer;
33
33
  }
34
34
  async function toBuffer(rawSvg, format, exif, options) {
35
- var _a;
36
- const fonts = (_a = options.fonts) !== null && _a !== void 0 ? _a : [];
35
+ const hasFonts = Array.isArray(options.fonts);
37
36
  const { svg } = ensureSize(rawSvg);
38
37
  let buffer = (await renderAsync(svg, {
39
38
  font: {
40
- loadSystemFonts: fonts.length === 0,
41
- fontFiles: fonts.length > 0 ? fonts : undefined,
39
+ loadSystemFonts: !hasFonts,
40
+ fontFiles: hasFonts ? options.fonts : undefined,
42
41
  },
43
42
  })).asPng();
44
43
  if ('jpeg' === format) {
@@ -50,7 +49,7 @@ async function toBuffer(rawSvg, format, exif, options) {
50
49
  if (Object.keys(exif).length > 0) {
51
50
  buffer = await tmp.withFile(async ({ path }) => {
52
51
  await fs.writeFile(path, buffer);
53
- await exiftool.write(path, exif, ['-overwrite_original']);
52
+ await exiftool.write(path, exif, { writeArgs: ['-overwrite_original'] });
54
53
  return fs.readFile(path);
55
54
  });
56
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dicebear/converter",
3
- "version": "9.0.0",
3
+ "version": "9.0.1",
4
4
  "description": "SVG Converter for DiceBear",
5
5
  "keywords": [
6
6
  "dicebear"
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "c9e66450840d4f29faee6362249348bb3d18798b"
57
+ "gitHead": "96e800ad4a1f2175f225fe1639fb91624013e01c"
58
58
  }