ts-fsrs 1.2.0 → 2.0.2

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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # About The
2
2
 
3
3
  ts-fsrs is a TypeScript package used to implement the Free Spaced Repetition Scheduler (FSRS) algorithm. It helps
4
- developers apply FSRS to their flashcard applications, thereby improving the user learning experience.,
4
+ developers apply FSRS to their flashcard applications, thereby improving the user learning experience.
5
5
 
6
6
  # Usage
7
7
 
@@ -9,34 +9,38 @@ developers apply FSRS to their flashcard applications, thereby improving the use
9
9
  npm install ts-fsrs
10
10
  ```
11
11
 
12
- # [Have trouble importing Day.js?](https://day.js.org/docs/en/installation/typescript#have-trouble-importing-dayjs)
13
-
14
- If your `tsconfig.json` contains the following config, you must do the default import
15
- workflow `import dayjs from 'dayjs'`:
16
-
17
- ```
18
- //tsconfig.json
19
- {
20
- "compilerOptions": {
21
- "esModuleInterop": true,
22
- "allowSyntheticDefaultImports": true,
23
- }
24
- }
25
- ```
26
-
27
12
  # Example
28
13
 
29
14
  ```typescript
30
- import { generatorParameters, fsrs, createEmptyCard } from 'ts-fsrs';
31
- import dayjs from 'dayjs'; // or import * as dayjs from "dayjs";
32
-
15
+ import {createEmptyCard, formatDate, fsrs, generatorParameters, Rating} from 'ts-fsrs';
33
16
 
34
17
  const params = generatorParameters({ enable_fuzz: true });
35
18
  const f = fsrs(params);
36
- const card = createEmptyCard();
37
- const now = dayjs();
19
+ const card = createEmptyCard(new Date('2022-2-1 10:00:00'));// createEmptyCard();
20
+ const now = new Date('2022-2-2 10:00:00');// new Date();
38
21
  const scheduling_cards = f.repeat(card, now);
39
- console.log(scheduling_cards);
22
+
23
+ // console.log(scheduling_cards);
24
+ Object.keys(Rating).filter(key => typeof Rating[key as any] === 'number').forEach(key => {
25
+ // @ts-ignore
26
+ const { log, card } = scheduling_cards[Rating[key]];
27
+ console.group(`${key}`);
28
+ console.table({
29
+ [`card_${key}`]: {
30
+ ...card,
31
+ due: formatDate(card.due),
32
+ last_review: formatDate(card.last_review),
33
+ },
34
+ });
35
+ console.table({
36
+ [`log_${key}`]: {
37
+ ...log,
38
+ review: formatDate(log.review),
39
+ },
40
+ });
41
+ console.groupEnd();
42
+ console.log('----------------------------------------------------------------');
43
+ });
40
44
  ```
41
45
 
42
46
  > More examples refer to the [Example](https://github.com/ishiko732/ts-fsrs/blob/master/test/index.ts)
package/lib/fsrs.d.ts CHANGED
@@ -1,12 +1,53 @@
1
- import dayjs from "dayjs";
2
- import { Card, FSRSParameters, SchedulingCard } from "./index";
1
+ import { Card, FSRSParameters, Rating, SchedulingCard, State } from "./index";
2
+ import { int } from './help';
3
3
  export default class FSRS {
4
4
  private param;
5
5
  private readonly intervalModifier;
6
6
  private seed?;
7
7
  constructor(param?: FSRSParameters);
8
- repeat: (card: Card, now: dayjs.Dayjs) => import("./models").SchedulingLog;
9
- get_retrievability: (card: Card, now: dayjs.Dayjs) => undefined | string;
8
+ repeat: (card: Card, now: Date) => {
9
+ 0: {
10
+ card: Card;
11
+ log: {
12
+ rating: Rating;
13
+ state: State;
14
+ elapsed_days: number;
15
+ scheduled_days: number;
16
+ review: Date;
17
+ };
18
+ };
19
+ 1: {
20
+ card: Card;
21
+ log: {
22
+ rating: Rating;
23
+ state: State;
24
+ elapsed_days: number;
25
+ scheduled_days: number;
26
+ review: Date;
27
+ };
28
+ };
29
+ 2: {
30
+ card: Card;
31
+ log: {
32
+ rating: Rating;
33
+ state: State;
34
+ elapsed_days: number;
35
+ scheduled_days: number;
36
+ review: Date;
37
+ };
38
+ };
39
+ 3: {
40
+ card: Card;
41
+ log: {
42
+ rating: Rating;
43
+ state: State;
44
+ elapsed_days: number;
45
+ scheduled_days: number;
46
+ review: Date;
47
+ };
48
+ };
49
+ };
50
+ get_retrievability: (card: Card, now: Date) => undefined | string;
10
51
  init_ds(s: SchedulingCard): void;
11
52
  /**
12
53
  *
@@ -33,16 +74,16 @@ export default class FSRS {
33
74
  */
34
75
  init_difficulty(g: number): number;
35
76
  apply_fuzz(ivl: number): number;
36
- next_interval(s: number): number;
77
+ next_interval(s: number): int;
37
78
  /**
38
79
  * The formula used is :
39
80
  * $$next_d = D + w_4 \cdot (R - 2)$$
40
81
  * $$D^\prime(D,R) = w_5 \cdot D_0(2) +(1 - w_5) \cdot next_d$$
41
82
  * @param d
42
- * @param r Rating[0.again,1.hard,2.good,3.easy]
83
+ * @param g Grade (Rating[0.again,1.hard,2.good,3.easy])
43
84
  * @return next_D
44
85
  */
45
- next_difficulty(d: number, r: number): number;
86
+ next_difficulty(d: number, g: number): number;
46
87
  /**
47
88
  * The formula used is :
48
89
  * $$\min \{\max \{D_0,1\},10\}$$
package/lib/fsrs.js CHANGED
@@ -3,30 +3,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const dayjs_1 = __importDefault(require("dayjs"));
7
6
  const seedrandom_1 = __importDefault(require("seedrandom"));
8
7
  const index_1 = require("./index");
9
8
  class FSRS {
10
9
  constructor(param) {
11
10
  this.repeat = (card, now) => {
12
11
  card = Object.assign({}, card);
13
- now = now.clone();
14
- card.elapsed_days = card.state === index_1.State.New ? 0 : now.diff((0, dayjs_1.default)(card.last_review), "days"); //相距时间
12
+ now = new Date(now.getTime());
13
+ card.elapsed_days = card.state === index_1.State.New ? 0 : now.diff(card.last_review, "days"); //相距时间
15
14
  card.last_review = now; // 上次复习时间
16
15
  card.reps += 1;
17
16
  const s = new index_1.SchedulingCard(card);
18
17
  s.update_state(card.state);
19
- this.seed = String(card.last_review.unix()) + String(card.elapsed_days);
18
+ this.seed = String(card.last_review.getTime()) + String(card.elapsed_days);
20
19
  let easy_interval, good_interval, hard_interval;
21
20
  switch (card.state) {
22
21
  case index_1.State.New:
23
22
  this.init_ds(s);
24
- s.again.due = now.add(1, 'minutes');
25
- s.hard.due = now.add(5, "minutes");
26
- s.good.due = now.add(10, "minutes");
23
+ s.again.due = now.scheduler(1);
24
+ s.hard.due = now.scheduler(5);
25
+ s.good.due = now.scheduler(10);
27
26
  easy_interval = this.next_interval(s.easy.stability * this.param.easy_bonus);
28
27
  s.easy.scheduled_days = easy_interval;
29
- s.easy.due = now.add(easy_interval, "days");
28
+ s.easy.due = now.scheduler(easy_interval, true);
30
29
  break;
31
30
  case index_1.State.Learning:
32
31
  case index_1.State.Relearning:
@@ -45,7 +44,7 @@ class FSRS {
45
44
  good_interval = this.next_interval(s.good.stability);
46
45
  hard_interval = Math.min(hard_interval, good_interval);
47
46
  good_interval = Math.max(good_interval, hard_interval + 1);
48
- easy_interval = Math.max(this.next_interval(s.easy.stability * this.param.hard_factor), good_interval + 1);
47
+ easy_interval = Math.max(this.next_interval(s.easy.stability * this.param.easy_bonus), good_interval + 1);
49
48
  s.schedule(now, hard_interval, good_interval, easy_interval);
50
49
  break;
51
50
  }
@@ -55,7 +54,7 @@ class FSRS {
55
54
  if (card.state !== index_1.State.Review) {
56
55
  return undefined;
57
56
  }
58
- const t = Math.max(now.diff((0, dayjs_1.default)(card.last_review), "days"), 0);
57
+ const t = Math.max(now.diff(card.last_review, "days"), 0);
59
58
  return (this.current_retrievability(t, card.stability) * 100).toFixed(2) + '%';
60
59
  };
61
60
  this.param = param || (0, index_1.generatorParameters)();
@@ -127,11 +126,11 @@ class FSRS {
127
126
  * $$next_d = D + w_4 \cdot (R - 2)$$
128
127
  * $$D^\prime(D,R) = w_5 \cdot D_0(2) +(1 - w_5) \cdot next_d$$
129
128
  * @param d
130
- * @param r Rating[0.again,1.hard,2.good,3.easy]
129
+ * @param g Grade (Rating[0.again,1.hard,2.good,3.easy])
131
130
  * @return next_D
132
131
  */
133
- next_difficulty(d, r) {
134
- const next_d = d + this.param.w[4] * (r - 2);
132
+ next_difficulty(d, g) {
133
+ const next_d = d + this.param.w[4] * (g - 2);
135
134
  return this.constrain_difficulty(this.mean_reversion(this.param.w[2], next_d));
136
135
  }
137
136
  /**
package/lib/help.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ export type unit = 'days' | 'minutes';
2
+ export type int = number & {
3
+ __int__: void;
4
+ };
5
+ export type double = number & {
6
+ __double__: void;
7
+ };
8
+ declare global {
9
+ export interface Date {
10
+ scheduler(t: int, isDay?: boolean): Date;
11
+ diff(pre: Date, unit: unit): int;
12
+ format(): string;
13
+ dueFormat(last_review: Date, unit?: boolean): string;
14
+ }
15
+ }
16
+ export declare function date_scheduler(now: Date, t: number, isDay?: boolean): Date;
17
+ export declare function date_diff(now: Date, pre: Date, unit: unit): number;
18
+ export declare function formatDate(date: Date): string;
19
+ export declare function show_diff_message(due: Date, last_review: Date, unit?: boolean): string;
package/lib/help.js ADDED
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.show_diff_message = exports.formatDate = exports.date_diff = exports.date_scheduler = void 0;
4
+ Date.prototype.scheduler = function (t, isDay) {
5
+ return date_scheduler(this, t, isDay);
6
+ };
7
+ /**
8
+ * 当前时间与之前的时间差值
9
+ * @param pre 比当前时间还要之前
10
+ * @param unit 单位: days | minutes
11
+ */
12
+ Date.prototype.diff = function (pre, unit) {
13
+ return date_diff(this, pre, unit);
14
+ };
15
+ Date.prototype.format = function () {
16
+ return formatDate(this);
17
+ };
18
+ Date.prototype.dueFormat = function (last_review, unit) {
19
+ return show_diff_message(this, last_review, unit);
20
+ };
21
+ function date_scheduler(now, t, isDay) {
22
+ return new Date(isDay ? now.getTime() + t * 24 * 60 * 60 * 1000 : now.getTime() + t * 60 * 1000);
23
+ }
24
+ exports.date_scheduler = date_scheduler;
25
+ function date_diff(now, pre, unit) {
26
+ const diff = now.getTime() - pre.getTime();
27
+ let r = 0;
28
+ switch (unit) {
29
+ case 'days':
30
+ r = Math.floor((diff) / (24 * 60 * 60 * 1000));
31
+ break;
32
+ case 'minutes':
33
+ r = Math.floor((diff) / (60 * 1000));
34
+ break;
35
+ }
36
+ return r;
37
+ }
38
+ exports.date_diff = date_diff;
39
+ function formatDate(date) {
40
+ const year = date.getFullYear();
41
+ const month = date.getMonth() + 1;
42
+ const day = date.getDate();
43
+ const hours = date.getHours();
44
+ const minutes = date.getMinutes();
45
+ const seconds = date.getSeconds();
46
+ return `${year}-${padZero(month)}-${padZero(day)} ${padZero(hours)}:${padZero(minutes)}:${padZero(seconds)}`;
47
+ }
48
+ exports.formatDate = formatDate;
49
+ function padZero(num) {
50
+ return num < 10 ? `0${num}` : `${num}`;
51
+ }
52
+ function show_diff_message(due, last_review, unit) {
53
+ const diff = due.getTime() - last_review.getTime();
54
+ if (diff < 1000 * 60 * 60) { // 小于1小时
55
+ return unit ? Math.floor((diff) / (60 * 1000)) + 'min' : String(Math.floor((diff) / (60 * 1000)));
56
+ }
57
+ else if (diff >= 1000 * 60 * 60 && diff < 1000 * 60 * 60 * 24) { // 大于1小时,小于1天
58
+ return unit ? Math.floor((diff) / (60 * 60 * 1000)) + 'hour' : String(Math.floor((diff) / (60 * 60 * 1000)));
59
+ }
60
+ else if (diff >= 1000 * 60 * 60 * 24 && diff < 1000 * 60 * 60 * 24 * 31) { // 大于1天,小于31天
61
+ return unit ? Math.floor((diff) / (24 * 60 * 60 * 1000)) + 'day' : String(Math.floor((diff) / (24 * 60 * 60 * 1000 * 1000)));
62
+ }
63
+ else if (diff >= 1000 * 60 * 60 * 24 * 31 && diff < 1000 * 60 * 60 * 24 * 365) { // 大于31天,小于365天
64
+ return unit ? ((diff) / (30 * 24 * 60 * 60 * 1000)).toFixed(2) + 'month' : ((diff) / (30 * 24 * 60 * 60 * 1000)).toFixed(2);
65
+ }
66
+ else { // 大于365天
67
+ return unit ? ((diff) / (365 * 24 * 60 * 60 * 1000)).toFixed(2) + 'year' : ((diff) / (365 * 24 * 60 * 60 * 1000)).toFixed(2);
68
+ }
69
+ }
70
+ exports.show_diff_message = show_diff_message;
package/lib/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import FSRS from "./fsrs";
2
2
  import { Card, default_easy_bonus, default_enable_fuzz, default_hard_factor, default_maximum_interval, default_request_retention, default_w, FSRSParameters, Rating, RatingType, ReviewLog, SchedulingLog, State, StateType } from "./models";
3
3
  import { SchedulingCard } from "./scheduler";
4
4
  declare const fsrs: (param?: FSRSParameters) => FSRS;
5
- declare const createEmptyCard: () => Card;
5
+ declare const createEmptyCard: (now?: Date) => Card;
6
6
  declare const generatorParameters: (props?: {
7
7
  request_retention?: number;
8
8
  maximum_interval?: number;
@@ -18,7 +18,8 @@ declare const generatorParameters: (props?: {
18
18
  w: number[];
19
19
  enable_fuzz: boolean;
20
20
  };
21
- declare const FSRS_Version = 1.2;
21
+ declare const FSRS_Version = "2.0.2";
22
22
  export { fsrs, FSRS_Version, State, Rating, SchedulingCard, createEmptyCard, generatorParameters };
23
23
  export type { StateType, RatingType, ReviewLog, Card, SchedulingLog, FSRSParameters };
24
24
  export { default_request_retention, default_maximum_interval, default_easy_bonus, default_hard_factor, default_w, default_enable_fuzz };
25
+ export { date_scheduler, date_diff, formatDate, show_diff_message } from './help';
package/lib/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default_enable_fuzz = exports.default_w = exports.default_hard_factor = exports.default_easy_bonus = exports.default_maximum_interval = exports.default_request_retention = exports.generatorParameters = exports.createEmptyCard = exports.SchedulingCard = exports.Rating = exports.State = exports.FSRS_Version = exports.fsrs = void 0;
6
+ exports.show_diff_message = exports.formatDate = exports.date_diff = exports.date_scheduler = exports.default_enable_fuzz = exports.default_w = exports.default_hard_factor = exports.default_easy_bonus = exports.default_maximum_interval = exports.default_request_retention = exports.generatorParameters = exports.createEmptyCard = exports.SchedulingCard = exports.Rating = exports.State = exports.FSRS_Version = exports.fsrs = void 0;
7
7
  const fsrs_1 = __importDefault(require("./fsrs"));
8
8
  const models_1 = require("./models");
9
9
  Object.defineProperty(exports, "default_easy_bonus", { enumerable: true, get: function () { return models_1.default_easy_bonus; } });
@@ -16,14 +16,13 @@ Object.defineProperty(exports, "Rating", { enumerable: true, get: function () {
16
16
  Object.defineProperty(exports, "State", { enumerable: true, get: function () { return models_1.State; } });
17
17
  const scheduler_1 = require("./scheduler");
18
18
  Object.defineProperty(exports, "SchedulingCard", { enumerable: true, get: function () { return scheduler_1.SchedulingCard; } });
19
- const dayjs_1 = __importDefault(require("dayjs"));
20
19
  const fsrs = (param) => {
21
20
  return new fsrs_1.default(param);
22
21
  };
23
22
  exports.fsrs = fsrs;
24
- const createEmptyCard = () => {
23
+ const createEmptyCard = (now) => {
25
24
  return {
26
- due: (0, dayjs_1.default)(),
25
+ due: now || new Date(),
27
26
  stability: 0,
28
27
  difficulty: 0,
29
28
  elapsed_days: 0,
@@ -56,5 +55,10 @@ const generatorParameters = (props) => {
56
55
  };
57
56
  };
58
57
  exports.generatorParameters = generatorParameters;
59
- const FSRS_Version = 1.20;
58
+ const FSRS_Version = "2.0.2";
60
59
  exports.FSRS_Version = FSRS_Version;
60
+ var help_1 = require("./help");
61
+ Object.defineProperty(exports, "date_scheduler", { enumerable: true, get: function () { return help_1.date_scheduler; } });
62
+ Object.defineProperty(exports, "date_diff", { enumerable: true, get: function () { return help_1.date_diff; } });
63
+ Object.defineProperty(exports, "formatDate", { enumerable: true, get: function () { return help_1.formatDate; } });
64
+ Object.defineProperty(exports, "show_diff_message", { enumerable: true, get: function () { return help_1.show_diff_message; } });
package/lib/models.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { Dayjs } from 'dayjs';
2
1
  export type StateType = "Learning" | "New" | "Review" | "Relearning";
3
2
  export declare enum State {
4
3
  New = 0,
@@ -18,10 +17,10 @@ export interface ReviewLog {
18
17
  state: State;
19
18
  elapsed_days: number;
20
19
  scheduled_days: number;
21
- review: Dayjs;
20
+ review: Date;
22
21
  }
23
22
  export interface Card {
24
- due: Dayjs;
23
+ due: Date;
25
24
  stability: number;
26
25
  difficulty: number;
27
26
  elapsed_days: number;
@@ -29,7 +28,7 @@ export interface Card {
29
28
  reps: number;
30
29
  lapses: number;
31
30
  state: State;
32
- last_review?: Dayjs;
31
+ last_review?: Date;
33
32
  }
34
33
  export interface SchedulingLog {
35
34
  [key: number]: {
@@ -1,5 +1,4 @@
1
- import { Card, SchedulingLog, State } from "./models";
2
- import { Dayjs } from "dayjs";
1
+ import { Card, Rating, State } from './models';
3
2
  export declare class SchedulingCard {
4
3
  again: Card;
5
4
  hard: Card;
@@ -8,6 +7,47 @@ export declare class SchedulingCard {
8
7
  private copy;
9
8
  constructor(card: Card);
10
9
  update_state(state: State): this;
11
- schedule(now: Dayjs, hard_interval: number, good_interval: number, easy_interval: number): SchedulingCard;
12
- record_log(card: Card, now: Dayjs): SchedulingLog;
10
+ schedule(now: Date, hard_interval: number, good_interval: number, easy_interval: number): SchedulingCard;
11
+ record_log(card: Card, now: Date): {
12
+ 0: {
13
+ card: Card;
14
+ log: {
15
+ rating: Rating;
16
+ state: State;
17
+ elapsed_days: number;
18
+ scheduled_days: number;
19
+ review: Date;
20
+ };
21
+ };
22
+ 1: {
23
+ card: Card;
24
+ log: {
25
+ rating: Rating;
26
+ state: State;
27
+ elapsed_days: number;
28
+ scheduled_days: number;
29
+ review: Date;
30
+ };
31
+ };
32
+ 2: {
33
+ card: Card;
34
+ log: {
35
+ rating: Rating;
36
+ state: State;
37
+ elapsed_days: number;
38
+ scheduled_days: number;
39
+ review: Date;
40
+ };
41
+ };
42
+ 3: {
43
+ card: Card;
44
+ log: {
45
+ rating: Rating;
46
+ state: State;
47
+ elapsed_days: number;
48
+ scheduled_days: number;
49
+ review: Date;
50
+ };
51
+ };
52
+ };
13
53
  }
package/lib/scheduler.js CHANGED
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SchedulingCard = void 0;
4
4
  const models_1 = require("./models");
5
+ const help_1 = require("./help");
5
6
  class SchedulingCard {
6
7
  copy(card) {
7
- var _a;
8
- return Object.assign(Object.assign({}, card), { due: card.due.clone(), last_review: (_a = card.last_review) === null || _a === void 0 ? void 0 : _a.clone() });
8
+ return Object.assign({}, card);
9
9
  }
10
10
  constructor(card) {
11
11
  this.again = this.copy(card);
@@ -41,15 +41,15 @@ class SchedulingCard {
41
41
  this.hard.scheduled_days = hard_interval;
42
42
  this.good.scheduled_days = good_interval;
43
43
  this.easy.scheduled_days = easy_interval;
44
- this.again.due = now.add(5, 'minutes');
45
- this.hard.due = hard_interval > 0 ? now.add(hard_interval, 'days') : now.add(10, 'minutes');
46
- this.good.due = now.add(good_interval, 'days');
47
- this.easy.due = now.add(easy_interval, 'days');
44
+ this.again.due = (0, help_1.date_scheduler)(now, 5);
45
+ this.hard.due = hard_interval > 0 ? (0, help_1.date_scheduler)(now, hard_interval, true) : (0, help_1.date_scheduler)(now, 10);
46
+ this.good.due = (0, help_1.date_scheduler)(now, good_interval, true);
47
+ this.easy.due = (0, help_1.date_scheduler)(now, easy_interval, true);
48
48
  return this;
49
49
  }
50
50
  record_log(card, now) {
51
51
  return {
52
- 0: {
52
+ [models_1.Rating.Again]: {
53
53
  card: this.again,
54
54
  log: {
55
55
  rating: models_1.Rating.Again,
@@ -59,7 +59,7 @@ class SchedulingCard {
59
59
  review: now
60
60
  }
61
61
  },
62
- 1: {
62
+ [models_1.Rating.Hard]: {
63
63
  card: this.hard,
64
64
  log: {
65
65
  rating: models_1.Rating.Hard,
@@ -69,7 +69,7 @@ class SchedulingCard {
69
69
  review: now
70
70
  }
71
71
  },
72
- 2: {
72
+ [models_1.Rating.Good]: {
73
73
  card: this.good,
74
74
  log: {
75
75
  rating: models_1.Rating.Good,
@@ -79,7 +79,7 @@ class SchedulingCard {
79
79
  review: now
80
80
  }
81
81
  },
82
- 3: {
82
+ [models_1.Rating.Easy]: {
83
83
  card: this.easy,
84
84
  log: {
85
85
  rating: models_1.Rating.Easy,
package/package.json CHANGED
@@ -1,41 +1,43 @@
1
- {
2
- "name": "ts-fsrs",
3
- "version": "1.2.0",
4
- "description": "ts-fsrs is a TypeScript package used to implement the Free Spaced Repetition Scheduler (FSRS) algorithm. It helps developers apply FSRS to their flashcard applications, thereby improving the user learning experience.",
5
- "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
- "keywords": [
8
- "SuperMemo",
9
- "Anki",
10
- "FSRS"
11
- ],
12
- "dependencies": {
13
- "@types/seedrandom": "^3.0.5",
14
- "dayjs": "^1.11.7",
15
- "seedrandom": "^3.0.5"
16
- },
17
- "devDependencies": {
18
- "eslint": "^8.34.0",
19
- "typescript": "^4.9.5"
20
- },
21
- "scripts": {
22
- "test": "ts-node test/index.ts",
23
- "build": "tsc",
24
- "test_publish": "yalc publish"
25
- },
26
- "author": "ishiko",
27
- "license": "MIT",
28
- "files": [
29
- "lib/**/*",
30
- "README.md",
31
- "LICENSE"
32
- ],
33
- "repository": {
34
- "type": "git",
35
- "url": "git+https://github.com/ishiko732/ts-fsrs.git"
36
- },
37
- "bugs": {
38
- "url": "https://github.com/ishiko732/ts-fsrs/issues"
39
- },
40
- "homepage": "https://github.com/ishiko732/ts-fsrs#readme"
41
- }
1
+ {
2
+ "name": "ts-fsrs",
3
+ "version": "2.0.2",
4
+ "description": "ts-fsrs is a TypeScript package used to implement the Free Spaced Repetition Scheduler (FSRS) algorithm. It helps developers apply FSRS to their flashcard applications, thereby improving the user learning experience.",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "keywords": [
8
+ "SuperMemo",
9
+ "Anki",
10
+ "FSRS"
11
+ ],
12
+ "dependencies": {
13
+ "seedrandom": "^3.0.5"
14
+ },
15
+ "devDependencies": {
16
+ "@types/seedrandom": "^3.0.5",
17
+ "eslint": "^8.34.0",
18
+ "typescript": "^4.9.5"
19
+ },
20
+ "scripts": {
21
+ "test": "ts-node test/index.ts",
22
+ "build": "tsc",
23
+ "test_publish": "yalc publish",
24
+ "major": "npm version major",
25
+ "minor": "npm version minor",
26
+ "patch": "npm version patch"
27
+ },
28
+ "author": "ishiko",
29
+ "license": "MIT",
30
+ "files": [
31
+ "lib/**/*",
32
+ "README.md",
33
+ "LICENSE"
34
+ ],
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/ishiko732/ts-fsrs.git"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/ishiko732/ts-fsrs/issues"
41
+ },
42
+ "homepage": "https://github.com/ishiko732/ts-fsrs#readme"
43
+ }