devlien
Version:
Devlien is a lightweight, zero-dependency Node.js framework with clean MVC structure, built-in ORM, and intuitive routing for rapid backend development.
22 lines (18 loc) • 406 B
JavaScript
class String {
#records;
constructor(records) {
this.#records = records;
}
slug() {
return this.#records
.toLowerCase()
.trim()
.replace(/[^a-z0-9\s-]/g, '')
.replace(/\s+/g, '-')
.replace(/-+/g, '-');
}
}
export default function (records) {
let _this = new String(records);
return Object.assign(_this, records);
}