{"size": 567, "ext": "js", "max_stars_repo_path": "index.js", "max_stars_repo_name": "meowtec/image2svg-loader", "max_stars_repo_stars_event_min_datetime": "2017-08-18T01:56:11.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-06T11:04:38.000Z", "max_issues_repo_path": "index.js", "max_issues_repo_name": "meowtec/image2svg-loader", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "index.js", "max_forks_repo_name": "meowtec/image2svg-loader", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.625, "max_line_length": 76, "alphanum_fraction": 0.6543209877}
'use strict'

const sizeOf = require('image-size')

const svgTemplate = (url, width, height) => `
  <svg viewBox="0 0 ${width} ${height}" xmlns="http://www.w3.org/2000/svg">
  <image width="${width}" height="${height}" xlink:href="${url}"/>
  </svg>
`.trim()

module.exports = function (content, arg1, arg2) {
  const sizeInfo = sizeOf(content)

  let url = content

  if (Buffer.isBuffer(url)) {
    url = `data:image/${sizeInfo.type};base64,${content.toString('base64')}`
  }

  return svgTemplate(url, sizeInfo.width, sizeInfo.height)
}

module.exports.raw = true
