Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
*
|
||||
* @param definition
|
||||
*/
|
||||
export function getDefinitionKey(definition) {
|
||||
var _a;
|
||||
return (_a = definition.definitionKey) !== null && _a !== void 0 ? _a : '';
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export const DEFINITION_KEY_SEPARATOR = ':';
|
||||
export var DefinitionTypeEnum;
|
||||
(function (DefinitionTypeEnum) {
|
||||
DefinitionTypeEnum["VEHICLE"] = "vehicle";
|
||||
DefinitionTypeEnum["INFUSION"] = "infusion";
|
||||
DefinitionTypeEnum["CLASS_FEATURE"] = "class-feature";
|
||||
DefinitionTypeEnum["RACIAL_TRAIT"] = "racial-trait";
|
||||
})(DefinitionTypeEnum || (DefinitionTypeEnum = {}));
|
||||
@@ -0,0 +1,9 @@
|
||||
import { DEFINITION_KEY_SEPARATOR } from './constants';
|
||||
/**
|
||||
*
|
||||
* @param type
|
||||
* @param id
|
||||
*/
|
||||
export function generateDefinitionKey(type, id) {
|
||||
return `${type}${DEFINITION_KEY_SEPARATOR}${id}`;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { HelperUtils } from '../Helper';
|
||||
import { DEFINITION_KEY_SEPARATOR } from './constants';
|
||||
import { getDefinitionKeyId, getDefinitionKeyType } from './utils';
|
||||
/**
|
||||
*
|
||||
* @param type
|
||||
* @param id
|
||||
*/
|
||||
export function hack__generateDefinitionKey(type, id) {
|
||||
return `${type}${DEFINITION_KEY_SEPARATOR}${id}`;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param definitionKey
|
||||
*/
|
||||
export function hack__getDefinitionKeyId(definitionKey) {
|
||||
return HelperUtils.parseInputInt(getDefinitionKeyId(definitionKey));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param definitionKey
|
||||
*/
|
||||
export function hack__getDefinitionKeyType(definitionKey) {
|
||||
return HelperUtils.parseInputInt(getDefinitionKeyType(definitionKey));
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import * as DefinitionAccessors from './accessors';
|
||||
import * as DefinitionConstants from './constants';
|
||||
import * as DefinitionGenerators from './generators';
|
||||
import * as DefinitionHacks from './hacks';
|
||||
import * as DefinitionTypings from './typings';
|
||||
import * as DefinitionUtils from './utils';
|
||||
export * from './constants';
|
||||
export * from './typings';
|
||||
export { DefinitionAccessors, DefinitionGenerators, DefinitionHacks, DefinitionUtils };
|
||||
export default Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, DefinitionAccessors), DefinitionConstants), DefinitionGenerators), DefinitionHacks), DefinitionTypings), DefinitionUtils);
|
||||
@@ -0,0 +1,15 @@
|
||||
import { DEFINITION_KEY_SEPARATOR } from './constants';
|
||||
/**
|
||||
*
|
||||
* @param definitionKey
|
||||
*/
|
||||
export function getDefinitionKeyType(definitionKey) {
|
||||
return definitionKey.split(DEFINITION_KEY_SEPARATOR)[0];
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param definitionKey
|
||||
*/
|
||||
export function getDefinitionKeyId(definitionKey) {
|
||||
return definitionKey.split(DEFINITION_KEY_SEPARATOR)[1];
|
||||
}
|
||||
Reference in New Issue
Block a user