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

14 lines
228 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: +parsed[1] || 0
, height: +parsed[2] || 0
}
}
return null
}