A partially-manual, partially-code-generated port of cocur/slugify
In the process of rewriting the site builder for the
Satisfactory Clips Archive
it became desirable to have a slugifier that was compatible with the one
used by the current site builder- cocur/slugify.
Using a combination of TypeScript's factory methods and
php-parser some essential types
are transposed to TypeScript at build time to ensure a reasonable degree
of compatibility with cocur/slugify.
AHAHAHAHAHAHAHAHAHAHAHAHAHA
No.
While one could hypothetically perform code generation to port the PHP source to TypeScript, it's more straightforward to hand-write the core implementation.
strtr() is pulled in as a
dependency from locutus, as while
a dependency-free implementation was attempted, it had compatibility
issues with cocur/slugify.
- Only the rules/rulesets methods/options are implemented.
- The default rulesets are generated at build time using TypeScript's factory methods.
- Tests for testing
\\Cocur\\Slugify::slugify()will be partially generated at build time. Slugify::slugify()is async, to provide for the possibilty of async-sourced rulesets.