Repository navigation
Expand file tree
/
Copy pathutils.js
More file actions
78 lines (72 loc) · 1.56 KB
/
Copy pathutils.js
File metadata and controls
78 lines (72 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* Utility functions module for testing language server features
* @module utils
*/
/**
* Calculates the sum of two numbers
* @param {number} a - First number to add
* @param {number} b - Second number to add
* @returns {number} The sum of a and b
*/
export function add(a, b) {
return a + b;
}
/**
* Calculates the difference between two numbers
* @param {number} a - Number to subtract from
* @param {number} b - Number to subtract
* @returns {number} The difference between a and b
*/
export function subtract(a, b) {
return a - b;
}
/**
* User class for testing complex type definitions
* @class
*/
export class User {
/**
* Create a user
* @param {string} name - The user's name
* @param {number} age - The user's age
*/
constructor(name, age) {
this.name = name;
this.age = age;
}
/**
* Get user's full profile information
* @returns {Object} User profile object
*/
getProfile() {
return {
name: this.name,
age: this.age,
createdAt: new Date()
};
}
/**
* Check if user is an adult
* @returns {boolean} True if user is 18 or older
*/
isAdult() {
return this.age >= 18;
}
}
/**
* Object with nested properties for testing dot notation completion
*/
export const config = {
server: {
port: 3000,
host: 'localhost',
settings: {
timeout: 5000,
maxConnections: 100
}
},
database: {
url: 'mongodb://localhost:27017',
name: 'testdb'
}
};