Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export class Collection {
- data;
- constructor(){
- this.data = {};
- }
- get data(){
- return this.data
- }
- get single(){
- let singles = {};
- for(const item of Object.keys(this.data)){
- if(typeof item !== "object"){
- singles[item] = this.data[item];
- }
- }
- return singles;
- }
- add(key, value){
- this.data[key] = value;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement