Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rfs.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/rfs.js b/lib/rfs.js
index f51c917..d6e1eb3 100644
--- a/lib/rfs.js
+++ b/lib/rfs.js
@@ -25,9 +25,9 @@ module.exports = class {
if (typeof this.opts.baseValue !== 'number') {
if (this.opts.baseValue.endsWith('px')) {
- this.opts.baseValue = parseFloat(this.opts.baseValue);
+ this.opts.baseValue = Number.parseFloat(this.opts.baseValue);
} else if (this.opts.baseValue.endsWith('rem')) {
- this.opts.baseValue = parseFloat(this.opts.baseValue) / this.opts.remValue;
+ this.opts.baseValue = Number.parseFloat(this.opts.baseValue) / this.opts.remValue;
} else {
console.error(BASE_RFS_ERROR);
}
@@ -35,9 +35,9 @@ module.exports = class {
if (typeof this.opts.breakpoint !== 'number') {
if (this.opts.breakpoint.endsWith('px')) {
- this.opts.breakpoint = parseFloat(this.opts.breakpoint);
+ this.opts.breakpoint = Number.parseFloat(this.opts.breakpoint);
} else if (this.opts.breakpoint.endsWith('em')) {
- this.opts.breakpoint = parseFloat(this.opts.breakpoint) * this.opts.remValue;
+ this.opts.breakpoint = Number.parseFloat(this.opts.breakpoint) * this.opts.remValue;
} else {
console.error(BREAKPOINT_ERROR);
}
@@ -83,10 +83,10 @@ module.exports = class {
node.nodes.filter(node => node.type === 'word').forEach(node => {
node.value = node.value.replace(/^(-?\d*\.?\d+)(.*)/g, (match, value, unit) => {
- value = parseFloat(value);
+ value = Number.parseFloat(value);
// Return value if it's not a number or px/rem value
- if (isNaN(value) || !['px', 'rem'].includes(unit)) {
+ if (Number.isNaN(value) || !['px', 'rem'].includes(unit)) {
return match;
}