Socket
Socket
Sign inDemoInstall

write-pkg

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

write-pkg - npm Package Compare versions

Comparing version 6.0.0 to 6.0.1

2

index.d.ts

@@ -26,3 +26,3 @@ import type {PackageJson, JsonObject} from 'type-fest';

*/
type PackageJsonData = PackageJson | JsonObject; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents
type PackageJsonData = PackageJson | JsonObject;

@@ -29,0 +29,0 @@ /**

{
"name": "write-pkg",
"version": "6.0.0",
"version": "6.0.1",
"description": "Write a package.json file",

@@ -37,5 +37,5 @@ "license": "MIT",

"deepmerge-ts": "^5.1.0",
"read-pkg": "^8.0.0",
"read-pkg": "^8.1.0",
"sort-keys": "^5.0.0",
"type-fest": "^3.13.0",
"type-fest": "^4.6.0",
"write-json-file": "^5.0.0"

@@ -45,7 +45,14 @@ },

"ava": "^5.3.1",
"esmock": "^2.5.8",
"filter-anything": "^3.0.7",
"tempy": "^3.1.0",
"tsd": "^0.28.1",
"xo": "^0.54.2"
"tsd": "^0.29.0",
"xo": "^0.56.0"
},
"ava": {
"nodeArguments": [
"--loader=esmock",
"--no-warnings=ExperimentalWarning"
]
}
}

@@ -8,3 +8,3 @@ import path from 'node:path';

export async function addPackageDependencies(filePath, dependencies, options) {
return hasMultipleDependencyTypes(dependencies)
return hasMultipleDependencyTypes(typeof filePath === 'string' ? dependencies : filePath)
? updatePackage(filePath, {...dependencies}, options)

@@ -15,3 +15,3 @@ : updatePackage(filePath, {dependencies}, options);

export function addPackageDependenciesSync(filePath, dependencies, options) {
return hasMultipleDependencyTypes(dependencies)
return hasMultipleDependencyTypes(typeof filePath === 'string' ? dependencies : filePath)
? updatePackageSync(filePath, {...dependencies}, options)

@@ -18,0 +18,0 @@ : updatePackageSync(filePath, {dependencies}, options);

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