* [CHANGELOG.md]() - [README.md]() - [package.json]() - [PROMPT.md]() * [chloggen.md]() # cavalion-js * [openai.com](https://chat.:) * [String Word & Line Counter](https://chat.openai.com/c/01217e42-e74a-4d6a-b327-883ebfb3fa58) * [Setting Up SPA Environment](https://chat.openai.com/c/2ff4e435-dd2d-46e3-a08d-58ccae92ee93) * [src](:/) * **[console](src/:/)** * **[data](src/:/)** - [design](src/:/) * **[entities](src/:/)** - [entities.js](src/:) - [expand.js](src/entities/:) - [features](src/:/) * [js](src/:/) / [\_js.js](src/js/:) - [extensions.js](src/js/:) - _[global.js](src/js/:)_? - _[define.js](src/js/:)?_ - [defineClass.js](src/js/:) - [referenceClass.js](src/js/:) - **[JsObject.js](src/js/:)** - **[Class.js](src/js/:)** - [json.js](src/:) - [locale.js](src/:) - [text.js](src/:) - [script.js](src/:) - [relscript.js](src/:) - [stylesheet.js](src/:) - [persistence](src/:/) - [persistence2](src/:/) - [test](src/:/) - [yell.js](src/:) - [unrequire.js](src/:) - [js.js](src/:) - [on.js](src/:) - [nameOf.js](src/js/:) - [mixIn.js](src/js/:) - [mixInRecursive.js](src/js/:) - [minify.js](src/js/:) - [beautify.js](src/js/:) - [serialize.js](src/js/:) - **[util](src/:/)** / [net](src/util/:/) / [HttpStatusCode.js](src/util/net/:) - [Url.js](src/util/net/:) - [Ajax.js](src/util/:) - [Command.js](src/util/:) - [Browser.js](src/util/:) - [CssSelectorParser.js](src/util/:) - [Clipboard.js](src/util/:) - [DocumentHook.js](src/util/:) - [Event.js](src/util/:) - [EventEmitter.js](src/util/:) - [Fullscreen.js](src/util/:) - [HotkeyManager.js](src/util/:) - [HtmlElement.js](src/util/:) - [Hash.js](src/util/:) - [Keyboard.js](src/util/:) - [Queue.js](src/util/:) - [Rest.js](src/util/:) - [Stylesheet.js](src/util/:) - [Text.js](src/util/:) - [Xml.js](src/util/:) # - []() - [ArrayFactory.js](src/js/:) - [Class.js](src/js/:) - [Deferred.js](src/js/:) - [Enum.js](src/js/:) - [Interface.js](src/js/:) - [JsObject.js](src/js/:) - [Method.js](src/js/:) - [Object.js](src/js/:) - [Packer.js](src/js/:) - [Property.js](src/js/:) - [Scaffold.js](src/js/:) - [Type.js](src/js/:) # `2025/01/24` locales in WebKit ![20250124-133233-p8mj9G](https://raw.githubusercontent.com/relluf/screenshots/master/uPic/202501/20250124-133233-p8mj9G.png) # `2023/05/23` countWords String.prototype.countLinesAndWords = function() { const lines = this.split('\n').length; const words = this.split(/\s+/).length; return { lines, words }; }; // Usage example: const text = 'Hello\nWorld!\nThis is a sample text.'; const { lines, words } = text.countLinesAndWords(); console.log('Number of lines:', lines); console.log('Number of words:', words); # `2023/05/11` Constructing... The name of the constructor for vcl/ui/Node.closeable is not correct. ![20230511-091729-jjXuKW](https://raw.githubusercontent.com/relluf/screenshots/master/20230511-091729-jjXuKW.png) # `2022/11/02` What about a shared _polyfill_-like file, loaded at startup in order to fill in the gaps of packages that are not updated/compiled just yet. if(!js.waitAll) { js.waitAll = function(/* ... */) { return Promise.all(js.copy_args(arguments).flat().map(p => { if(typeof p === "string" && p.endsWith("ms")) { // for syntax/code that says it all return new Promise(resolve => setTimeout(resolve, parseInt(p, 10))); } else if(typeof p === "number") { // ok, we'll do this too ;-) return new Promise(resolve => setTimeout(resolve, p)); } else if(!(p instanceof Promise)) { throw new Error("Can not wait for", p); } return p; })); } } # `2022/09/13` * Working on [README.md](). # `2022/07/25` * Enhancing `js.groupBy` to accept multiple keys for grouping. # `2022/04/29` I want to be able to activate these source files with [an overlay]([!prototypes/Hover]{}) of Markdown. Or... no, I want to overlay the source I guess. ๐Ÿ˜‡๐Ÿคจ๐Ÿค” * [defineClass](src/js/:.js) * [JsObject](src/js/:.js) * [Method](src/js/:.js) * [Class](src/js/:.js) * [extensions](src/js/:.js) * [mixIn](src/js/:.js) * [nameOf](src/js/:.js) * [Method](src/js/:.js) * [Type](src/js/:.js) Still, it would be nice to just: * Press (**โ‡งโŒ˜.**) and overlay _the current context_ (whatever that might be anyways, probably a JavaScript module, rapportage-script) with _whatever_, starting with a _context-local_-[.md]()-file, sprouting in to whatever, but _mas-que-nada_ a starting point in order to... * ...overlay notes, bookmarks, links, scripts, photos, ... # `2022/04/24` * `js.args(arr)` - concats and filters `arr` for non-undefined values >> var v = (a, b, c, d) => control.vars.apply(control, js.args(a, b, c, d)); # js.nameOf for Array in console # sort > var by = (prop) => (i1, i2) => i1 < i2 ? -1 : i1 > i2 ? 1 : 0; [].sort(by("date")); // dat zou moeten werken op 'echte' Date objecten ;-) # filter > var unique = (o, i, a) => a.indexOf(o) === i; > var XXX = { eq_: (prop, value) => (obj) => obj[prop] == value, eq: (prop, value) => (obj) => obj[prop] === value, neq: (prop, value) => (obj) => obj[prop] !== value, gt: (prop, value) => (obj) => obj[prop] > value, gte: (prop, value) => (obj) => obj[prop] >= value, lt: (prop, value) => (obj) => obj[prop] < value, lte: (prop, value) => (obj) => obj[prop] <= value, contains: (prop, value) => (obj) => obj[prop].includes(value), > var var_equals = (path, value) => (comp) => comp.vars(path) === value;