How to use just-entries - 1 common examples

To help you get started, we’ve selected a few just-entries 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 anarock / pebble / stories / Combinations.tsx View on Github external
function getJSXSource(componentName: string, props: any) {
  const _entries = entries(props);
  let jsxProps = _entries.reduce(
    (acc, entry) =>
      (acc += `${entry[0]}={${
        typeof entry[1] === "string" ? `"${entry[1]}"` : entry[1]
      }} `),
    ""
  );
  return prettier.format(`<${componentName} ${jsxProps}>`, {
    parser: "babylon",
    plugins: [babylon]
  });
}

just-entries

return object entries as an array of [key, value] pairs

MIT
Latest version published 1 year ago

Package Health Score

60 / 100
Full package analysis

Popular just-entries functions