Skip to content

Commit

Permalink
Change name of filename argument to path in function labelFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Nov 25, 2019
1 parent cebc4fc commit 7b15d76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -81,9 +81,9 @@ const cases = {
[
plugin,
{
labelFormat: ({ name, filename }) =>
labelFormat: ({ name, path }) =>
`${name.toUpperCase()}_${last(
filename.replace(/\..+$/, '').split('/')
path.replace(/\..+$/, '').split('/')
).toUpperCase()}`,
autoLabel: true
}
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-plugin-emotion/src/utils/label.js
Expand Up @@ -3,7 +3,7 @@ import nodePath from 'path'

type LabelFormatOptions = {
name: string,
filename: string
path: string
}

const invalidClassNameCharacters = /[!"#$%&'()*+,./:;<=>?@[\]^`|}~{]/g
Expand All @@ -28,7 +28,7 @@ function getLabel(
if (typeof labelFormat === 'function') {
return labelFormat({
name: sanitizedName,
filename
path: filename
})
}

Expand Down

0 comments on commit 7b15d76

Please sign in to comment.