Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test/fixtures/*
coverage/**
.nyc_output/**
22 changes: 0 additions & 22 deletions .prettierrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion camel-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function camelCase(str) {
? s
.replace(/^-(ms|moz|khtml|epub|(\w+-?)*webkit)(?=-)/i, '$1')
.replace(/-\w/g, (s) => s[1].toUpperCase())
: s
: s,
);
}

Expand Down
20 changes: 11 additions & 9 deletions extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,11 @@ function literalParser(source, opts, styles) {
}

function setSpecifier(id, nameSpace) {
nameSpace.unshift.apply(
nameSpace,
nameSpace
nameSpace.unshift(
...nameSpace
.shift()
.replace(/^\W+/, '')
.split(/[/\\]+/g)
.split(/[/\\]+/g),
);

if (types.isIdentifier(id)) {
Expand Down Expand Up @@ -240,7 +239,7 @@ function literalParser(source, opts, styles) {
const specifier = specifiers.get(node) || specifiers.get(node.name);

if (specifier) {
nameSpace.unshift.apply(nameSpace, specifier);
nameSpace.unshift(...specifier);
} else {
nameSpace.unshift(node.name);
}
Expand All @@ -254,7 +253,7 @@ function literalParser(source, opts, styles) {
}

function isStylePath(path) {
return getNameSpace(path, []).some(function (name) {
return getNameSpace(path, []).some(function (name, ...args) {
const result =
name &&
((Object.prototype.hasOwnProperty.call(supports, name) && supports[name]) ||
Expand All @@ -263,11 +262,14 @@ function literalParser(source, opts, styles) {

switch (typeof result) {
case 'function': {
return result.apply(this, Array.prototype.slice.call(arguments, 1));
return result.apply(this, args);
}
case 'boolean': {
return result;
}
default: {
return undefined;
}
}
});
}
Expand Down Expand Up @@ -432,8 +434,8 @@ function literalParser(source, opts, styles) {
(targetStyle) =>
targetStyle.opts &&
targetStyle.opts.expressions.some(
(expr) => expr.start <= style.startIndex && style.endIndex < expr.end
)
(expr) => expr.start <= style.startIndex && style.endIndex < expr.end,
),
);

if (target) {
Expand Down
4 changes: 2 additions & 2 deletions object-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function defineRaws(node, prop, prefix, suffix, props) {
prefix,
suffix,
},
props
props,
);
}

Expand Down Expand Up @@ -85,7 +85,7 @@ class objectParser {

let before = root.source.input.css.slice(
startNode.start - startNode.loc.start.column,
startNode.start
startNode.start,
);

if (/^\s+$/.test(before)) {
Expand Down
Loading