Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fileToKey = (data, storyId) => {
const { name, type } = data;
// console.log(name, type);
let namespace = storyId;
if (namespace.indexOf("_")) namespace = namespace.split("_").pop();
if (namespace.length < 36) namespace = shortUuid().toUUID(namespace);
const uuid = uuidv5(`${type},${name}`, namespace);
return `${shortUuid().fromUUID(uuid)}-${name}`;
};
const fileToKey = (data, storyId) => {
const { name, type } = data;
// console.log(name, type);
let namespace = storyId;
if (namespace.indexOf("_")) namespace = namespace.split("_").pop();
if (namespace.length < 36) namespace = shortUuid().toUUID(namespace);
const uuid = uuidv5(`${type},${name}`, namespace);
return `${shortUuid().fromUUID(uuid)}-${name}`;
};
const fileToKey = (data, storyId) => {
const { name, type } = data;
// console.log(name, type);
let namespace = storyId;
if (namespace.indexOf("_")) namespace = namespace.split("_").pop();
if (namespace.length < 36) namespace = shortUuid().toUUID(namespace);
const uuid = uuidv5(`${type},${name}`, namespace);
return `${shortUuid().fromUUID(uuid)}-${name}`;
};
const fileToKey = (data, storyId) => {
const { name, type } = data;
// console.log(name, type);
let namespace = storyId;
if (namespace.indexOf("_")) namespace = namespace.split("_").pop();
if (namespace.length < 36) namespace = shortUuid().toUUID(namespace);
const uuid = uuidv5(`${type},${name}`, namespace);
return `${shortUuid().fromUUID(uuid)}-${name}`;
};
const computeId = (userId, storyId) => {
let namespace = userId;
if (namespace.indexOf(":") > 0) namespace = namespace.split(":").pop();
let id = storyId;
if (id.indexOf("_")) id = id.split("_").pop();
if (id.length < 36) id = shortUuid().toUUID(id);
const uuid = uuidv5(id, namespace);
return shortUuid().fromUUID(uuid);
};
const computeId = (userId, storyId) => {
let namespace = userId;
if (namespace.indexOf(":") > 0) namespace = namespace.split(":").pop();
let id = storyId;
if (id.indexOf("_")) id = id.split("_").pop();
if (id.length < 36) id = shortUuid().toUUID(id);
const uuid = uuidv5(id, namespace);
return shortUuid().fromUUID(uuid);
};
const computeId = (userId, storyId) => {
let namespace = userId;
if (namespace.indexOf(":") > 0) namespace = namespace.split(":").pop();
let id = storyId;
if (id.indexOf("_")) id = id.split("_").pop();
if (id.length < 36) id = shortUuid().toUUID(id);
const uuid = uuidv5(id, namespace);
return shortUuid().fromUUID(uuid);
};