{"_id":"@ds-algo/collections","_rev":"7-4069c3c4f0bce250e229ceeb386818e0","name":"@ds-algo/collections","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.0":{"name":"@ds-algo/collections","version":"0.0.0","keywords":[],"author":"","license":"MIT","_id":"@ds-algo/collections@0.0.0","maintainers":[{"name":"msboffl","email":"mareedusaibabu448@gmail.com"}],"dist":{"shasum":"3542f70019cb01c6848b3d72b60432000de462aa","tarball":"https://registry.npmjs.org/@ds-algo/collections/-/collections-0.0.0.tgz","fileCount":26,"integrity":"sha512-O59f3QGfMSzQNFPWYRvYplSuhKTFOn0JCuyTMUySwvfcHolZ227jrJaTYh/bax10oUXa9Isq7qhkII4aXkNIAw==","signatures":[{"sig":"MEUCIFJF+lOpSjfDTNgR+FdKI8vA6y4dDPQ3d4HzmKlq0XHCAiEAg8vx13B80qsO4ari7hJR6nKKMh6b/hucvdqra512Mk4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6221},"main":"./dist/cjs/index.js","type":"module","_from":"file:ds-algo-collections-0.0.0.tgz","types":"./dist/types/esm/index.d.ts","module":"./dist/esm/index.js","exports":{"import":{"types":"./dist/types/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/cjs/index.d.ts","default":"./dist/cjs/index.js"}},"scripts":{"dev":"tsx watch src/index.ts","test":"vitest","build":"pnpm run clean && (tsc -b || (pnpm run build:cjs && pnpm run build:esm))","clean":"rimraf dist .cache","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json"},"_npmUser":{"name":"msboffl","email":"mareedusaibabu448@gmail.com"},"_resolved":"/private/var/folders/dm/07q4srbn0jx4rt8tgz79fk7w0000gp/T/709335b340ddcfb341184e7e55a1e204/ds-algo-collections-0.0.0.tgz","_integrity":"sha512-O59f3QGfMSzQNFPWYRvYplSuhKTFOn0JCuyTMUySwvfcHolZ227jrJaTYh/bax10oUXa9Isq7qhkII4aXkNIAw==","_npmVersion":"10.9.2","description":"Collection Framework for JS/TS inspired by Java","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/collections_0.0.0_1756623752244_0.6614300791935404","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@ds-algo/collections","version":"0.0.1","keywords":[],"author":"","license":"MIT","_id":"@ds-algo/collections@0.0.1","maintainers":[{"name":"msboffl","email":"mareedusaibabu448@gmail.com"}],"dist":{"shasum":"7811a89629ded137c5880f4e4bf1cb6669206b25","tarball":"https://registry.npmjs.org/@ds-algo/collections/-/collections-0.0.1.tgz","fileCount":26,"integrity":"sha512-YZKeRyHRHMd3MgqCTbGYHVPgD+bLl7iSLgcnESw8OUpzIyJD9LbT4tIO0uuxaLANxnA0owK2Ylt+1uN6rITlCw==","signatures":[{"sig":"MEUCIQD96kMJwkXr+SFj+GcY6sgembuEDMauGMYI/MpB5I+ixAIgJbvHYi/jTCHbEtGt5XHEpKpGhH7kO0hN9Wu4O8crj4Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6221},"main":"./dist/cjs/index.js","type":"module","_from":"file:ds-algo-collections-0.0.1.tgz","types":"./dist/types/esm/index.d.ts","module":"./dist/esm/index.js","exports":{"import":{"types":"./dist/types/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/cjs/index.d.ts","default":"./dist/cjs/index.js"}},"scripts":{"dev":"tsx watch src/index.ts","test":"vitest","build":"pnpm run clean && (tsc -b || (pnpm run build:cjs && pnpm run build:esm))","clean":"rimraf dist .cache","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json"},"_npmUser":{"name":"msboffl","email":"mareedusaibabu448@gmail.com"},"_resolved":"/private/var/folders/dm/07q4srbn0jx4rt8tgz79fk7w0000gp/T/b0fe6ac67726c6965c1d90878e9abb55/ds-algo-collections-0.0.1.tgz","_integrity":"sha512-YZKeRyHRHMd3MgqCTbGYHVPgD+bLl7iSLgcnESw8OUpzIyJD9LbT4tIO0uuxaLANxnA0owK2Ylt+1uN6rITlCw==","_npmVersion":"10.9.2","description":"Collection Framework for JS/TS inspired by Java","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/collections_0.0.1_1756624374992_0.8126445194576462","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@ds-algo/collections","version":"0.0.2","keywords":[],"author":"","license":"MIT","_id":"@ds-algo/collections@0.0.2","maintainers":[{"name":"msboffl","email":"mareedusaibabu448@gmail.com"}],"dist":{"shasum":"af7f9904c74c502653326f8bb6b179b67473f9ba","tarball":"https://registry.npmjs.org/@ds-algo/collections/-/collections-0.0.2.tgz","fileCount":26,"integrity":"sha512-RSPhRfGKQTsBehIh40biX4jpAG3chikawUOWgRESyk3hmK/ydBLrKfMLXPsUJbdqr55a8Zee6XCC+ivt2UES0A==","signatures":[{"sig":"MEUCIFz7/QZAeSS+/AbuvJ8voqHybyVTHUJrIE+02jjn2PqqAiEApG+ArzHP+2yWDFuT/4sPlUOaRRwqoBKAS96MOLHXajc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6221},"main":"./dist/cjs/index.js","type":"module","_from":"file:ds-algo-collections-0.0.2.tgz","types":"./dist/types/esm/index.d.ts","module":"./dist/esm/index.js","exports":{"import":{"types":"./dist/types/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/cjs/index.d.ts","default":"./dist/cjs/index.js"}},"scripts":{"dev":"tsx watch src/index.ts","test":"vitest","build":"pnpm run clean && (tsc -b || (pnpm run build:cjs && pnpm run build:esm))","clean":"rimraf dist .cache","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json"},"_npmUser":{"name":"msboffl","email":"mareedusaibabu448@gmail.com"},"_resolved":"/private/var/folders/dm/07q4srbn0jx4rt8tgz79fk7w0000gp/T/4bc28d07f5a051c84ca0de8722fe9ac9/ds-algo-collections-0.0.2.tgz","_integrity":"sha512-RSPhRfGKQTsBehIh40biX4jpAG3chikawUOWgRESyk3hmK/ydBLrKfMLXPsUJbdqr55a8Zee6XCC+ivt2UES0A==","_npmVersion":"10.9.2","description":"Collection Framework for JS/TS inspired by Java","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/collections_0.0.2_1756624639921_0.44273314897049776","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@ds-algo/collections","version":"0.0.3","keywords":[],"author":"","license":"MIT","_id":"@ds-algo/collections@0.0.3","maintainers":[{"name":"msboffl","email":"mareedusaibabu448@gmail.com"}],"dist":{"shasum":"674c5b3bdd54fbc05ec8d18fb2fd43f02c74ced6","tarball":"https://registry.npmjs.org/@ds-algo/collections/-/collections-0.0.3.tgz","fileCount":34,"integrity":"sha512-cJqEz0QG/iNujyazjcWAzHyvNm1686IY5j0MotPQr9/gBkoTw2h87yn9ujOGW+Ap1ln7Pfq9uDdR6xFC7Nqong==","signatures":[{"sig":"MEYCIQCnbXm5LyS3S4koKksH7FjxZGJBqKYGFQUL2w4rVHd72gIhAKcsKEQlKdQjOiAHvWueQRQza01Kskz3LGNYdqR/0WHg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7395},"main":"./dist/cjs/index.js","type":"module","_from":"file:ds-algo-collections-0.0.3.tgz","types":"./dist/types/esm/index.d.ts","module":"./dist/esm/index.js","exports":{"import":{"types":"./dist/types/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/cjs/index.d.ts","default":"./dist/cjs/index.js"}},"scripts":{"dev":"tsx watch src/index.ts","test":"vitest","build":"pnpm run clean && (tsc -b || (pnpm run build:cjs && pnpm run build:esm))","clean":"rimraf dist .cache","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json"},"_npmUser":{"name":"msboffl","email":"mareedusaibabu448@gmail.com"},"_resolved":"/private/var/folders/dm/07q4srbn0jx4rt8tgz79fk7w0000gp/T/d3459a1c87457a38950afb1ce6a9309d/ds-algo-collections-0.0.3.tgz","_integrity":"sha512-cJqEz0QG/iNujyazjcWAzHyvNm1686IY5j0MotPQr9/gBkoTw2h87yn9ujOGW+Ap1ln7Pfq9uDdR6xFC7Nqong==","_npmVersion":"10.9.2","description":"Collection Framework for JS/TS inspired by Java","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/collections_0.0.3_1756625417478_0.4219879673821383","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@ds-algo/collections","version":"0.0.4","keywords":[],"author":"","license":"MIT","_id":"@ds-algo/collections@0.0.4","maintainers":[{"name":"msboffl","email":"mareedusaibabu448@gmail.com"}],"dist":{"shasum":"b03cfe6ea1d2fca1588aed9a838d48328c7d59a6","tarball":"https://registry.npmjs.org/@ds-algo/collections/-/collections-0.0.4.tgz","fileCount":35,"integrity":"sha512-bi9CTXQxY+9ga0LH3o7FfYglvAkWDiykQEmjkfCaAIi5b5Kh73MCxhJKY/FHwkIzUdgexOgcEZE/CNkJDwFVyQ==","signatures":[{"sig":"MEMCIBlPcIMSoIZrLzaCeurK5+05TGypLzDrk1EFUbfJa9FsAh8DrHHIh55Hb/jPHcYRtwkB9y0A0hOxSVLyuUQZusm7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12096},"main":"./dist/cjs/index.js","type":"module","_from":"file:ds-algo-collections-0.0.4.tgz","types":"./dist/types/esm/index.d.ts","module":"./dist/esm/index.js","exports":{"import":{"types":"./dist/types/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/cjs/index.d.ts","default":"./dist/cjs/index.js"}},"scripts":{"dev":"tsx watch src/index.ts","test":"vitest","build":"pnpm run clean && (tsc -b || (pnpm run build:cjs && pnpm run build:esm))","clean":"rimraf dist .cache","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json"},"_npmUser":{"name":"msboffl","email":"mareedusaibabu448@gmail.com"},"_resolved":"/private/var/folders/dm/07q4srbn0jx4rt8tgz79fk7w0000gp/T/61a9ad2d596e7a799a1634d247070586/ds-algo-collections-0.0.4.tgz","_integrity":"sha512-bi9CTXQxY+9ga0LH3o7FfYglvAkWDiykQEmjkfCaAIi5b5Kh73MCxhJKY/FHwkIzUdgexOgcEZE/CNkJDwFVyQ==","_npmVersion":"10.9.2","description":"Collection Framework for JS/TS inspired by Java","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/collections_0.0.4_1756632937034_0.4157004805396356","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@ds-algo/collections","version":"0.0.5","keywords":[],"author":"","license":"MIT","_id":"@ds-algo/collections@0.0.5","maintainers":[{"name":"msboffl","email":"mareedusaibabu448@gmail.com"}],"dist":{"shasum":"b195ff7ceff4f1924a0e593ab89e8756751e68aa","tarball":"https://registry.npmjs.org/@ds-algo/collections/-/collections-0.0.5.tgz","fileCount":90,"integrity":"sha512-Tf7RYaCuXh0q4qKyvkLE33ZJdpMn4Bk8+pNrrD+8hsy37xpMDGTS786zqcNWHyxgjeONAEUfKVmlfLU9cH9L/g==","signatures":[{"sig":"MEQCIEfBlMsi3MDfF3IiyP0lDhzl/7/+rFIzNq2aVcxBpYWfAiAvILTiR/NcftjqvJNhjoGs5ubTBRGWLB66rCoBp2jIoA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32970},"main":"./dist/cjs/index.js","type":"module","types":"./dist/types/esm/index.d.ts","module":"./dist/esm/index.js","exports":{"import":{"types":"./dist/types/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/cjs/index.d.ts","default":"./dist/cjs/index.js"}},"gitHead":"23af21a3c9c31c0ad97ce428e751539f765db812","scripts":{"dev":"tsx watch src/index.ts","test":"vitest","build":"pnpm run clean && (tsc -b || (pnpm run build:cjs && pnpm run build:esm))","clean":"rimraf dist .cache","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"msboffl","email":"mareedusaibabu448@gmail.com"},"_npmVersion":"10.9.3","description":"Collection Framework for JS/TS inspired by Java","directories":{},"sideEffects":false,"_nodeVersion":"22.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.13.1","_npmOperationalInternal":{"tmp":"tmp/collections_0.0.5_1757946135022_0.5470585863342761","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@ds-algo/collections","version":"0.0.6","description":"Collection Framework for JS/TS inspired by Java","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/types/esm/index.d.ts","type":"module","sideEffects":false,"exports":{"import":{"types":"./dist/types/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/cjs/index.d.ts","default":"./dist/cjs/index.js"}},"scripts":{"dev":"tsx watch src/index.ts","test":"vitest","clean":"rimraf dist .cache","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","build":"pnpm run clean && (tsc -b || (pnpm run build:cjs && pnpm run build:esm))","prepublishOnly":"pnpm run build"},"publishConfig":{"access":"public"},"keywords":[],"author":"","license":"MIT","packageManager":"pnpm@10.13.1","_id":"@ds-algo/collections@0.0.6","gitHead":"23af21a3c9c31c0ad97ce428e751539f765db812","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-08qi/hjRzKiuFqQ6zVfsDIyZb8yxMm6fK/p18lbFrFRLgVJChZr4pKhDA3HayN4dA133fkvFPDB/PnCcmDLKyA==","shasum":"9b92a98b9e0bec1b9daf2fbb3554ada52fe18a38","tarball":"https://registry.npmjs.org/@ds-algo/collections/-/collections-0.0.6.tgz","fileCount":90,"unpackedSize":33864,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAlw3+ftuxSjcmS/twkUAxOrRpnv8AJ5T/YCLgAZ8vIrAiEAvh3G25/K28v49EqT6AKCZn8bX8ju6eGtjA6br7xlJB4="}]},"_npmUser":{"name":"msboffl","email":"mareedusaibabu448@gmail.com"},"directories":{},"maintainers":[{"name":"msboffl","email":"mareedusaibabu448@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/collections_0.0.6_1757947153683_0.3707938536362545"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-31T07:02:32.149Z","modified":"2025-09-15T14:39:14.135Z","0.0.0":"2025-08-31T07:02:32.454Z","0.0.1":"2025-08-31T07:12:55.178Z","0.0.2":"2025-08-31T07:17:20.103Z","0.0.3":"2025-08-31T07:30:17.661Z","0.0.4":"2025-08-31T09:35:37.222Z","0.0.5":"2025-09-15T14:22:15.228Z","0.0.6":"2025-09-15T14:39:13.891Z"},"license":"MIT","keywords":[],"description":"Collection Framework for JS/TS inspired by Java","maintainers":[{"name":"msboffl","email":"mareedusaibabu448@gmail.com"}],"readme":"# @ds-algo/collections\n\nA TypeScript collection framework inspired by Java's Collections Framework, providing a robust foundation for data structure implementations.\n\n## 📦 Overview\n\nThis package provides the core interfaces and abstractions for building a comprehensive collection framework in TypeScript. It serves as the foundation for implementing various data structures like lists, sets, maps, and more.\n\n## 🏗️ Architecture\n\nThe package follows a hierarchical design pattern similar to Java's Collections Framework:\n\n```\nCollection<T> extends Iterable<T>\n    ↓\nIterable<T> provides Iterator<T>\n    ↓\nIterator<T> defines iteration protocol\n```\n\n### Core Interfaces\n\n- **`Collection<T>`** - The root interface for all collections\n- **`Iterable<T>`** - Defines the iteration capability\n- **`Iterator<T>`** - Provides iteration methods (hasNext, next, remove)\n\n## 📁 Package Structure\n\n```\nsrc/\n├── interfaces/          # Core interfaces\n│   ├── Collection.ts   # Collection interface\n│   ├── Iterable.ts     # Iterable interface\n│   └── Iterator.ts     # Iterator interface\n├── abstracts/          # Abstract base classes (planned)\n├── classes/           # Concrete implementations (planned)\n├── algorithms/        # Collection algorithms (planned)\n└── index.ts          # Main exports\n```\n\n## 🚀 Installation\n\n```bash\n# Install the package\npnpm add @ds-algo/collections\n\n# Or install from the monorepo\npnpm install\n```\n\n## 📖 Usage\n\n### Basic Interface Usage\n\n```typescript\nimport { Collection, Iterable, Iterator } from '@ds-algo/collections';\n\n// Define a custom collection\nclass MyCollection<T> implements Collection<T> {\n  private items: T[] = [];\n\n  iterator(): Iterator<T> {\n    return new MyIterator(this.items);\n  }\n}\n\n// Define a custom iterator\nclass MyIterator<T> implements Iterator<T> {\n  private index = 0;\n  private items: T[];\n\n  constructor(items: T[]) {\n    this.items = items;\n  }\n\n  hasNext(): boolean {\n    return this.index < this.items.length;\n  }\n\n  next(): T {\n    if (!this.hasNext()) {\n      throw new Error('No more elements');\n    }\n    return this.items[this.index++];\n  }\n\n  remove(): void {\n    // Implementation for removing the last returned element\n    this.items.splice(this.index - 1, 1);\n    this.index--;\n  }\n}\n```\n\n### TypeScript Support\n\nThe package includes full TypeScript support with comprehensive type definitions:\n\n```typescript\n// Generic collections with type safety\nconst numberCollection: Collection<number> = new MyCollection<number>();\nconst stringCollection: Collection<string> = new MyCollection<string>();\n\n// Iterator with proper typing\nconst iterator: Iterator<number> = numberCollection.iterator();\n```\n\n## 🛠️ Development\n\n### Building\n\n```bash\n# Build CommonJS and ESM versions\npnpm run build\n\n# Build CommonJS only\npnpm run build:cjs\n\n# Build ESM only\npnpm run build:esm\n```\n\n### Testing\n\n```bash\n# Run tests\npnpm run test\n\n# Run tests in watch mode\npnpm run test --watch\n```\n\n### Development Mode\n\n```bash\n# Start development mode with hot reload\npnpm run dev\n```\n\n## 📋 API Reference\n\n### Collection<T>\n\nThe root interface for all collections.\n\n```typescript\ninterface Collection<T> extends Iterable<T> {}\n```\n\n### Iterable<T>\n\nDefines the iteration capability for collections.\n\n```typescript\ninterface Iterable<T> {\n  iterator(): Iterator<T>;\n}\n```\n\n### Iterator<T>\n\nProvides methods for iterating over collection elements.\n\n```typescript\ninterface Iterator<T> {\n  hasNext(): boolean; // Returns true if there are more elements\n  next(): T; // Returns the next element\n  remove(): void; // Removes the last returned element\n}\n```\n\n## 🔮 Roadmap\n\n- [ ] Abstract base classes for common collection operations\n- [ ] Concrete implementations (ArrayList, LinkedList, HashSet, etc.)\n- [ ] Collection algorithms (sorting, searching, filtering)\n- [ ] Performance optimizations\n- [ ] Additional utility methods\n- [ ] Comprehensive test coverage\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](../../LICENSE) file for details.\n\n## 🔗 Related Packages\n\n- **`@ds-algo/algorithms`** - Algorithm implementations (coming soon)\n- **`@ds-algo/core`** - Core utilities and helpers (planned)\n\n---\n\n**Note**: This package is part of the larger Data Structures and Algorithms library. For more information, see the main [README](../../README.md).\n","readmeFilename":"README.md"}