function polygon(coordinates, properties, options) {
    if (options === void 0) { options = {}; }
    for (var _i = 0, coordinates_1 = coordinates; _i < coordinates_1.length; _i++) {
        var ring = coordinates_1[_i];
        if (ring.length < 4) {
            throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");
        }
        for (var j = 0; j < ring[ring.length - 1].length; j++) {
            // Check if first point of Polygon contains two numbers
            if (ring[ring.length - 1][j] !== ring[0][j]) {
                throw new Error("First and last Position are not equivalent.");
            }
        }
    }
    var geom = {
        type: "Polygon",
        coordinates: coordinates,
    };
    return feature(geom, properties, options);
}
Creates a {@link Polygon} {@link Feature} from an Array of LinearRings.

@name polygon
@param {Array<Array<Array<number>>>} coordinates an array of LinearRings
@param {Object} [properties={}] an Object of key-value pairs to add as properties
@param {Object} [options={}] Optional Parameters
@param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
@param {string|number} [options.id] Identifier associated with the Feature
@returns {Feature<Polygon>} Polygon Feature
@example
var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], { name: 'poly1' });

//=polygon