diff options
Diffstat (limited to 'node_modules/@jet-app/app-store/tmp/src/api/util.js')
| -rw-r--r-- | node_modules/@jet-app/app-store/tmp/src/api/util.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/node_modules/@jet-app/app-store/tmp/src/api/util.js b/node_modules/@jet-app/app-store/tmp/src/api/util.js new file mode 100644 index 0000000..a6d199c --- /dev/null +++ b/node_modules/@jet-app/app-store/tmp/src/api/util.js @@ -0,0 +1,16 @@ +/** + * Ensures that Adam IDs are always represented with the same format + * + * "ID" segments in a URL typically include an `id` prefix that should + * not be present when using the value as an identifier for a resource + * in the Media APi. + * + * This function strips the prefix if present + */ +export function normalizeAdamID(raw) { + if (raw.startsWith("id")) { + return raw.substring(2); + } + return raw; +} +//# sourceMappingURL=util.js.map
\ No newline at end of file |
