-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdemo.js
More file actions
35 lines (32 loc) · 960 Bytes
/
Copy pathdemo.js
File metadata and controls
35 lines (32 loc) · 960 Bytes
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
"use strict";
// Demo file for testing DropComments functionality
// Select any function below and run "DropComments: Add Comments to Selection"
Object.defineProperty(exports, "__esModule", { value: true });
function calculateTotal(items, taxRate) {
const subtotal = items.reduce((sum, item) => sum + item.price, 0);
const tax = subtotal * taxRate;
return subtotal + tax;
}
class UserManager {
users = [];
addUser(user) {
if (this.findUserById(user.id)) {
throw new Error('User already exists');
}
this.users.push(user);
}
findUserById(id) {
return this.users.find(user => user.id === id);
}
}
const processData = async (data) => {
const results = [];
for (const item of data) {
const processed = await transformItem(item);
if (processed.isValid) {
results.push(processed);
}
}
return results;
};
//# sourceMappingURL=demo.js.map