1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 02:29:26 +02:00
OpenSTF/lib/units/storage/plugins/image/param/crop.js
2016-01-19 20:52:38 +09:00

14 lines
242 B
JavaScript

var RE_CROP = /^([0-9]*)x([0-9]*)$/
module.exports = function(raw) {
var parsed
if (raw && (parsed = RE_CROP.exec(raw))) {
return {
width: Number(parsed[1]) || 0
, height: Number(parsed[2]) || 0
}
}
return null
}