just-scripts
Version:
Just Stack Scripts
20 lines • 1.12 kB
TypeScript
import { PackageJson } from '../interfaces/PackageJson';
/**
* Merges an incoming package.json with an original semantically. It can only handle merging
* dependencies and devDependencies for ranges that look like "^x.y.z" or "~x.y.z" or "x.y.z".
*
* @param original Original package.json contents.
* @param incoming Incoming package.json contents.
* @returns Returns a new package.json object if any changes were needed, or returns `original`
* if not. (You can tell if changes were made by checking the object identity.)
*/
export declare function mergePackageJson(original: PackageJson, incoming: PackageJson): PackageJson;
/**
* Exported for testing only. Determines whether a dep should be updated.
* Returns false if either version includes semver elements we don't understand
* (any characters besides number and ~ ^).
* @param originalVersion The original dep version (default 0.0.0)
* @param incomingVersion The incoming dep version
*/
export declare function _shouldUpdateDep(originalVersion: string | undefined, incomingVersion: string): boolean;
//# sourceMappingURL=mergePackageJson.d.ts.map