Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractPackageIndexes ¶
ExtractPackageIndexes find where a package is defined in a json source file. It returns the block indexes along with name and version. It assumes:
- the package won't be declared twice in the same block
- the declaration will be shaped as "<package name>" : "<version or constraints>"
If no targeted version is passed, it will search for any version ¶
You can see the regex in action here: https://regex101.com/r/zzrEAh/1 It matches the following: "@typescript-eslint/eslint-plugin": "^5.12.0", "test": "3"
The expected result of FindAllStringSubmatchIndex is a [6]int, with the following structure : - index 0/1 represents block start/end - index 2/3 represents name start/end - index 4/5 represents version start/end
func GetSectionOffset ¶
GetSectionOffset computes the start line of any section in the file. To see the regex in action, check out https://regex101.com/r/3EHqB8/1 (it uses the dependencies section as an example) It matches lines like this:
"dependencies": {
Types ¶
This section is empty.