/**
 * Copyright (c) 2020-present, Goldman Sachs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { V1_CBoolean, V1_CDecimal, V1_CFloat, V1_CInteger, } from '@finos/legend-graph';
import { guaranteeIsBoolean, guaranteeIsNumber, guaranteeIsString, } from '@finos/legend-shared';
import { action } from 'mobx';
export const V1_PrimitiveValue_setValue = action((target, val) => {
    if (target instanceof V1_CBoolean) {
        target.value = guaranteeIsBoolean(val);
    }
    else if (target instanceof V1_CDecimal ||
        target instanceof V1_CFloat ||
        target instanceof V1_CInteger) {
        target.value = guaranteeIsNumber(val);
    }
    else {
        target.value = guaranteeIsString(val);
    }
});
export const V1_AppliedProperty_setProperty = action((target, val) => {
    target.property = val;
});
export const V1_Collection_setValues = action((target, val) => {
    target.values = val;
});
//# sourceMappingURL=V1_ValueSpecificationModifierHelper.js.map