Skip to content

Commit a6846ee

Browse files
committed
refactor: replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <[email protected]>
1 parent 5368c63 commit a6846ee

File tree

1 file changed

+2
-2
lines changed
  • packages/babel-plugin-transform-vue-jsx/src

1 file changed

+2
-2
lines changed

packages/babel-plugin-transform-vue-jsx/src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const parseAttributeJSXAttribute = (t, path, attributes, tagName, elementType) =
166166

167167
prefix = prefixes.find(el => name.startsWith(el)) || 'attrs'
168168
name = name.replace(new RegExp(`^${prefix}\-?`), '')
169-
name = name[0].toLowerCase() + name.substr(1)
169+
name = name[0].toLowerCase() + name.slice(1)
170170

171171
const valuePath = path.get('value')
172172
let value
@@ -193,7 +193,7 @@ const parseAttributeJSXAttribute = (t, path, attributes, tagName, elementType) =
193193
attributes[name] = value
194194
} else {
195195
if (isDirective(name)) {
196-
name = kebabcase(name.substr(1))
196+
name = kebabcase(name.slice(1))
197197
prefix = 'directives'
198198
} else {
199199
name = [name, ...modifiers].join('_')

0 commit comments

Comments
 (0)