How to use condense-whitespace - 1 common examples

To help you get started, we’ve selected a few condense-whitespace examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TNRIS / flood / src / util / CartoDBLayer.es View on Github external
function getLayer(options) {
  const account = options.account
  const mapConfig = {
    version: "1.0.1",
    layers: [{
      type: 'mapnik',
      options: objectAssign(
        {
          sql: condenseWhitespace(options.sql),
          cartocss_version: "2.3.0",
        },
        options
      )
    }]
  }

  return axios.post(`https://${account}.cartodb.com/api/v1/map/`, mapConfig)
    .then(({data}) => {
      const layerid = data.layergroupid
      const urls = {
        tilesUrl: `https://${account}.cartodb.com/api/v1/map/${layerid}/{z}/{x}/{y}.png`
      }
      if (options.interactivity) {
        urls.gridsUrl = `https://${account}.cartodb.com/api/v1/map/${layerid}/0/{z}/{x}/{y}.grid.json`
      }

condense-whitespace

Remove leading, trailing, and repeated whitespace from a string

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis

Popular condense-whitespace functions