cronli5 0.2.1 → 0.3.4

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/README.md +4 -4
  3. package/cronli5.min.js +2 -2
  4. package/dist/cronli5.cjs +471 -383
  5. package/dist/cronli5.js +471 -383
  6. package/dist/lang/de.cjs +286 -215
  7. package/dist/lang/de.js +286 -215
  8. package/dist/lang/en.cjs +413 -327
  9. package/dist/lang/en.js +413 -327
  10. package/dist/lang/es.cjs +303 -265
  11. package/dist/lang/es.js +303 -265
  12. package/dist/lang/fi.cjs +311 -266
  13. package/dist/lang/fi.js +311 -266
  14. package/dist/lang/zh.cjs +320 -240
  15. package/dist/lang/zh.js +320 -240
  16. package/package.json +6 -6
  17. package/src/core/analyze.ts +12 -12
  18. package/src/core/cadence.ts +164 -0
  19. package/src/core/index.ts +3 -1
  20. package/src/core/normalize.ts +3 -3
  21. package/src/core/parse.ts +1 -1
  22. package/src/core/{ir.ts → schedule.ts} +17 -18
  23. package/src/core/specs.ts +1 -1
  24. package/src/core/util.ts +3 -165
  25. package/src/core/validate.ts +1 -1
  26. package/src/core/weekday.ts +54 -0
  27. package/src/cronli5.ts +5 -5
  28. package/src/lang/de/index.ts +329 -219
  29. package/src/lang/en/dialects.ts +1 -1
  30. package/src/lang/en/index.ts +521 -372
  31. package/src/lang/es/index.ts +338 -286
  32. package/src/lang/es/notes.md +1 -1
  33. package/src/lang/fi/dialects.ts +1 -1
  34. package/src/lang/fi/index.ts +365 -299
  35. package/src/lang/fi/notes.md +23 -8
  36. package/src/lang/fi/status.json +1 -1
  37. package/src/lang/zh/index.ts +386 -245
  38. package/src/types.ts +6 -6
  39. package/types/core/analyze.d.ts +3 -3
  40. package/types/core/cadence.d.ts +33 -0
  41. package/types/core/index.d.ts +3 -1
  42. package/types/core/normalize.d.ts +1 -1
  43. package/types/core/parse.d.ts +1 -1
  44. package/types/core/{ir.d.ts → schedule.d.ts} +11 -16
  45. package/types/core/specs.d.ts +1 -1
  46. package/types/core/util.d.ts +1 -30
  47. package/types/core/weekday.d.ts +10 -0
  48. package/types/lang/de/index.d.ts +1 -1
  49. package/types/lang/en/dialects.d.ts +1 -1
  50. package/types/lang/en/index.d.ts +1 -1
  51. package/types/lang/es/index.d.ts +1 -1
  52. package/types/lang/fi/dialects.d.ts +1 -1
  53. package/types/lang/fi/index.d.ts +1 -1
  54. package/types/lang/zh/index.d.ts +1 -1
  55. package/types/types.d.ts +5 -5
package/src/cronli5.ts CHANGED
@@ -28,7 +28,7 @@
28
28
  // patterns always parse seconds first and year last)
29
29
 
30
30
  import {analyze, prepare} from './core/index.js';
31
- import type {NormalizedOptions} from './core/ir.js';
31
+ import type {NormalizedOptions} from './core/schedule.js';
32
32
  import type {CronPattern, Cronli5Language, Cronli5Options}
33
33
  from './types.js';
34
34
  import en from './lang/en/index.js';
@@ -79,13 +79,13 @@ function interpretCronPattern(
79
79
  return lang.reboot;
80
80
  }
81
81
 
82
- // Analyze into the neutral content + the core's suggested plan, then let the
82
+ // Analyze into the neutral facts + the core's suggested plan, then let the
83
83
  // language optionally override the plan before rendering. A language
84
84
  // without a `plan` hook renders the core's suggestion unchanged.
85
- const ir = analyze(prepare(cronPattern, opts));
86
- const plan = lang.plan ? lang.plan(ir, ir.plan) : ir.plan;
85
+ const schedule = analyze(prepare(cronPattern, opts));
86
+ const plan = lang.plan ? lang.plan(schedule, schedule.plan) : schedule.plan;
87
87
 
88
- return lang.describe({...ir, plan}, opts);
88
+ return lang.describe({...schedule, plan}, opts);
89
89
  }
90
90
 
91
91
  export default cronli5;