PageSourceSearch

https://pika.page/assets/ccount-1d237ae31bef7ca518660ff4c850622f1652e59fb924876286bc77900df050ab.js

js pika.page collected 2026-10-03 21:43:15 UTC 553 bytes, 14 lines download raw bytes

1// [email protected] downloaded from https://ga.jspm.io/npm:[email protected]/index.js
2
3/**
4 * Count how often a character (or substring) is used in a string.
5 *
6 * @param {string} value
7 *   Value to search in.
8 * @param {string} character
9 *   Character (or substring) to look for.
10 * @return {number}
11 *   Number of times `character` occurred in `value`.
12 */
13function ccount(t,e){const n=String(t);if("string"!==typeof e)throw new TypeError("Expected character");let r=0;let c=n.indexOf(e);while(-1!==c){r++;c=n.indexOf(e,c+e.length)}return r}export{ccount};
14

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.