Browse Source

Check if source isn't object instead of is string

We may wanna pass in different types like buffers for Node.js.
jpeg-test
Luke Childs 8 years ago
parent
commit
2abb4d507a
  1. 2
      src/index.js

2
src/index.js

@ -7,7 +7,7 @@ const mergeImages = (sources = [], options = { format: 'image/png' }) => new Pro
// Load sources
const images = sources.map(source => new Promise(resolve => {
// Convert strings to objects
if (typeof source === 'string') {
if (source.constructor.name !== 'Object') {
source = { src: source };
}

Loading…
Cancel
Save