(x, y, round)
| 960 | // @factory L.point(coords: Object) |
| 961 | // Expects a plain object of the form `{x: Number, y: Number}` instead. |
| 962 | function toPoint(x, y, round) { |
| 963 | if (x instanceof Point) { |
| 964 | return x; |
| 965 | } |
| 966 | if (isArray(x)) { |
| 967 | return new Point(x[0], x[1]); |
| 968 | } |
| 969 | if (x === undefined || x === null) { |
| 970 | return x; |
| 971 | } |
| 972 | if (typeof x === 'object' && 'x' in x && 'y' in x) { |
| 973 | return new Point(x.x, x.y); |
| 974 | } |
| 975 | return new Point(x, y, round); |
| 976 | } |
| 977 | |
| 978 | /* |
| 979 | * @class Bounds |
no test coverage detected