@nozbe/watermelondb
Version:
Build powerful React Native and React web apps that scale from hundreds to tens of thousands of records and remain fast
18 lines (16 loc) • 652 B
JavaScript
;
exports.__esModule = true;
exports.default = exports.censorValue = void 0;
var _fp = require("../utils/fp");
// beginning, end, length
var censorValue = exports.censorValue = function (value) {
return "".concat(value.slice(0, 2), "***").concat(value.slice(-2), "(").concat(value.length, ")");
};
var shouldCensorKey = function (key) {
return 'id' !== key && !key.endsWith('_id') && '_status' !== key && '_changed' !== key;
};
// $FlowFixMe
var censorRaw = (0, _fp.mapObj)(function (value, key) {
return shouldCensorKey(key) && 'string' === typeof value ? censorValue(value) : value;
});
var _default = exports.default = censorRaw;