webfuscator 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/dist/analysis/constant.js +3 -3
  2. package/dist/analysis/constant.js.map +1 -1
  3. package/dist/analysis/inlineability.js +2 -2
  4. package/dist/analysis/inlineability.js.map +1 -1
  5. package/dist/analysis/purity.js +1 -1
  6. package/dist/analysis/purity.js.map +1 -1
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/obfuscator.d.ts.map +1 -1
  11. package/dist/obfuscator.js.map +1 -1
  12. package/dist/options.d.ts.map +1 -1
  13. package/dist/preparation/expand-destructuring.js +4 -3
  14. package/dist/preparation/expand-destructuring.js.map +1 -1
  15. package/dist/preparation/expand-template-literals.js +3 -2
  16. package/dist/preparation/expand-template-literals.js.map +1 -1
  17. package/dist/preparation/split-sequence-expressions.js +1 -1
  18. package/dist/preparation/split-sequence-expressions.js.map +1 -1
  19. package/dist/preparation/split-variable-declarations.js +1 -1
  20. package/dist/preparation/split-variable-declarations.js.map +1 -1
  21. package/dist/preparation/stringify-object-keys.js +1 -1
  22. package/dist/preparation/stringify-object-keys.js.map +1 -1
  23. package/dist/preparation/wrap-single-statements.js +2 -2
  24. package/dist/preparation/wrap-single-statements.js.map +1 -1
  25. package/dist/transforms/arguments-to-parameters.js +1 -1
  26. package/dist/transforms/arguments-to-parameters.js.map +1 -1
  27. package/dist/transforms/arrow-to-function.js.map +1 -1
  28. package/dist/transforms/collapse-single-use-temps.js +7 -7
  29. package/dist/transforms/collapse-single-use-temps.js.map +1 -1
  30. package/dist/transforms/const-let-to-var.js +3 -3
  31. package/dist/transforms/const-let-to-var.js.map +1 -1
  32. package/dist/transforms/const-to-let.js.map +1 -1
  33. package/dist/transforms/do-while-to-while.js +3 -3
  34. package/dist/transforms/do-while-to-while.js.map +1 -1
  35. package/dist/transforms/drop-console.js +4 -3
  36. package/dist/transforms/drop-console.js.map +1 -1
  37. package/dist/transforms/drop-debugger.js.map +1 -1
  38. package/dist/transforms/expand-binary-assignment.js +5 -3
  39. package/dist/transforms/expand-binary-assignment.js.map +1 -1
  40. package/dist/transforms/expand-logical-assignment.js +5 -3
  41. package/dist/transforms/expand-logical-assignment.js.map +1 -1
  42. package/dist/transforms/extract-object-properties.js +7 -7
  43. package/dist/transforms/extract-object-properties.js.map +1 -1
  44. package/dist/transforms/fold-builtin-methods.js +16 -15
  45. package/dist/transforms/fold-builtin-methods.js.map +1 -1
  46. package/dist/transforms/fold-constants.js +2 -2
  47. package/dist/transforms/fold-constants.js.map +1 -1
  48. package/dist/transforms/for-to-while.js +5 -5
  49. package/dist/transforms/for-to-while.js.map +1 -1
  50. package/dist/transforms/function-declaration-to-expression.js +3 -3
  51. package/dist/transforms/function-declaration-to-expression.js.map +1 -1
  52. package/dist/transforms/inline-functions.js +7 -7
  53. package/dist/transforms/inline-functions.js.map +1 -1
  54. package/dist/transforms/logical-to-ternary.js +2 -2
  55. package/dist/transforms/logical-to-ternary.js.map +1 -1
  56. package/dist/transforms/mangle-properties.d.ts.map +1 -1
  57. package/dist/transforms/mangle-properties.js +35 -86
  58. package/dist/transforms/mangle-properties.js.map +1 -1
  59. package/dist/transforms/nullish-coalescing-to-ternary.js +2 -2
  60. package/dist/transforms/nullish-coalescing-to-ternary.js.map +1 -1
  61. package/dist/transforms/numbers-to-strings.js +2 -2
  62. package/dist/transforms/numbers-to-strings.js.map +1 -1
  63. package/dist/transforms/object-method-to-property.js +1 -1
  64. package/dist/transforms/object-method-to-property.js.map +1 -1
  65. package/dist/transforms/optional-chaining-to-ternary.js +2 -2
  66. package/dist/transforms/optional-chaining-to-ternary.js.map +1 -1
  67. package/dist/transforms/pack-declarations-into-parameters.js +2 -2
  68. package/dist/transforms/pack-declarations-into-parameters.js.map +1 -1
  69. package/dist/transforms/pack.d.ts.map +1 -1
  70. package/dist/transforms/pack.js +10 -11
  71. package/dist/transforms/pack.js.map +1 -1
  72. package/dist/transforms/remove-anonymous-function-names.js +3 -3
  73. package/dist/transforms/remove-anonymous-function-names.js.map +1 -1
  74. package/dist/transforms/remove-unreachable-code.js +1 -1
  75. package/dist/transforms/remove-unreachable-code.js.map +1 -1
  76. package/dist/transforms/remove-unused-code.js +4 -4
  77. package/dist/transforms/remove-unused-code.js.map +1 -1
  78. package/dist/transforms/rename-identifiers.d.ts.map +1 -1
  79. package/dist/transforms/rename-identifiers.js +4 -3
  80. package/dist/transforms/rename-identifiers.js.map +1 -1
  81. package/dist/transforms/specials-to-strings.d.ts.map +1 -1
  82. package/dist/transforms/specials-to-strings.js +2 -2
  83. package/dist/transforms/specials-to-strings.js.map +1 -1
  84. package/dist/transforms/switch-to-if.js +7 -7
  85. package/dist/transforms/switch-to-if.js.map +1 -1
  86. package/dist/transforms/ternary-to-if.js +7 -4
  87. package/dist/transforms/ternary-to-if.js.map +1 -1
  88. package/dist/transforms/update-to-assignment.js +4 -2
  89. package/dist/transforms/update-to-assignment.js.map +1 -1
  90. package/dist/transforms/yodify-conditions.js +3 -3
  91. package/dist/transforms/yodify-conditions.js.map +1 -1
  92. package/dist/utils/ast.d.ts.map +1 -1
  93. package/dist/utils/ast.js +2 -1
  94. package/dist/utils/ast.js.map +1 -1
  95. package/dist/utils/evaluation-order.js.map +1 -1
  96. package/dist/utils/logical-lowering.js +2 -2
  97. package/dist/utils/logical-lowering.js.map +1 -1
  98. package/dist/utils/loop-lowering.js +1 -1
  99. package/dist/utils/loop-lowering.js.map +1 -1
  100. package/dist/utils/string-generator.js +1 -1
  101. package/dist/utils/string-generator.js.map +1 -1
  102. package/package.json +11 -10
  103. package/src/analysis/constant.ts +4 -4
  104. package/src/analysis/inlineability.ts +4 -4
  105. package/src/analysis/purity.ts +3 -3
  106. package/src/index.ts +4 -2
  107. package/src/obfuscator.ts +42 -42
  108. package/src/options.ts +1 -1
  109. package/src/preparation/expand-destructuring.ts +5 -4
  110. package/src/preparation/expand-template-literals.ts +4 -3
  111. package/src/preparation/split-sequence-expressions.ts +2 -2
  112. package/src/preparation/split-variable-declarations.ts +1 -1
  113. package/src/preparation/stringify-object-keys.ts +2 -2
  114. package/src/preparation/wrap-single-statements.ts +2 -2
  115. package/src/transforms/arguments-to-parameters.ts +5 -5
  116. package/src/transforms/arrow-to-function.ts +3 -3
  117. package/src/transforms/collapse-single-use-temps.ts +14 -14
  118. package/src/transforms/const-let-to-var.ts +6 -6
  119. package/src/transforms/const-to-let.ts +4 -4
  120. package/src/transforms/do-while-to-while.ts +6 -6
  121. package/src/transforms/drop-console.ts +8 -7
  122. package/src/transforms/drop-debugger.ts +2 -2
  123. package/src/transforms/expand-binary-assignment.ts +8 -6
  124. package/src/transforms/expand-logical-assignment.ts +8 -6
  125. package/src/transforms/extract-object-properties.ts +12 -12
  126. package/src/transforms/fold-builtin-methods.ts +20 -19
  127. package/src/transforms/fold-constants.ts +8 -8
  128. package/src/transforms/for-to-while.ts +8 -8
  129. package/src/transforms/function-declaration-to-expression.ts +5 -5
  130. package/src/transforms/inline-functions.ts +14 -14
  131. package/src/transforms/logical-to-ternary.ts +7 -7
  132. package/src/transforms/mangle-properties.ts +43 -97
  133. package/src/transforms/nullish-coalescing-to-ternary.ts +6 -6
  134. package/src/transforms/numbers-to-strings.ts +4 -4
  135. package/src/transforms/object-method-to-property.ts +4 -4
  136. package/src/transforms/optional-chaining-to-ternary.ts +5 -5
  137. package/src/transforms/pack-declarations-into-parameters.ts +7 -7
  138. package/src/transforms/pack.ts +20 -16
  139. package/src/transforms/remove-anonymous-function-names.ts +5 -5
  140. package/src/transforms/remove-unreachable-code.ts +3 -3
  141. package/src/transforms/remove-unused-code.ts +8 -8
  142. package/src/transforms/rename-identifiers.ts +9 -8
  143. package/src/transforms/specials-to-strings.ts +7 -7
  144. package/src/transforms/switch-to-if.ts +12 -12
  145. package/src/transforms/ternary-to-if.ts +12 -9
  146. package/src/transforms/update-to-assignment.ts +7 -5
  147. package/src/transforms/yodify-conditions.ts +6 -6
  148. package/src/utils/ast.ts +2 -1
  149. package/src/utils/evaluation-order.ts +1 -1
  150. package/src/utils/logical-lowering.ts +3 -3
  151. package/src/utils/loop-lowering.ts +1 -1
  152. package/src/utils/string-generator.ts +1 -1
@@ -3,11 +3,11 @@ import type { Binding, Scope } from '@babel/traverse'
3
3
  import * as t from '@babel/types'
4
4
  import type { File } from '@babel/types'
5
5
 
6
- import type { TransformContext } from 'src/options'
7
- import { isDirectEvalCall, isInsideWith } from 'src/utils/ast'
8
- import { hasAnnexBFunctionAlias, referencesOrWritesVariable } from 'src/utils/paths'
9
- import { mulberry32 } from 'src/utils/random'
10
- import { StringGenerator } from 'src/utils/string-generator'
6
+ import type { TransformContext } from '../options'
7
+ import { isDirectEvalCall, isInsideWith } from '../utils/ast'
8
+ import { hasAnnexBFunctionAlias, referencesOrWritesVariable } from '../utils/paths'
9
+ import { mulberry32 } from '../utils/random'
10
+ import { StringGenerator } from '../utils/string-generator'
11
11
 
12
12
  /**
13
13
  * Renames bindings and labels with a fresh `StringGenerator`. Each scope avoids
@@ -125,7 +125,7 @@ export function renameIdentifiers(ast: File, ctx: TransformContext): boolean {
125
125
 
126
126
  traverse(ast, {
127
127
  Scopable(path) {
128
- const { scope } = path
128
+ const scope = path.scope
129
129
  // Test global reservations during allocation to avoid copying them per scope.
130
130
  const offLimits = new Set<string>()
131
131
  const live = liveAncestors.get(scope)
@@ -174,7 +174,7 @@ export function renameIdentifiers(ast: File, ctx: TransformContext): boolean {
174
174
 
175
175
  traverse(ast, {
176
176
  Identifier(path) {
177
- const { node } = path
177
+ const node = path.node
178
178
  const directName = idToName.get(node)
179
179
  if (directName !== undefined) {
180
180
  node.name = directName
@@ -200,7 +200,8 @@ export function renameIdentifiers(ast: File, ctx: TransformContext): boolean {
200
200
  }
201
201
 
202
202
  function isNonBindingPosition(path: { node: t.Identifier; parent: t.Node }): boolean {
203
- const { node, parent } = path
203
+ const node = path.node
204
+ const parent = path.parent
204
205
  // A PrivateName id is not a variable and must match its class declaration.
205
206
  if (t.isPrivateName(parent)) {
206
207
  return true
@@ -3,11 +3,11 @@ import type { NodePath, Visitor } from '@babel/traverse'
3
3
  import * as t from '@babel/types'
4
4
  import type { File } from '@babel/types'
5
5
 
6
- import type { TransformContext } from 'src/options'
7
- import { enclosingScopeHasDirectEval, isInsideWith } from 'src/utils/ast'
8
- import type { ChangeState } from 'src/utils/change-tracking'
9
- import { mulberry32 } from 'src/utils/random'
10
- import { StringGenerator } from 'src/utils/string-generator'
6
+ import type { TransformContext } from '../options'
7
+ import { enclosingScopeHasDirectEval, isInsideWith } from '../utils/ast'
8
+ import type { ChangeState } from '../utils/change-tracking'
9
+ import { mulberry32 } from '../utils/random'
10
+ import { StringGenerator } from '../utils/string-generator'
11
11
 
12
12
  /**
13
13
  * Rewrites five constant-like values through strings for later string mangling:
@@ -59,7 +59,7 @@ const visitor: Visitor<State> = {
59
59
  state.changed = true
60
60
  },
61
61
  Identifier(path, state) {
62
- const { name } = path.node
62
+ const name = path.node.name
63
63
  if (!GLOBAL_SPECIALS.has(name)) {
64
64
  return
65
65
  }
@@ -93,7 +93,7 @@ function buildGlobalReplacement(name: string, str: t.StringLiteral): t.Expressio
93
93
  // Babel calls update and iterator targets references, but replacements there
94
94
  // would not be assignable. Delete also distinguishes references from values.
95
95
  function isWriteTarget(path: NodePath<t.Identifier>): boolean {
96
- const { parentPath } = path
96
+ const parentPath = path.parentPath
97
97
  if (!parentPath) {
98
98
  return false
99
99
  }
@@ -2,11 +2,11 @@ import type { NodePath, Scope, Visitor } from '@babel/traverse'
2
2
  import * as t from '@babel/types'
3
3
  import type { File } from '@babel/types'
4
4
 
5
- import { isPure } from 'src/analysis/purity'
6
- import { traverseForChanges } from 'src/utils/change-tracking'
7
- import type { ChangeState } from 'src/utils/change-tracking'
8
- import { isPrimitiveLiteral } from 'src/utils/literal'
9
- import { generateLoopLabel } from 'src/utils/loop-lowering'
5
+ import { isPure } from '../analysis/purity'
6
+ import { traverseForChanges } from '../utils/change-tracking'
7
+ import type { ChangeState } from '../utils/change-tracking'
8
+ import { isPrimitiveLiteral } from '../utils/literal'
9
+ import { generateLoopLabel } from '../utils/loop-lowering'
10
10
 
11
11
  /**
12
12
  * Lowers `switch` to an `if` chain or, when cases fall through, a labeled block
@@ -46,7 +46,7 @@ const visitor: Visitor<ChangeState> = {
46
46
  }
47
47
 
48
48
  function transformSwitch(path: NodePath<t.SwitchStatement>): boolean {
49
- const { node } = path
49
+ const node = path.node
50
50
  // Separate `if` blocks cannot preserve cross-case lexical scope or Annex B
51
51
  // function hoisting.
52
52
  if (hasBlockScopedDeclaration(node)) {
@@ -114,7 +114,7 @@ function canLowerToIfElseChain(node: t.SwitchStatement): boolean {
114
114
  }
115
115
 
116
116
  function caseEligibleForIfElseChain(caseClause: t.SwitchCase, isLast: boolean): boolean {
117
- const { consequent } = caseClause
117
+ const consequent = caseClause.consequent
118
118
  if (consequent.length === 0) {
119
119
  return isLast
120
120
  }
@@ -189,8 +189,8 @@ function buildBody(consequent: t.Statement[]): t.BlockStatement {
189
189
  }
190
190
 
191
191
  function lowerToIfElseChain(path: NodePath<t.SwitchStatement>): void {
192
- const { node } = path
193
- const { scope } = path
192
+ const node = path.node
193
+ const scope = path.scope
194
194
 
195
195
  let discriminantExpr: t.Expression
196
196
  const preStmts: t.Statement[] = []
@@ -244,8 +244,8 @@ function lowerToIfElseChain(path: NodePath<t.SwitchStatement>): void {
244
244
  }
245
245
 
246
246
  function lowerToLabeledBlock(path: NodePath<t.SwitchStatement>): void {
247
- const { node } = path
248
- const { scope } = path
247
+ const node = path.node
248
+ const scope = path.scope
249
249
 
250
250
  // `scope.generateUid` alone can collide with enclosing or nested labels.
251
251
  const labelName = generateLoopLabel(path, 'switch')
@@ -314,7 +314,7 @@ function lowerToLabeledBlock(path: NodePath<t.SwitchStatement>): void {
314
314
 
315
315
  const labeledBlock = t.labeledStatement(t.identifier(labelName), t.blockStatement(statements))
316
316
 
317
- const [labeledPath] = path.replaceWith(labeledBlock)
317
+ const labeledPath = path.replaceWith(labeledBlock)[0]
318
318
  rewriteUnlabeledBreaks(labeledPath, labelName)
319
319
  }
320
320
 
@@ -2,11 +2,11 @@ import type { NodePath, Visitor } from '@babel/traverse'
2
2
  import * as t from '@babel/types'
3
3
  import type { File } from '@babel/types'
4
4
 
5
- import { isInsideWith } from 'src/utils/ast'
6
- import { traverseForChanges } from 'src/utils/change-tracking'
7
- import type { ChangeState } from 'src/utils/change-tracking'
8
- import { isConditionalGate, reorderableToStatement } from 'src/utils/evaluation-order'
9
- import { isStandaloneDeclaration } from 'src/utils/paths'
5
+ import { isInsideWith } from '../utils/ast'
6
+ import { traverseForChanges } from '../utils/change-tracking'
7
+ import type { ChangeState } from '../utils/change-tracking'
8
+ import { isConditionalGate, reorderableToStatement } from '../utils/evaluation-order'
9
+ import { isStandaloneDeclaration } from '../utils/paths'
10
10
 
11
11
  /**
12
12
  * Lowers conditional expressions to `if` statements. Expression values use a
@@ -67,7 +67,9 @@ function lowerConditional(path: NodePath<t.ConditionalExpression>): boolean {
67
67
  return false
68
68
  }
69
69
 
70
- const { test, consequent, alternate } = path.node
70
+ const test = path.node.test
71
+ const consequent = path.node.consequent
72
+ const alternate = path.node.alternate
71
73
 
72
74
  if (parent.isExpressionStatement() && parent.node.expression === path.node) {
73
75
  parent.replaceWith(
@@ -163,7 +165,7 @@ function lowerConditional(path: NodePath<t.ConditionalExpression>): boolean {
163
165
  return false
164
166
  }
165
167
 
166
- const { scope } = path
168
+ const scope = path.scope
167
169
  const tmpId = scope.generateUidIdentifier('ternaryResult')
168
170
  scope.push({ id: t.cloneNode(tmpId) })
169
171
 
@@ -293,8 +295,9 @@ function lowerEnclosingLogical(path: NodePath, stmtPath: NodePath): boolean {
293
295
  if (!logical || logical.removed || !logical.container) {
294
296
  return false
295
297
  }
296
- const { node } = logical
297
- const { left, right } = node
298
+ const node = logical.node
299
+ const left = node.left
300
+ const right = node.right
298
301
  let test: t.Expression
299
302
  let valueRef: t.Expression
300
303
  if (t.isIdentifier(left) && logical.scope.hasBinding(left.name)) {
@@ -2,9 +2,9 @@ import type { Binding, NodePath, Visitor } from '@babel/traverse'
2
2
  import * as t from '@babel/types'
3
3
  import type { File } from '@babel/types'
4
4
 
5
- import { isDirectEvalCall, isInsideWith } from 'src/utils/ast'
6
- import { traverseForChanges } from 'src/utils/change-tracking'
7
- import type { ChangeState } from 'src/utils/change-tracking'
5
+ import { isDirectEvalCall, isInsideWith } from '../utils/ast'
6
+ import { traverseForChanges } from '../utils/change-tracking'
7
+ import type { ChangeState } from '../utils/change-tracking'
8
8
 
9
9
  /**
10
10
  * Rewrites numeric updates as compound assignments for later expansion. Prefix
@@ -35,7 +35,9 @@ export function updateToAssignment(ast: File): boolean {
35
35
 
36
36
  const visitor: Visitor<ChangeState> = {
37
37
  UpdateExpression(path, state) {
38
- const { argument, prefix, operator } = path.node
38
+ const argument = path.node.argument
39
+ const prefix = path.node.prefix
40
+ const operator = path.node.operator
39
41
  if (!t.isIdentifier(argument)) {
40
42
  return
41
43
  }
@@ -61,7 +63,7 @@ const visitor: Visitor<ChangeState> = {
61
63
  }
62
64
 
63
65
  function valueIsDiscarded(path: NodePath<t.UpdateExpression>): boolean {
64
- const { parentPath } = path
66
+ const parentPath = path.parentPath
65
67
  if (!parentPath) {
66
68
  return false
67
69
  }
@@ -2,9 +2,9 @@ import type { Visitor } from '@babel/traverse'
2
2
  import * as t from '@babel/types'
3
3
  import type { File } from '@babel/types'
4
4
 
5
- import { traverseForChanges } from 'src/utils/change-tracking'
6
- import type { ChangeState } from 'src/utils/change-tracking'
7
- import { isLiteralShaped } from 'src/utils/literal'
5
+ import { traverseForChanges } from '../utils/change-tracking'
6
+ import type { ChangeState } from '../utils/change-tracking'
7
+ import { isLiteralShaped } from '../utils/literal'
8
8
 
9
9
  /**
10
10
  * Moves a safe literal-shaped right operand to the left of a comparison.
@@ -31,7 +31,7 @@ export function yodifyConditions(ast: File): boolean {
31
31
 
32
32
  const visitor: Visitor<ChangeState> = {
33
33
  BinaryExpression(path, state) {
34
- const { node } = path
34
+ const node = path.node
35
35
  const op = node.operator
36
36
  if (!isComparisonOp(op)) {
37
37
  return
@@ -51,8 +51,8 @@ const visitor: Visitor<ChangeState> = {
51
51
  return
52
52
  }
53
53
 
54
- const { left } = node
55
- const { right } = node
54
+ const left = node.left
55
+ const right = node.right
56
56
  node.left = right
57
57
  node.right = left
58
58
  const flipped = RELATIONAL_FLIP[op]
package/src/utils/ast.ts CHANGED
@@ -13,7 +13,8 @@ export function isInDirectivePrologue(path: NodePath): boolean {
13
13
  if (!inBody) {
14
14
  return false
15
15
  }
16
- const { container, key: index } = path
16
+ const container = path.container
17
+ const index = path.key
17
18
  if (!Array.isArray(container) || typeof index !== 'number') {
18
19
  return false
19
20
  }
@@ -1,7 +1,7 @@
1
1
  import type { NodePath } from '@babel/traverse'
2
2
  import * as t from '@babel/types'
3
3
 
4
- import { isPure } from 'src/analysis/purity'
4
+ import { isPure } from '../analysis/purity'
5
5
 
6
6
  // Moving a gated node can change whether it runs.
7
7
  export function isConditionalGate(parent: NodePath, cur: NodePath): boolean {
@@ -1,8 +1,8 @@
1
1
  import type { NodePath } from '@babel/traverse'
2
2
  import * as t from '@babel/types'
3
3
 
4
- import { isSideEffectFree } from 'src/analysis/purity'
5
- import { isStandaloneDeclaration } from 'src/utils/paths'
4
+ import { isSideEffectFree } from '../analysis/purity'
5
+ import { isStandaloneDeclaration } from './paths'
6
6
 
7
7
  // Lowers a short-circuit expression assigned to a bare identifier:
8
8
  //
@@ -15,7 +15,7 @@ export function lowerLogicalWriteStatement(
15
15
  path: NodePath<t.LogicalExpression>,
16
16
  fallbackTest: (target: t.Identifier) => t.Expression,
17
17
  ): boolean {
18
- const { node } = path
18
+ const node = path.node
19
19
  const parent = path.parentPath
20
20
  if (!parent) {
21
21
  return false
@@ -76,7 +76,7 @@ const redirectVisitor: Visitor<RedirectState> = {
76
76
  path.skip()
77
77
  },
78
78
  ContinueStatement(path, state) {
79
- const { label } = path.node
79
+ const label = path.node.label
80
80
  if (!label) {
81
81
  if (!hasInterposedLoop(path, state.rootPath)) {
82
82
  path.replaceWith(t.breakStatement(t.identifier(state.innerLabel)))
@@ -1,4 +1,4 @@
1
- import { shuffleInPlace } from 'src/utils/random'
1
+ import { shuffleInPlace } from './random'
2
2
 
3
3
  /**
4
4
  * Identifier styles supported by `StringGenerator`. An array chooses a style