UNPKG

@cloudinary/url-gen

Version:

Cloudinary URL-Gen SDK ========================= [![Build Status](https://api.travis-ci.com/cloudinary/js-url-gen.svg?branch=master)](https://app.travis-ci.com/github/cloudinary/js-url-gen) ## About The Cloudinary URL-Gen SDK allows you to quickly and eas

15 lines (14 loc) 330 B
import Expression from "../expression.js"; /** * Process DPR value. If input is 1 returns 1.0 * @param value */ export function processDpr(value) { let dpr = value.toString(); if (dpr != null ? dpr.match(/^\d+$/) : void 0) { return dpr + ".0"; } else { return Expression.normalize(dpr); } }