@cloudinary/url-gen
Version:
Cloudinary URL-Gen SDK ========================= [](https://app.travis-ci.com/github/cloudinary/js-url-gen) ## About The Cloudinary URL-Gen SDK allows you to quickly and eas
16 lines (15 loc) • 338 B
JavaScript
import { RANGE_VALUE_RE } from "../consts.js";
/**
*
* @param value
*/
export function normRangeValues(value) {
const offset = String(value).match(RANGE_VALUE_RE);
if (offset) {
const modifier = offset[5] ? 'p' : '';
return `${offset[1] || offset[4]}${modifier}`;
}
else {
return value;
}
}