diff options
author | XhmikosR <xhmikosr@gmail.com> | 2021-08-04 09:58:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-04 09:58:12 +0300 |
commit | 3fa5796687b872a7cb0e5cf86d743896e6abfbe2 (patch) | |
tree | d7dd82c9c96dbbbcf6e844fa9e3c43635df112f5 /lib | |
parent | 31780a461fb1ad0c6e9a43b315eb47e8f801cfcb (diff) |
Switch to using for...of (#414)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rfs.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -81,7 +81,9 @@ module.exports = class { return; } - node.nodes.filter(node => node.type === 'word').forEach(node => { + const wordNodes = node.nodes.filter(node => node.type === 'word'); + + for (const node of wordNodes) { node.value = node.value.replace(/^(-?\d*\.?\d+)(.*)/g, (match, value, unit) => { value = Number.parseFloat(value); @@ -116,7 +118,7 @@ module.exports = class { return `calc(-${this.toFixed(baseValue, this.opts.unitPrecision)}${this.opts.unit} - ${this.toFixed(diff * 100 / this.opts.breakpoint, this.opts.unitPrecision)}${viewportUnit})`; }); - }); + } // Now we will transform the existing rgba() function node // into a word node with the hex value |