How to use @base2/pretty-print-object - 1 common examples

To help you get started, we’ve selected a few @base2/pretty-print-object examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algolia / react-element-to-jsx-string / src / formatter / formatComplexDataStructure.js View on Github external
export default (
  value: Object | Array,
  inline: boolean,
  lvl: number,
  options: Options
): string => {
  const normalizedValue = sortObject(value);

  const stringifiedValue = prettyPrint(normalizedValue, {
    transform: (currentObj, prop, originalResult) => {
      const currentValue = currentObj[prop];

      if (currentValue && isValidElement(currentValue)) {
        return formatTreeNode(
          parseReactElement(currentValue, options),
          true,
          lvl,
          options
        );
      }

      if (typeof currentValue === 'function') {
        return formatFunction(currentValue, options);
      }

@base2/pretty-print-object

Convert an object or array into a formatted string

BSD-2-Clause
Latest version published 2 years ago

Package Health Score

65 / 100
Full package analysis

Popular @base2/pretty-print-object functions