New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jest-buble

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-buble - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

20

index.js
const buble = require('buble')
const fs = require('fs')
const path = require('path')
function createProcess (bubleOptions) {
return function process (src) {
return buble.transform(src, bubleOptions).code
let options = {}
try {
const configLoc = path.resolve(process.cwd(), '.bublerc')
options = JSON.parse(fs.readFileSync(configLoc))
} catch (e) {}
module.exports = {
process: function process (src) {
return buble.transform(src, options).code
}
}
module.exports = function create (bubleOptions) {
return { process: createProcess(bubleOptions) }
}
module.exports.process = createProcess()

2

package.json
{
"name": "jest-buble",
"version": "1.0.1",
"version": "2.0.0",
"description": "Jest plugin to use buble for transformation.",

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

@@ -20,21 +20,9 @@ # jest-buble

Jest doesn't support passing in options to transformers, so you can initialise `jest-buble` in another file first:
Jest doesn't support passing in options to transformers through their config, so you can define a `.bublerc` JSON file with your buble options:
```js
// jest.transform.js
const createTransformer = require('jest-buble')
module.exports = createTransformer({
objectAssign: 'Object.assign'
})
```json
// .bublerc
{
"objectAssign": "Object.assign"
}
```
then for the jest config:
```json
"jest": {
"transform": {
"^.+\\.js$": "./jest.transform.js"
}
}
```
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