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

ipjs

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipjs - npm Package Compare versions

Comparing version 5.0.5 to 5.1.0

test/fixtures/pkg-single-export/input/index.js

2

package.json
{
"name": "ipjs",
"version": "5.0.5",
"version": "5.1.0",
"description": "Universal JavaScript build and packaging system",

@@ -5,0 +5,0 @@ "main": "src/build.js",

@@ -58,2 +58,4 @@ import { promises as fs, existsSync } from 'fs'

exports['.'] = { import: this.file(toURL(json.main || './index.js')) }
} else if (typeof json.exports === 'string') {
exports['.'] = { import: this.file(toURL(json.exports)) }
} else {

@@ -168,2 +170,6 @@ for (const [key, value] of Object.entries(json.exports)) {

async stubFiles (dist, overrides) {
if (typeof overrides === 'string') {
overrides = { '.': overrides }
}
await Promise.all(

@@ -170,0 +176,0 @@ Object.keys(overrides).map(async (file) => {

import build from '../src/build.js'
import tempy from 'tempy'
import { promises as fs } from 'fs'
import { fileURLToPath, pathToFileURL } from 'url'
import rmtree from '@tgrajewski/rmtree'
import { deepStrictEqual as same } from 'assert'
import verify from './fixtures/verify.js'
const eol = Buffer.from('\n')[0]
const strip = buff => {
if (buff[buff.byteLength - 1] === eol) {
return buff.slice(0, buff.byteLength -2)
}
return buff
}
export default async test => {

@@ -21,18 +11,2 @@ const url = new URL('fixtures/pkg-kitchensink/input', import.meta.url)

const verify = async (comp, input) => {
const files = await fs.readdir(comp)
for (const file of files) {
const url = new URL(comp + '/' + file)
const inputURL = new URL(input + '/' + file)
const stat = await fs.stat(url)
if (stat.isDirectory()) {
await verify(url, inputURL)
} else {
const valid = strip(await fs.readFile(url))
const data = strip(await fs.readFile(inputURL))
same(valid.toString(), data.toString())
}
}
}
test('pkg-kitchensink', async test => {

@@ -39,0 +13,0 @@ const dist = pathToFileURL(await tempy.directory())

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