Socket
Socket
Sign inDemoInstall

multiformats

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multiformats - npm Package Compare versions

Comparing version 1.1.10 to 1.1.11

coverage/tmp/coverage-4101-1593033068550-0.json

4

package.json
{
"name": "multiformats",
"version": "1.1.10",
"version": "1.1.11",
"description": "Interface for multihash, multicodec, multibase and CID.",

@@ -90,3 +90,3 @@ "main": "index.js",

"polendina": "^1.0.0",
"rollup": "^2.17.1",
"rollup": "^2.18.0",
"standard": "^14.3.4"

@@ -93,0 +93,0 @@ },

@@ -1,7 +0,9 @@

import globby from 'globby'
import path from 'path'
import { readdirSync, readFileSync } from 'fs'
import { fileURLToPath } from 'url'
import { dirname, join } from 'path'
let configs = []
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const _filter = p => !p.includes('/_') && !p.includes('rollup.config')
const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json')))

@@ -11,8 +13,14 @@ const relativeToMain = name => ({

renderChunk: source => {
while (source.includes("require('../index.js')")) {
source = source.replace("require('../index.js')", "require('multiformats')")
const lines = source.split('\n')
source = ''
for (let line of lines) {
if (line.includes("require('../index.cjs')")) {
line = line.replace("require('../index.cjs')", `require('${name}')`)
}
if (line.includes("require('../")) {
line = line.replace("require('../", `require('${name}/`)
line = line.replace('.cjs', '.js')
}
source += line + '\n'
}
while (source.includes("require('../")) {
source = source.replace('require(\'../', 'require(\'multiformats/')
}
return source

@@ -22,21 +30,14 @@ }

const plugins = [relativeToMain('multiformats')]
const add = (pattern) => {
configs = configs.concat(globby.sync(pattern).filter(_filter).map(inputFile => ({
input: inputFile,
output: {
plugins: pattern.startsWith('test') ? plugins : null,
file: path.join('dist', inputFile).replace('.js', '.cjs'),
format: 'cjs'
}
})))
}
add('*.js')
add('bases/*.js')
add('hashes/*.js')
add('codecs/*.js')
add('test/*.js')
add('test/fixtures/*.js')
const plugins = [relativeToMain(pkg.name)]
const dir = 'dist'
const preserveModules = true
const output = { dir, preserveModules, plugins, format: 'cjs', entryFileNames: '[name].cjs' }
const testdir = join(__dirname, 'test')
const filter = name => name.startsWith('test-')
const createConfig = f => ({ input: join('test', f), output })
const configs = readdirSync(testdir).filter(filter).map(createConfig)
console.log(configs)
export default configs

@@ -32,3 +32,3 @@ /* globals describe, it */

test('browser', () => {
same(__browser, !!process.browser)
same(!!__browser, !!process.browser)
})

@@ -35,0 +35,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc