This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* convert sequence of numbers in an array to range of numbers | |
* @param {Array} arr | |
* @return {Array} | |
* @example | |
* var arrayOfNumbers = [ 2, 3, 4, 5, 475, 476, 477, 478, 479, 6, 8, 9, 10, 400, 480 ]; | |
* var result = convert_number_sequence_to_range(arrayOfNumbers); // => [ '2-6', '8-10', '400', '475-480' ] | |
*/ | |
var convert_number_sequence_to_range = function(arr) { | |
var sortedArr = arr.sort(function(a, b) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* adds a `each` method to a data collection that's use for iteration over the data (array or objects) | |
* @param {array|object} collection | |
* @example | |
* var c = eachify(['a', 'b', 'c']); | |
* c.each(function(item, i) { | |
* console.log('index=' + i, 'value=' + item); | |
* }); | |
* | |
* @example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dotNotationToObject (str) { | |
var obj = {}; | |
var prev = null; | |
str.split('.').forEach(function(prop){ | |
//console.log('prop', prop); | |
if(prev) { | |
//console.log('prev', prev); | |
//obj = prev; | |
prev[prop] = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "AppName", | |
"description": "", | |
"version": "0.0.1", | |
"manifest_version": 2, | |
"icons": { | |
"48": "logo_enable.png" | |
}, | |
"permissions": [ | |
"tabs", |