public processKey()

in app/exec/extension/_lib/targets/Microsoft.VisualStudio.Services/vso-manifest-builder.ts [85:179]


	public processKey(key: string, value: any, override: boolean): void {
		switch (key.toLowerCase()) {
			case "eventcallbacks":
				if (_.isObject(value)) {
					this.singleValueProperty("eventCallbacks", value, key, override);
				}
				break;
			case "constraints":
				if (_.isArray(value)) {
					if (!this.data.constraints) {
						this.data.constraints = [];
					}
					this.data.constraints = this.data.constraints.concat(value);
				} else {
					throw new Error(`"constraints" must be an array of ContributionConstraint objects.`);
				}
				break;
			case "restrictedto":
				if (_.isArray(value)) {
					this.singleValueProperty("restrictedTo", value, key, override, true);
				} else {
					throw new Error(`"restrictedTo" must be an array of strings.`);
				}
				break;
			case "manifestversion":
				let version = value;
				if (_.isString(version)) {
					version = parseFloat(version);
				}
				this.singleValueProperty("manifestVersion", version, key, override);
				break;
			case "scopes":
				if (_.isArray(value)) {
					if (!this.data.scopes) {
						this.data.scopes = [];
					}
					this.data.scopes = _.uniq(this.data.scopes.concat(value));
				}
				break;
			case "baseuri":
				this.singleValueProperty("baseUri", value, key, override);
				break;
			case "contributions":
				if (_.isArray(value)) {
					if (!this.data.contributions) {
						this.data.contributions = [];
					}
					this.data.contributions = this.data.contributions.concat(value);
				} else {
					throw new Error('"contributions" must be an array of Contribution objects.');
				}
				break;
			case "contributiontypes":
				if (_.isArray(value)) {
					if (!this.data.contributionTypes) {
						this.data.contributionTypes = [];
					}
					this.data.contributionTypes = this.data.contributionTypes.concat(value);
				}
				break;

			// Ignore all the vsixmanifest keys so we can take a default case below.
			case "branding":
			case "categories":
			case "content":
			case "description":
			case "details":
			case "extensionid":
			case "files":
			case "flags":
			case "galleryflags":
			case "galleryproperties":
			case "githubflavoredmarkdown":
			case "icons":
			case "id":
			case "links":
			case "name":
			case "namespace":
			case "public":
			case "publisher":
			case "releasenotes":
			case "screenshots":
			case "showpricingcalculator":
			case "tags":
			case "targets":
			case "version":
			case "vsoflags":
				break;
			default:
				if (key.substr(0, 2) !== "__") {
					this.singleValueProperty(key, value, key, override);
				}
				break;
		}
	}