1import{Model}from"../models/model.js";export class Collection{constructor(e){null==e&&(e=[]),this.reset(e)}model(){throw new Error(`${this.constructor.name} doesn't declare a model`)}reset(e){for(var s of(null==e&&(e=[]),this.models=[],e))this.add(s)}add(e){if(e instanceof Model)this.models.push(e);else if(e instanceof Array)for(var s of e)this.add(s);else e instanceof Collection?this.models.push(...e.all()||[]):this.models.push(new(this.model())(e))}remove(e){this.models.splice(this.models.indexOf(e),1)}size(){return this.models.length}isEmpty(){return 0===this.models.length}each(e){for(var s of this.models)e(s)}all(){return this.models}contains(e){return this.models.includes(e)}findBy(e,s){return this.models.find(o=>o[e]===s)}findAllBy(e,s){return this.models.filter(o=>o[e]===s)}countAllBy(e,s){let o=0;for(var t of this.models)t[e]===s&&(o+=1);return o}}
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.