Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Attribute.prototype.createOptionSet = function (name, options) {
var optionSetOptions = [];
if (options && options.length > 0) {
for (var i = 0; i < options.length; i++) {
var option = options[i];
optionSetOptions.push(new XrmMock.OptionSetValueMock(option.name, option.value));
}
}
var attribute = createAttribute(name, options[0]);
var enumAttribute = new XrmMock.EnumAttributeMock(attribute);
var optionSetAttribute = new XrmMock.OptionSetAttributeMock(enumAttribute, optionSetOptions);
addAttribute(optionSetAttribute);
return optionSetAttribute;
};