MCPcopy Create free account
hub / github.com/clintonwoo/hackernews-react-graphql / constructor

Method constructor

src/data/models/user-model.ts:30–50  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

28 public readonly passwordSalt: string | undefined;
29
30 constructor(props) {
31 if (!props.id) {
32 throw new Error(`Error instantiating User, id invalid: ${props.id}`);
33 }
34
35 validateUsername(props);
36
37 this.id = props.id;
38 this.about = props.about || '';
39 this.creationTime = props.creationTime || +new Date();
40 this.dateOfBirth = props.dateOfBirth || null;
41 this.email = props.email || null;
42 this.firstName = props.firstName || null;
43 this.hides = props.hides || [];
44 this.karma = props.karma || 1;
45 this.lastName = props.lastName || null;
46 this.likes = props.likes || [];
47 this.posts = props.posts || [];
48 this.hashedPassword = props.hashedPassword || undefined;
49 this.passwordSalt = props.passwordSalt || undefined;
50 }
51}

Callers

nothing calls this directly

Calls 1

validateUsernameFunction · 0.90

Tested by

no test coverage detected