export function updateSpecLabels()

in src/utilities/manifestSpecLabelUtils.ts [8:30]


export function updateSpecLabels(
   inputObject: any,
   newLabels: Map<string, string>,
   override: boolean
) {
   if (!inputObject) throw NullInputObjectError

   if (!inputObject.kind) throw InputObjectKindNotDefinedError

   if (!newLabels) return

   let existingLabels = getSpecLabels(inputObject)
   if (override) {
      existingLabels = newLabels
   } else {
      existingLabels = existingLabels || new Map<string, string>()
      Object.keys(newLabels).forEach(
         (key) => (existingLabels[key] = newLabels[key])
      )
   }

   setSpecLabels(inputObject, existingLabels)
}