Common functions and utilities for tasks related to package.json
- Source:
Members
(inner, constant) isDependencyMap :Joi
Joi schema for validating dependency map.
Type:
- Joi
- Source:
(inner, constant) isPackageJsonWithDependencies :Joi
Joi schema for validating package json object. Checks if the object has all the dependency types and the dependency types are valid.
Type:
- Joi
- Source:
Methods
(inner) getDependencyVersion(attrs) → {string}
Determines the dependency version based on the dependency type.
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
attrs |
object | Refer to individual attributes Properties
|
- Source:
Throws:
-
-
- Error message if unknown dependency type provided
- Type
- string
-
-
-
- Error if wanted dependency is not present
- Type
- InvalidParameter
-
Returns:
Semver range of the wanted dependency (eg. ~2.1.6 or >=3.0.0 or <4.0.0)
- Type
- string