Skip to content

Commit

Permalink
cast collection as record for now
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklloyd committed May 22, 2021
1 parent 4292f5c commit cdb462b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import { camelCase } from 'camel-case'
import chalk from 'chalk'
import fs from 'fs-extra'
import path from 'path'
import * as readline from 'readline'
import emoji from 'node-emoji'
import path from 'path'
import { CollectionDefinition } from 'postman-collection'
import * as readline from 'readline'
import yargs from 'yargs'
import { DownloadService } from './application/DownloadService'
import { PostmanService } from './application/PostmanService'
Expand Down Expand Up @@ -284,9 +284,12 @@ require('dotenv').config()
if (postman.isGuid(collectionIdentification)) {
await postman.updateCollection(JSON.parse(collectionString), collectionIdentification)
} else {
const pmColl = (await postman.findCollectionByName(collectionIdentification)) as any
if (pmColl && pmColl.uid) {
await postman.updateCollection(JSON.parse(collectionString), pmColl.uid)
const pmColl = (await postman.findCollectionByName(collectionIdentification)) as Record<
string,
unknown
>
if (pmColl?.uid) {
await postman.updateCollection(JSON.parse(collectionString), pmColl.uid as string)
} else {
await postman.createCollection(JSON.parse(collectionString))
}
Expand Down

0 comments on commit cdb462b

Please sign in to comment.