Skip to content

Commit 9f10d01

Browse files
authored
use .some(...) instead
1 parent 428c212 commit 9f10d01

File tree

1 file changed

+4
-4
lines changed
  • packages/svelte/src/compiler/phases/2-analyze/visitors/shared

1 file changed

+4
-4
lines changed

packages/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ export function validate_assignment(node, argument, state) {
4242
argument.type === 'MemberExpression' &&
4343
argument.object.type === 'ThisExpression' &&
4444
(((argument.property.type === 'PrivateIdentifier' || argument.property.type === 'Identifier') &&
45-
state.derived_state.findIndex(
45+
state.derived_state.some(
4646
(derived) =>
4747
derived.name === /** @type {PrivateIdentifier | Identifier} */ (argument.property).name &&
4848
derived.private === (argument.property.type === 'PrivateIdentifier')
49-
) !== -1) ||
49+
)) ||
5050
(argument.property.type === 'Literal' &&
5151
argument.property.value &&
5252
typeof argument.property.value === 'string' &&
53-
state.derived_state.findIndex(
53+
state.derived_state.some(
5454
(derived) =>
5555
derived.name === /** @type {Literal} */ (argument.property).value && !derived.private
56-
) !== -1))
56+
)))
5757
) {
5858
e.constant_assignment(node, 'derived state');
5959
}

0 commit comments

Comments
 (0)