Skip to content

satisfactory-dev/Slugify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coverage Status Workflow Status

Slugify

A partially-manual, partially-code-generated port of cocur/slugify

Why?

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.

Partially-code-generated?

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.

Do you mean vibe-coded?

AHAHAHAHAHAHAHAHAHAHAHAHAHA

No.

Partially-manual?

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.

Compatibility 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.

About

TypeScript port of cocur/slugify

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published