How to use the ferrum.join 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 / helix-pipeline / src / html / parse-frontmatter.js View on Github external
mdast.children.splice(block.start + off, cnt, dat);
      off += -cnt + 1; // cnt removed, 1 inserted
    } else {
      const { warning, source, start } = block;
      const fst = mdast.children[start + off];

      // This also needs to account for settext headings
      // hence the usage of end here, instead of using start
      const { line } = fst.position.end;

      // Source file pretty printing with line numbers
      const sourceref = pipe(
        source.split('\n'),
        zipLeast2(range(line, Infinity)),
        map(([l, no]) => `    ${no} | ${l} `),
        join('\n'),
      );

      const err = new FrontmatterParsingError(`${warning}\n${sourceref}`);
      if (!production()) {
        logger.warn(err);
      }
      logger.debug(err);
    }
  }
};
github adobe / helix-pipeline / src / html / set-surrogate-key.js View on Github external
function key(context, { logger }) {
  const cont = setdefault(context, 'content', {});
  const res = setdefault(context, 'response', {});
  const headers = setdefault(res, 'headers', {});

  // somebody already set a surrogate key
  if (headers['Surrogate-Key'] || !(type(cont.sources) === Array)) {
    logger.debug('Keeping existing Surrogate-Key header');
    return;
  }

  logger.debug('Setting Surrogate-Key header');
  headers['Surrogate-Key'] = join(' ')(map(cont.sources, computeSurrogateKey));
}

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 2 years ago

Package Health Score

62 / 100
Full package analysis