Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@multiformats/murmur3

Package Overview
Dependencies
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@multiformats/murmur3 - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

coverage/tmp/coverage-3763-1593032662508-0.json

2

package.json
{
"name": "@multiformats/murmur3",
"version": "0.0.5",
"version": "0.0.6",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,17 +0,24 @@

import globby from 'globby'
import path from 'path'
import { readdirSync, readFileSync } from 'fs'
import { fileURLToPath } from 'url'
import { dirname, join } from 'path'
let configs = [{
input: 'index.js',
output: {
file: 'dist/index.cjs',
format: 'cjs'
}
}]
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json')))
const relativeToMain = name => ({
name: 'relative-to-main',
renderChunk: source => {
while (source.includes("require('../index.js')")) {
source = source.replace("require('../index.js')", `require('${name}')`)
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'
}

@@ -22,16 +29,14 @@ return source

const plugins = [relativeToMain('@multiformats/sha3')]
const add = (pattern) => {
configs = configs.concat(globby.sync(pattern).map(inputFile => ({
input: inputFile,
output: {
plugins,
file: path.join('dist', inputFile).replace('.js', '.cjs'),
format: 'cjs'
}
})))
}
add('test/*.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
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc