<commit_before>var extent = require('turf-extent'),
    point = require('turf-point');

/**
* Calculates the absolute center point of all features.
*
* @module turf/center
* @param {FeatureCollection} a GeoJSON Feature or FeatureCollection
* @return {FeatureCollection} a GeoJSON FeatureCollection of the
* absolute center points of all input features
* @example
* var features = [
*     turf.point(-97.522259, 35.469100),
*     turf.point(-97.502754, 35.463455),
*     turf.point(-97.508269, 35.463245),
*     turf.point(-97.516809, 35.465779),
*     turf.point(-97.515372, 35.467072),
*     turf.point(-97.509363, 35.463053),
*     turf.point(-97.511123, 35.466601),
*     turf.point(-97.518547, 35.469327),
*     turf.point(-97.519706, 35.469659),
*     turf.point(-97.517839, 35.466998),
*     turf.point(-97.508678, 35.464942),
*     turf.point(-97.514914, 35.463453)
* ];
* var fc = turf.featurecollection(features);
* var centerPt = turf.center(fc);
* //=centerPt
*/

module.exports = function(layer, done){
  var ext = extent(layer);
  var x = (ext[0] + ext[2])/2;
  var y = (ext[1] + ext[3])/2;
  return point([x, y]);
};
<commit_msg>Small style fix in example<commit_after>var extent = require('turf-extent'),
    point = require('turf-point');

/**
* Calculates the absolute center point of all features.
*
* @module turf/center
* @param {FeatureCollection} fc a GeoJSON Feature or FeatureCollection
* @return {FeatureCollection} a GeoJSON FeatureCollection of the
* absolute center points of all input features
* @example
* var features = [
*     turf.point(-97.522259, 35.469100),
*     turf.point(-97.502754, 35.463455),
*     turf.point(-97.508269, 35.463245),
*     turf.point(-97.516809, 35.465779),
*     turf.point(-97.515372, 35.467072),
*     turf.point(-97.509363, 35.463053),
*     turf.point(-97.511123, 35.466601),
*     turf.point(-97.518547, 35.469327),
*     turf.point(-97.519706, 35.469659),
*     turf.point(-97.517839, 35.466998),
*     turf.point(-97.508678, 35.464942),
*     turf.point(-97.514914, 35.463453)
* ];
* var fc = turf.featurecollection(features);
* var centerPt = turf.center(fc);
*
* var result = turf.featurecollection(fc.features.concat(centerPt.features));
*
* //=result
*/

module.exports = function(layer, done){
  var ext = extent(layer);
  var x = (ext[0] + ext[2])/2;
  var y = (ext[1] + ext[3])/2;
  return point([x, y]);
};

{'fraction_non_alphanumeric': 0.17842149454240133, 'fraction_numerical': 0.16624685138539042, 'mean_word_length': 3.609284332688588, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3149563', 'n_tokens_mistral': 1160, 'n_tokens_neox': 904, 'n_words': 182}