revert strict

This commit is contained in:
Ben Irvin 2023-01-30 10:22:20 +01:00
parent e027d73fe3
commit 71a4e6ed29

View File

@ -9,16 +9,15 @@ const strategies = {
// Diffs allowed on specific attributes properties
strict(diffs: Diff[]) {
const isIgnorableDiff = (diff: Diff) => {
const isIgnorableDiff = ({ path }: Diff) => {
return (
// Ignore cases where...
diff.path.length === 3 &&
path.length === 3 &&
// Root property must be attributes
diff.path[0] === 'attributes' &&
path[0] === 'attributes' &&
// Need a valid string attribute name
typeof diff.path[1] === 'string' &&
typeof path[1] === 'string' &&
// The diff must be on ignorable attribute properties
['private', 'required', 'configurable'].includes(diff.path[2])
['private', 'required', 'configurable'].includes(path[2])
);
};