How to use the ferrum.mapSort 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 / readmeBuilder.js View on Github external
return (schemas) => {
    if (readme) {
      console.log('building readme');
      const toplevel = flist(pipe(
        schemas,
        filter(schema => !schema[s.parent]), // remove schemas with a parent
        mapSort(schema => gentitle(schema[s.titles], schema[keyword`type`])),
        map(schema => listItem(paragraph([
          link(`./${schema[s.slug]}.md`, gendescription(schema), [text(gentitle(schema[s.titles], schema[keyword`type`]))]),
          text(' – '),
          inlineCode(schema[keyword`$id`] || '-'),
        ]))),
      ), Array);

      const bytype = type => flist(pipe(
        schemas,
        filter(schema => schema[keyword`type`] === type), // remove schemas without matching type
        filter(schema => !!schema[s.parent]), // keep only schemas with a parent
        mapSort(schema => gentitle(schema[s.titles], schema[keyword`type`])),
        map(schema => listItem(paragraph([
          link(`./${schema[s.slug]}.md`, gendescription(schema), [text(gentitle(schema[s.titles], schema[keyword`type`]))]),
          text(' – '),
          inlineCode(`${schema[s.id]}#${schema[s.pointer]}`),
github adobe / jsonschema2md / lib / readmeBuilder.js View on Github external
const bytype = type => flist(pipe(
        schemas,
        filter(schema => schema[keyword`type`] === type), // remove schemas without matching type
        filter(schema => !!schema[s.parent]), // keep only schemas with a parent
        mapSort(schema => gentitle(schema[s.titles], schema[keyword`type`])),
        map(schema => listItem(paragraph([
          link(`./${schema[s.slug]}.md`, gendescription(schema), [text(gentitle(schema[s.titles], schema[keyword`type`]))]),
          text(' – '),
          inlineCode(`${schema[s.id]}#${schema[s.pointer]}`),
        ]))),
      ), Array);

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

60 / 100
Full package analysis