Import postman variables correctly (#1142)

Co-authored-by: Liyas Thomas <liyascthomas@gmail.com>
This commit is contained in:
Scott Dutton
2020-09-05 07:37:37 +01:00
committed by GitHub
parent 92e7453c31
commit da5fdd54bd

View File

@@ -139,6 +139,8 @@ export default {
// Do nothing
}
} else if (collections.info && collections.info.schema.includes("v2.1.0")) {
//replace the variables, postman uses {{var}}, Hoppscotch uses <<var>>
collections = JSON.parse(content.replaceAll(/{{([a-z]+)}}/gi, '<<$1>>'))
collections = this.parsePostmanCollection(collections)
} else {
return this.failedImport()