How to use the ferrum.list function in ferrum

To help you get started, we’ve selected a few ferrum 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 adobe / jsonschema2md / lib / markdownBuilder.js View on Github external
...makecomment(schema),
        table('left', [
          // iterate over header
          tableRow(
            flist(
              map(headerprops,
                ({ name, title }) => {
                  if (links[name]) {
                    return tableCell(link(links[name], i18n`What does ${title} mean?`, text(title)));
                  }
                  return tableCell(text(title));
                }), Array,
            ),
          ),
          tableRow(
            flist(
              map(headerprops,
                (prop) => {
                  // this is a linked property
                  if (schema[s.meta]
                    && typeof schema[s.meta][prop.name] === 'object'
                    && schema[s.meta][prop.name].link
                    && schema[s.meta][prop.name].text) {
                    return tableCell(link(rewritelinks(schema[s.meta][prop.name].link), i18n`open original schema`, [text(schema[s.meta][prop.name].text)]));
                  }
                  const value = schema[s.meta] ? schema[s.meta][prop.name] : undefined;
                  return tableCell(text(prop[`${String(value)}label`] || i18n`Unknown`));
                }), Array,
            ),
          ),
        ]),
      ];
github adobe / jsonschema2md / lib / markdownBuilder.js View on Github external
function makeproplist(properties = {},
    patternProperties = {},
    additionalProperties,
    required,
    level = 2) {
    return [
      ...flist(flat(Object.entries(properties || {}).map(([name, definition]) => {
        const description = definition[s.meta] && definition[s.meta].longdescription ? definition[s.meta].longdescription : paragraph(text(i18n`no description`));

        return [
          heading(level + 1, text(name)),
          description,
          ...makecomment(definition),
          paragraph(inlineCode(name)),
          makefactlist(name, definition, required),
          ...maketypesection(definition, level + 1),
          ...makeconstraintssection(definition, level + 1),
          ...makedefault(definition, level + 1),
          ...makeexamples(definition, level + 1),
          ...makerestrictions(definition, level + 1),
        ];
      }))),
      ...flist(flat(Object.entries(patternProperties || {}).map(([name, definition]) => {
github adobe / jsonschema2md / lib / readmeBuilder.js View on Github external
function makeversionnote(schemas) {
  const versions = flist(uniq(schemas
    .map(schema => schema[keyword`$schema`])
    .filter(e => !!e)));

  if (versions.length === 1) {
    return [
      heading(2, text(i18n`Version Note`)),
      paragraph([
        text('The schemas linked above follow the JSON Schema Spec version: '),
        inlineCode(versions[0]),
      ]),
    ];
  }
  return [];
}

ferrum

Features from the rust language in javascript: Provides Traits/Type classes & an advanced library for working with sequences/iterators in js.

Apache-2.0
Latest version published 3 years ago

Package Health Score

62 / 100
Full package analysis