Sha256: 77272d7fd1abb95157adc2a9919eb6a694a18857adbda86d3d1f308706bbe9f8

Contents?: true

Size: 775 Bytes

Versions: 15

Compression:

Stored size: 775 Bytes

Contents

const { concat, group, indent, join, softline } = require("../prettier");
const { first, makeCall, prefix } = require("../utils");

module.exports = {
  const_path_field: (path, opts, print) => join("::", path.map(print, "body")),
  const_path_ref: (path, opts, print) => join("::", path.map(print, "body")),
  const_ref: first,
  defined: (path, opts, print) =>
    group(
      concat([
        "defined?(",
        indent(concat([softline, path.call(print, "body", 0)])),
        concat([softline, ")"])
      ])
    ),
  field: (path, opts, print) =>
    group(
      concat([
        path.call(print, "body", 0),
        concat([makeCall(path, opts, print), path.call(print, "body", 2)])
      ])
    ),
  top_const_field: prefix("::"),
  top_const_ref: prefix("::")
};

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
prettier-0.21.0 src/nodes/constants.js
prettier-0.20.1 src/nodes/constants.js
prettier-0.20.0 src/nodes/constants.js
prettier-0.19.1 src/nodes/constants.js
prettier-0.19.0 src/nodes/constants.js
prettier-0.18.2 src/nodes/constants.js
prettier-0.18.1 src/nodes/constants.js
prettier-0.18.0 src/nodes/constants.js
prettier-0.17.0 src/nodes/constants.js
prettier-0.16.0 src/nodes/constants.js
prettier-0.15.1 src/nodes/constants.js
prettier-0.15.0 src/nodes/constants.js
prettier-0.14.0 src/nodes/constants.js
prettier-0.13.0 src/nodes/constants.js
prettier-0.12.3 src/nodes/constants.js