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

22 lines (17 loc) 461 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var backwards_expression = require('../expression.cjs'); /** * Process DPR value. If input is 1 returns 1.0 * @param value */ function processDpr(value) { var dpr = value.toString(); if (dpr != null ? dpr.match(/^\d+$/) : void 0) { return dpr + ".0"; } else { return backwards_expression.normalize(dpr); } } exports.processDpr = processDpr;