Sha256: 17086851f091310547c07338d71a2a2a80285a0f767904d7631249df0965bd0e

Contents?: true

Size: 375 Bytes

Versions: 13

Compression:

Stored size: 375 Bytes

Contents

// If the node is a type of assignment or if the node is a paren and nested
// inside that paren is a node that is a type of assignment.
function containsAssignment(node) {
  return (
    node &&
    (["assign", "massign", "opassign"].includes(node.type) ||
      (Array.isArray(node.body) && node.body.some(containsAssignment)))
  );
}

module.exports = containsAssignment;

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
prettier-1.6.1 src/utils/containsAssignment.js
prettier-1.6.0 src/utils/containsAssignment.js
prettier-1.5.5 src/utils/containsAssignment.js
prettier-1.5.4 src/utils/containsAssignment.js
prettier-1.5.3 src/utils/containsAssignment.js
prettier-1.5.2 src/utils/containsAssignment.js
prettier-1.5.1 src/utils/containsAssignment.js
prettier-1.5.0 src/utils/containsAssignment.js
prettier-1.4.0 src/utils/containsAssignment.js
prettier-1.3.0 src/utils/containsAssignment.js
prettier-1.2.5 src/utils/containsAssignment.js
prettier-1.2.4 src/utils/containsAssignment.js
prettier-1.2.3 src/utils/containsAssignment.js