Rails Guid for JavaScript
Zero dependancy utility for creating and extracting rails GUIDs from a string.
Install
npm install --save @qeepsake/rails-guid
Usage
You can use extractRailsId
to extract a Rails GUID from a string:
import { extractRailsId } from '@qeepsake/rails-guid';
const guid = "gid://qeepsake-rails/Model/55587";
extractRailsId(guid)
Creating Rails GUID
You can use the createRailsId
to create Rails GUID:
import { createRailsId } from '@qeepsake/rails-guid';
const id = 55587 || "55587";
createRailsId(id, "Model")
License
MIT © lukebrandonfarrell
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!