@relative-ci/agent
Version:
Send bundle stats and CI build information to RelativeCI
22 lines (19 loc) • 626 B
JavaScript
import _ from 'lodash';
import { MASK } from '../constants.js';
function maskValue(value) {
if (!value || !value?.toString) {
return MASK;
}
const text = value.toString();
return `${MASK}${text.substring(text.length - 6)}`;
}
function maskObjectProperties(data, paths) {
const normalizedData = _.merge({}, data);
paths.forEach((propertyPath) => {
const value = _.get(normalizedData, propertyPath, '');
_.set(normalizedData, propertyPath, maskValue(value));
});
return normalizedData;
}
export { maskObjectProperties };
//# sourceMappingURL=mask-object-property.js.map