70af4b1ef833d79458eb792aac202b65b8a6ae913ecc993e5dc67ac419f70e837b142432b5f9f0a3645dfd0169e47c4f9f800aa9bd9b39907943109b861bb1 406 B

123456789101112131415161718192021222324
  1. import { NumberAllocator } from '../..'
  2. const a: NumberAllocator = new NumberAllocator(1, 5)
  3. const num1: Number | null = a.firstVacant()
  4. console.log(num1)
  5. const num2: Number | null = a.alloc()
  6. console.log(num2)
  7. const ret: Boolean = a.use(3)
  8. console.log(ret)
  9. a.free(2)
  10. const ic1: Number = a.intervalCount()
  11. console.log(ic1)
  12. a.dump()
  13. a.clear()
  14. const ic2: Number = a.intervalCount()
  15. console.log(ic2)