@qeepsake/rails-guid
Advanced tools
Comparing version 1.3.0 to 1.4.0
export { extractRailsId } from './extract-rails-id'; | ||
export { createRailsId } from './create-rails-id'; | ||
export { isExtractedRailsId } from './is-extracted-rails-id'; | ||
export { isRailsId } from './is-rails-id'; |
@@ -38,5 +38,11 @@ function isExtractedRailsId(id) { | ||
function isRailsId(str) { | ||
var pattern = /^gid:\/\/[^\/]+\/[a-zA-Z]+\/\d+$/; | ||
return pattern.test(str); | ||
} | ||
exports.createRailsId = createRailsId; | ||
exports.extractRailsId = extractRailsId; | ||
exports.isExtractedRailsId = isExtractedRailsId; | ||
exports.isRailsId = isRailsId; | ||
//# sourceMappingURL=index.js.map |
@@ -38,3 +38,8 @@ function isExtractedRailsId(id) { | ||
export { createRailsId, extractRailsId, isExtractedRailsId }; | ||
function isRailsId(str) { | ||
var pattern = /^gid:\/\/[^\/]+\/[a-zA-Z]+\/\d+$/; | ||
return pattern.test(str); | ||
} | ||
export { createRailsId, extractRailsId, isExtractedRailsId, isRailsId }; | ||
//# sourceMappingURL=index.modern.js.map |
{ | ||
"name": "@qeepsake/rails-guid", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Tiny (zero dependancy) utility to create and extract rails guid strings in JavaScript 🛤", | ||
@@ -5,0 +5,0 @@ "author": "lukebrandonfarrell", |
@@ -49,2 +49,16 @@ # Rails Guid for JavaScript | ||
### Testing for Rails Global ID | ||
You can use `isRailsId`` to test if a string is a valid Rails Global ID: | ||
```js | ||
import { isRailsId } from '@qeepsake/rails-guid'; | ||
isRailsId("gid://qeepsake-rails/User/1") // => true | ||
isRailsId("gid://someotherapp/User/1") // => true | ||
isRailsId("User/1") // => false | ||
``` | ||
This function tests if the string conforms to the general Rails gid structure: `gid://<ANY_APP_NAME>/<MODEL_NAME>/<ID>`. | ||
## License | ||
@@ -51,0 +65,0 @@ |
export { extractRailsId } from './extract-rails-id' | ||
export { createRailsId } from './create-rails-id' | ||
export { isExtractedRailsId } from './is-extracted-rails-id' | ||
export { isRailsId } from './is-rails-id' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
84
0
34386
485