<commit_before>"use strict";

// Return the panorama ID
var getPanoID = function(string) {
	let value = decodeURIComponent(string).match("^https:\/\/.*\!1s(.*)\!2e.*$");

	if (value === null) {
		throw "Incorrect URL";
	}

	return "F:" + value[1];
};

// Return Embed URL to use on iframe
var getEmbed = function(string) {
	let id = getPanoID(string);
	let embedURL = "https://www.google.com/maps/embed/v1/streetview?pano=" + id + "&key=YOUR_APIKEY";

	return embedURL;
};

// Method main
var main = function(url, options) {
	try {
		options = options || {};

		if (typeof options !== "object") {
			throw "Expected an object";
		}

		return options.embed ? getEmbed(url) : getPanoID(url);
	} catch (error) {
		return error;
	}
};

module.exports = main;<commit_msg>Using arrow functions on index.js<commit_after>"use strict";

// Return the panorama ID
const getPanoID = (url) => {
	let value = decodeURIComponent(url).match("^https:\/\/.*\!1s(.*)\!2e.*$");

	if (value === null) {
		throw "Incorrect URL";
	}

	return "F:" + value[1];
};

// Return Embed URL to use on iframe
const getEmbed = (url) => {
	let id = getPanoID(url);
	let embedURL = "https://www.google.com/maps/embed/v1/streetview?pano=" + id + "&key=YOUR_APIKEY";

	return embedURL;
};

const isObject = (item) => {
	if (typeof item !== "object") {
		throw "Expected an object";
	}
};

// Method main
function main(url, options) {
	try {
		options = options || {};

		isObject(options);

		return options.embed ? getEmbed(url) : getPanoID(url);
	} catch (error) {
		return error;
	}
}

module.exports = main;
{'fraction_non_alphanumeric': 0.18412698412698414, 'fraction_numerical': 0.005079365079365079, 'mean_word_length': 3.6904761904761907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '2687376', 'n_tokens_mistral': 607, 'n_tokens_neox': 573, 'n_words': 142}