UNPKG

@r/api-client

Version:

node and browser reddit api library

28 lines (21 loc) 509 B
import Base from './base'; import { USER_TYPE } from '../models2/thingTypes'; export default class Account extends Base { _type = 'Account'; validators () { const thingId = this.thingIdValidator.bind(this); return { thingId, }; } uuid(props) { if (Base.validators.thingId(props.id)) { return props.id; } return `${USER_TYPE}_${props.id}`; } thingIdValidator () { const thingId = this.get('thingId'); return Base.validators.thingId(thingId); } }