Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function shiftPositionByOffset<
T: {
+line: ?Number1,
+column: ?Number0,
...
},
>(pos: T, offset: GeneratedOffset): T {
return {
...pos,
line: pos.line != null ? add(pos.line, offset.lines) : null,
column: pos.column != null ? add(pos.column, offset.columns) : null,
};
}
function shiftPositionByOffset<
T: {
+line: ?Number1,
+column: ?Number0,
...
},
>(pos: T, offset: GeneratedOffset): T {
return {
...pos,
line: pos.line != null ? add(pos.line, offset.lines) : null,
column: pos.column != null ? add(pos.column, offset.columns) : null,
};
}