@cubedelement.com/realty-investor-timeline 5.4.0 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [5.5.0](https://github.com/kvernon/realty-investor-timeline/compare/v5.4.0...v5.5.0) (2025-12-21)
2
+
3
+
4
+ ### Features
5
+
6
+ * expose cache time ([#72](https://github.com/kvernon/realty-investor-timeline/issues/72)) ([5e1c35f](https://github.com/kvernon/realty-investor-timeline/commit/5e1c35f0d838c6bf7f11e5cd0b380bf4ff6a7203))
7
+
1
8
  # [5.4.0](https://github.com/kvernon/realty-investor-timeline/compare/v5.3.0...v5.4.0) (2025-12-19)
2
9
 
3
10
 
@@ -10,6 +10,10 @@ export interface IGenOptions extends IPropertyEntityOptions {
10
10
  * Used to provide an amount of Random properties
11
11
  */
12
12
  maxRentalOpportunities: number;
13
+ /**
14
+ * Used to say how long a property should be cached
15
+ */
16
+ maxMonthsToCache?: number;
13
17
  }
14
18
  export interface ISimulateOptions {
15
19
  /**
@@ -76,14 +76,16 @@ function simulate(options = {
76
76
  lowestEquityCapturePercent: 7,
77
77
  highestEquityCapturePercent: 15,
78
78
  maxRentalOpportunities: 4,
79
+ maxMonthsToCache: 2,
79
80
  },
80
81
  }) {
81
82
  const formattedUtcDate = (0, data_clone_date_1.cloneDateUtc)(options.startDate ?? new Date());
82
83
  if (!options.generatorOptionsPassiveApartment && !options.generatorOptionsSingleFamily) {
83
84
  throw new Error('Invalid Argument: must declare at least 1, either generatorOptionsSingleFamily or generatorOptionsPassiveApartment');
84
85
  }
85
- const propertyGeneratorSingleFamily = Object.assign(new rental_generator_1.RentalGenerator(new value_cache_1.ValueCache((0, data_clone_date_1.cloneDateUtc)(formattedUtcDate), [], 2), factory_single_family_1.generateSingleFamily), options.generatorOptionsSingleFamily);
86
- const propertyGeneratorPassiveApartment = Object.assign(new rental_generator_1.RentalGenerator(new value_cache_1.ValueCache((0, data_clone_date_1.cloneDateUtc)(formattedUtcDate), [], 2), factory_passive_apartment_1.generateRentalPassiveApartment), options.generatorOptionsPassiveApartment);
86
+ const defaultMaxMonthsToCache = 2;
87
+ const propertyGeneratorSingleFamily = Object.assign(new rental_generator_1.RentalGenerator(new value_cache_1.ValueCache((0, data_clone_date_1.cloneDateUtc)(formattedUtcDate), [], options.generatorOptionsSingleFamily?.maxMonthsToCache || defaultMaxMonthsToCache), factory_single_family_1.generateSingleFamily), options.generatorOptionsSingleFamily);
88
+ const propertyGeneratorPassiveApartment = Object.assign(new rental_generator_1.RentalGenerator(new value_cache_1.ValueCache((0, data_clone_date_1.cloneDateUtc)(formattedUtcDate), [], options.generatorOptionsPassiveApartment?.maxMonthsToCache || defaultMaxMonthsToCache), factory_passive_apartment_1.generateRentalPassiveApartment), options.generatorOptionsPassiveApartment);
87
89
  const totalSavings = new ledger_1.LedgerItem();
88
90
  totalSavings.amount = options.amountInSavings;
89
91
  totalSavings.note = 'money saved up before you start';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubedelement.com/realty-investor-timeline",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "A way to determine if and when your expenses would be covered",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",