Sha256: b8e0b5e367a81621235f3f4eb4552e62bc49cfe487173024c1b4165904b5aec5

Contents?: true

Size: 435 Bytes

Versions: 20

Compression:

Stored size: 435 Bytes

Contents

import { last } from './commonHelper';

const idSeparator = '-';
const versionSeparator = ':';
const defaultVersion = '01';

export const decodeModelId = model => decodeId(model.id);

export const decodeId = globalId => {
  const split = atob(globalId).split(idSeparator);
  return parseInt(last(split), 10);
};

export const encodeId = (typename, id) =>
  btoa([defaultVersion, versionSeparator, typename, idSeparator, id].join(''));

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
foreman_openscap-10.1.0 webpack/helpers/globalIdHelper.js
foreman_openscap-10.0.3 webpack/helpers/globalIdHelper.js
foreman_openscap-10.0.2 webpack/helpers/globalIdHelper.js
foreman_openscap-10.0.1 webpack/helpers/globalIdHelper.js
foreman_openscap-10.0.0 webpack/helpers/globalIdHelper.js
foreman_openscap-9.0.4 webpack/helpers/globalIdHelper.js
foreman_openscap-9.0.3 webpack/helpers/globalIdHelper.js
foreman_openscap-9.0.2 webpack/helpers/globalIdHelper.js
foreman_openscap-9.0.1 webpack/helpers/globalIdHelper.js
foreman_openscap-9.0.0 webpack/helpers/globalIdHelper.js
foreman_openscap-8.0.0 webpack/helpers/globalIdHelper.js
foreman_openscap-7.1.1 webpack/helpers/globalIdHelper.js
foreman_openscap-7.1.0 webpack/helpers/globalIdHelper.js
foreman_openscap-7.0.0 webpack/helpers/globalIdHelper.js
foreman_openscap-6.0.0 webpack/helpers/globalIdHelper.js
foreman_openscap-5.2.3 webpack/helpers/globalIdHelper.js
foreman_openscap-5.2.2 webpack/helpers/globalIdHelper.js
foreman_openscap-5.1.1 webpack/helpers/globalIdHelper.js
foreman_openscap-5.2.1 webpack/helpers/globalIdHelper.js
foreman_openscap-5.2.0 webpack/helpers/globalIdHelper.js