| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 | 
							- import { element } from "./element.js";
 
- import { submission } from "./submission.js";
 
- import { project } from "./project.js";
 
- import { is_string } from "./functions.js";
 
- class database {
 
-     #content;
 
-     constructor(content) {
 
-         if (!(content instanceof project)) {
 
-             throw "Content must be instance of an project.";
 
-         }
 
-         this.#content = content;
 
-     }
 
-     get content() {
 
-         return this.#content;
 
-     }
 
-     search(input) {
 
-         if (!is_string(input)) {
 
-             throw "Phrase to search must be string.";
 
-         }
 
-         const content = this.#content;
 
-         const phrase = input.trim().toLowerCase();
 
-         const result = [];
 
-         
 
-         content.submissions.forEach(submission => {
 
-             if (submission.name.toLowerCase().search(phrase) !== -1 ) {
 
-                 result.push(submission);
 
-             }
 
-             submission.elements.forEach(element => {
 
-                 if (element.name.toLowerCase().search(phrase) !== -1) {
 
-                     result.push(element);
 
-                 }
 
-             });
 
-         });
 
-         return result;
 
-     }
 
- } 
 
- export { database };
 
 
  |