@naturalcycles/abba 2.14.0 → 2.15.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/dist/abba.d.ts CHANGED
@@ -11,11 +11,11 @@ export declare class Abba {
11
11
  * Returns all experiments.
12
12
  * Cached (see CACHE_TTL)
13
13
  */
14
- getAllExperimentsWithBuckets(opts?: GetAllExperimentsOpts): Promise<ExperimentWithBuckets[]>;
14
+ getAllExperimentsWithBuckets(opt?: GetAllExperimentsOpts): Promise<ExperimentWithBuckets[]>;
15
15
  /**
16
16
  * Returns all experiments.
17
17
  */
18
- getAllExperimentsWithBucketsNoCache(opts?: GetAllExperimentsOpts): Promise<ExperimentWithBuckets[]>;
18
+ getAllExperimentsWithBucketsNoCache(opt?: GetAllExperimentsOpts): Promise<ExperimentWithBuckets[]>;
19
19
  getUserExperiments(userId: string): Promise<UserExperiment[]>;
20
20
  /**
21
21
  * Changes all user assignments from one userId to another, as long as no
package/dist/abba.js CHANGED
@@ -25,14 +25,14 @@ export class Abba {
25
25
  * Returns all experiments.
26
26
  * Cached (see CACHE_TTL)
27
27
  */
28
- async getAllExperimentsWithBuckets(opts) {
29
- return await this.getAllExperimentsWithBucketsNoCache(opts);
28
+ async getAllExperimentsWithBuckets(opt) {
29
+ return await this.getAllExperimentsWithBucketsNoCache(opt);
30
30
  }
31
31
  /**
32
32
  * Returns all experiments.
33
33
  */
34
- async getAllExperimentsWithBucketsNoCache(opts) {
35
- const experiments = await this.experimentDao.getAllExperiments(opts);
34
+ async getAllExperimentsWithBucketsNoCache(opt) {
35
+ const experiments = await this.experimentDao.getAllExperiments(opt);
36
36
  const buckets = await this.bucketDao.getAll();
37
37
  return experiments.map(experiment => ({
38
38
  ...experiment,
@@ -41,6 +41,7 @@ export function experimentDao(db) {
41
41
  */
42
42
  function parseMySQLDate(date) {
43
43
  // @ts-expect-error MySQL may return Date instead of string
44
+ // oxlint-disable-next-line no-restricted-globals -- the MySQL driver may return a Date
44
45
  if (date instanceof Date)
45
46
  return localDate(date).toISODate();
46
47
  return date;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/abba",
3
3
  "type": "module",
4
- "version": "2.14.0",
4
+ "version": "2.15.0",
5
5
  "dependencies": {
6
6
  "@naturalcycles/db-lib": "^10",
7
7
  "@naturalcycles/js-lib": "^15",
package/src/abba.ts CHANGED
@@ -54,18 +54,18 @@ export class Abba {
54
54
  */
55
55
  @_Memo({ cacheFactory: () => new LRUMemoCache({ ttl: CACHE_TTL, max: 1 }) })
56
56
  async getAllExperimentsWithBuckets(
57
- opts?: GetAllExperimentsOpts,
57
+ opt?: GetAllExperimentsOpts,
58
58
  ): Promise<ExperimentWithBuckets[]> {
59
- return await this.getAllExperimentsWithBucketsNoCache(opts)
59
+ return await this.getAllExperimentsWithBucketsNoCache(opt)
60
60
  }
61
61
 
62
62
  /**
63
63
  * Returns all experiments.
64
64
  */
65
65
  async getAllExperimentsWithBucketsNoCache(
66
- opts?: GetAllExperimentsOpts,
66
+ opt?: GetAllExperimentsOpts,
67
67
  ): Promise<ExperimentWithBuckets[]> {
68
- const experiments = await this.experimentDao.getAllExperiments(opts)
68
+ const experiments = await this.experimentDao.getAllExperiments(opt)
69
69
  const buckets = await this.bucketDao.getAll()
70
70
 
71
71
  return experiments.map(experiment => ({
@@ -49,6 +49,7 @@ export function experimentDao(db: CommonDB): ExperimentDao {
49
49
  */
50
50
  function parseMySQLDate(date: string): IsoDate {
51
51
  // @ts-expect-error MySQL may return Date instead of string
52
+ // oxlint-disable-next-line no-restricted-globals -- the MySQL driver may return a Date
52
53
  if (date instanceof Date) return localDate(date).toISODate()
53
54
  return date as IsoDate
54
55
  }