Socket
Socket
Sign inDemoInstall

prettier-plugin-packagejson

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-packagejson - npm Package Compare versions

Comparing version 2.4.3 to 2.4.5

15

lib/esm-proxy/worker.js
const { runAsWorker } = require('synckit')
runAsWorker(async (id, path, args) => {
const root = await import(id)
const method = path.pop()
const receiver = path.reduce((acc, cur) => acc[cur], root)
return receiver[method](...args)
const { receiver, prop } = path.reduce(
({ receiver, prop }, cur) => ({
receiver: receiver[prop],
prop: cur,
}),
{
receiver: await import(id),
prop: path.shift(),
},
)
return receiver[prop].apply(receiver, args)
})

@@ -11,2 +11,8 @@ const requireSafe = require('./require')

function testPath(path) {
return /(^|\\|\/)package\.json$/.test(path)
}
exports.testPath = testPath
/** @type {import('prettier').Plugin['parsers']} */

@@ -17,3 +23,2 @@ exports.parsers = {

preprocess(text, options) {
// istanbul ignore next
if (parser.preprocess) {

@@ -23,7 +28,5 @@ text = parser.preprocess(text, options)

return options.filepath && /(^|\\|\/)package\.json$/.test(options.filepath)
? sortPackageJson.default(text)
: text
return testPath(options.filepath) ? sortPackageJson.default(text) : text
},
},
}
module.exports = path => {
try {
return require(path)
} catch (error) {}
} catch {}
}
{
"name": "prettier-plugin-packagejson",
"version": "2.4.3",
"version": "2.4.5",
"description": "Prettier package.json plugin to make the order of properties nice.",

@@ -27,12 +27,13 @@ "keywords": [

"test": "run-s lint test:*",
"test:unit": "jest"
"test:unit": "cross-env NODE_OPTIONS=--experimental-vm-modules jest"
},
"dependencies": {
"sort-package-json": "2.4.1",
"sort-package-json": "2.5.1",
"synckit": "0.8.5"
},
"devDependencies": {
"jest": "29.4.2",
"cross-env": "7.0.3",
"jest": "29.6.1",
"npm-run-all": "4.1.5",
"prettier": "2.8.4"
"prettier": "3.0.0"
},

@@ -39,0 +40,0 @@ "peerDependencies": {

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