<commit_before>import makeCanvasAndContext from '../../util/makeCanvasAndContext';
import drawPolygonsOnContext from '../../util/drawPolygonsOnContext';

// https://github.com/Automattic/node-canvas#pdf-support
let allowedFormats = [ 'svg', 'pdf' ];

export default function ( polygons, size, options ) {
	let dpr = options && options.dpr ? options.dpr : 1;
	let format = options && options.format ? options.format : false;
	
	format = allowedFormats[format].indexOf( format ) === -1 ? undefined : format;
	
	let canvasData = makeCanvasAndContext( size, options, dpr, format );
	
	drawPolygonsOnContext( canvasData.ctx, polygons, size );<commit_msg>fix issue in node buffer code<commit_after>import makeCanvasAndContext from '../../util/makeCanvasAndContext';
import drawPolygonsOnContext from '../../util/drawPolygonsOnContext';

// https://github.com/Automattic/node-canvas#pdf-support
let allowedFormats = [ 'svg', 'pdf' ];

export default function ( polygons, size, options ) {
	let dpr = options && options.dpr ? options.dpr : 1;
	let format = options && options.format ? options.format : false;
	
	format = allowedFormats.indexOf( format ) === -1 ? undefined : format;
	
	let canvasData = makeCanvasAndContext( size, options, dpr, format );
	
	drawPolygonsOnContext( canvasData.ctx, polygons, size );
{'fraction_non_alphanumeric': 0.1362940275650842, 'fraction_numerical': 0.0030627871362940277, 'mean_word_length': 4.633620689655173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5756048', 'n_tokens_mistral': 396, 'n_tokens_neox': 381, 'n_words': 101}