How to use normalize-newline - 6 common examples

To help you get started, we’ve selected a few normalize-newline 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 FormidableLabs / spectacle / config / plugins / mdx-plugin / parse.js View on Github external
const parse = (src, options) => {
  const inlineModules = [];
  const { data, content } = matter(src);

  const separatedContent = normalizeNewline(content)
    /*
     * Set aside all inline JSX import and export statements from the MDX file.
     * When mdx.sync() compiles MDX into JSX, it will stub any component that doesn't
     * have a corresponding import. Therefore, we will re-add all of the imports/exports
     * to each slide before compiling the MDX via mdx.sync().
     */
    .replace(MOD_REG, (value, group1) => {
      if (!group1) {
        // group1 is empty, so this is not the import/export case we're looking for
        return value;
      } else {
        // found an inline export or import statement
        inlineModules.push(value);
        return '';
      }
    })
github lerna / lerna / test / UpdatedCommand.js View on Github external
const consoleOutput = () => output.mock.calls.map(args => normalizeNewline(args[0]));
github lerna / lerna / test / PublishCommand.js View on Github external
const consoleOutput = () => output.mock.calls.map(args => normalizeNewline(args[0]));
github lerna / lerna / test / LsCommand.js View on Github external
const consoleOutput = () => output.mock.calls.map(args => normalizeNewline(args[0]));
github mosjs / mos / packages / mos / src / cli.js View on Github external
afterEachRender (opts) {
        if (normalizeNewline(opts.newMD) !== normalizeNewline(opts.currentMD)) {
          fs.writeFileSync(opts.filePath, opts.newMD, {
            encoding: 'utf8',
          })
          const relativePath = normalizePath(getRelativePath(opts.filePath))
          console.log('updated', highlightPath(relativePath))
        }
      },
    })
github mosjs / mos / packages / mos / src / cli.js View on Github external
afterEachRender (opts) {
          const relativePath = normalizePath(getRelativePath(opts.filePath))
          t.equal(normalizeNewline(opts.newMD), normalizeNewline(opts.currentMD), relativePath)
        },
      })

normalize-newline

Normalize the newline characters in a string to `\n`

MIT
Latest version published 4 years ago

Package Health Score

50 / 100
Full package analysis

Popular normalize-newline functions