{"version":3,"sources":["../source/helpers.js"],"names":["count_occurences","symbol","string","count","split","character"],"mappings":"AAAA;AACA,OAAO,SAASA,gBAAT,CAA0BC,MAA1B,EAAkCC,MAAlC,EAA0C;AAChD,MAAIC,KAAK,GAAG,CAAZ,CADgD,CAEhD;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,uBAAwBD,MAAM,CAACE,KAAP,CAAa,EAAb,CAAxB,kHAA0C;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA,QAA/BC,SAA+B;;AACzC,QAAIA,SAAS,KAAKJ,MAAlB,EAA0B;AACzBE,MAAAA,KAAK;AACL;AACD;;AACD,SAAOA,KAAP;AACA","sourcesContent":["// Counts all occurences of a symbol in a string\r\nexport function count_occurences(symbol, string) {\r\n\tlet count = 0\r\n\t// Using `.split('')` here instead of normal `for ... of`\r\n\t// because the importing application doesn't neccessarily include an ES6 polyfill.\r\n\t// The `.split('')` approach discards \"exotic\" UTF-8 characters\r\n\t// (the ones consisting of four bytes)\r\n\t// but template placeholder characters don't fall into that range\r\n\t// so skipping such miscellaneous \"exotic\" characters\r\n\t// won't matter here for just counting placeholder character occurrences.\r\n\tfor (const character of string.split('')) {\r\n\t\tif (character === symbol) {\r\n\t\t\tcount++\r\n\t\t}\r\n\t}\r\n\treturn count\r\n}"],"file":"helpers.js"}