Skip to content

Commit

Permalink
Merge pull request #507 from vbudovski/fix/esm-exports
Browse files Browse the repository at this point in the history
fix: Export RRule and RRuleSet as named exports
  • Loading branch information
davidgoli authored Jun 5, 2022
2 parents 17268f4 + ed7f929 commit 484daef
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*
*/

import RRule from './rrule'
import RRuleSet from './rruleset'
import { RRule } from './rrule'
import { RRuleSet } from './rruleset'

export { rrulestr } from './rrulestr'
export { Frequency, ByWeekday, Options } from './types'
Expand Down
2 changes: 1 addition & 1 deletion src/iter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import IterResult from '../iterresult'
import { ParsedOptions, freqIsDailyOrGreater, QueryMethodTypes } from '../types'
import dateutil from '../dateutil'
import Iterinfo from '../iterinfo/index'
import RRule from '../rrule'
import { RRule } from '../rrule'
import { buildTimeset } from '../parseoptions'
import { notEmpty, includes, isPresent } from '../helpers'
import { DateWithZone } from '../datewithzone'
Expand Down
2 changes: 1 addition & 1 deletion src/iterinfo/monthinfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ParsedOptions } from '../types'
import RRule from '../rrule'
import { RRule } from '../rrule'
import { empty, repeat, pymod } from '../helpers'

export interface MonthInfo {
Expand Down
4 changes: 2 additions & 2 deletions src/iterset.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import IterResult from './iterresult'
import RRule from './rrule'
import { RRule } from './rrule'
import { DateWithZone } from './datewithzone'
import { iter } from './iter/index'
import { iter } from './iter'
import dateutil from './dateutil'
import { QueryMethodTypes, IterResultType } from './types'

Expand Down
2 changes: 1 addition & 1 deletion src/nlp/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ToText, { DateFormatter, GetText } from './totext'
import parseText from './parsetext'
import RRule from '../rrule'
import { RRule } from '../rrule'
import { Frequency } from '../types'
import ENGLISH, { Language } from './i18n'

Expand Down
2 changes: 1 addition & 1 deletion src/nlp/parsetext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ENGLISH, { Language } from './i18n'
import RRule from '../rrule'
import { RRule } from '../rrule'
import { Options } from '../types'
import { WeekdayStr } from '../weekday'

Expand Down
2 changes: 1 addition & 1 deletion src/nlp/totext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ENGLISH, { Language } from './i18n'
import RRule from '../rrule'
import { RRule } from '../rrule'
import { Options, ByWeekday } from '../types'
import { Weekday } from '../weekday'
import { isArray, isNumber, isPresent } from '../helpers'
Expand Down
2 changes: 1 addition & 1 deletion src/optionstostring.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Options } from './types'
import RRule, { DEFAULT_OPTIONS } from './rrule'
import { RRule, DEFAULT_OPTIONS } from './rrule'
import { includes, isPresent, isArray, isNumber, toArray } from './helpers'
import { Weekday } from './weekday'
import dateutil from './dateutil'
Expand Down
2 changes: 1 addition & 1 deletion src/parseoptions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Options, ParsedOptions, freqIsDailyOrGreater } from './types'
import { includes, notEmpty, isPresent, isNumber, isArray, isWeekdayStr } from './helpers'
import RRule, { defaultKeys, DEFAULT_OPTIONS } from './rrule'
import { RRule, defaultKeys, DEFAULT_OPTIONS } from './rrule'
import dateutil from './dateutil'
import { Weekday } from './weekday'
import { Time } from './datetime'
Expand Down
2 changes: 1 addition & 1 deletion src/rrule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const defaultKeys = Object.keys(DEFAULT_OPTIONS) as (keyof Options)[]
* The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ...
* @constructor
*/
export default class RRule implements QueryMethods {
export class RRule implements QueryMethods {
public _cache: Cache | null
public origOptions: Partial<Options>
public options: ParsedOptions
Expand Down
4 changes: 2 additions & 2 deletions src/rruleset.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import RRule from './rrule'
import { RRule } from './rrule'
import dateutil from './dateutil'
import { includes } from './helpers'
import IterResult from './iterresult'
Expand Down Expand Up @@ -26,7 +26,7 @@ function createGetterSetter <T> (fieldName: string) {
}
}

export default class RRuleSet extends RRule {
export class RRuleSet extends RRule {
public readonly _rrule: RRule[]
public readonly _rdate: Date[]
public readonly _exrule: RRule[]
Expand Down
4 changes: 2 additions & 2 deletions src/rrulestr.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import RRule from './rrule'
import RRuleSet from './rruleset'
import { RRule } from './rrule'
import { RRuleSet } from './rruleset'
import dateutil from './dateutil'
import { includes, split } from './helpers'
import { Options } from './types'
Expand Down
2 changes: 1 addition & 1 deletion test/optionstostring.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Options } from "../src/types";
import RRule from "../src/rrule";
import { RRule } from "../src/rrule";
import { optionsToString } from "../src/optionstostring";
import { expect } from "chai";

Expand Down
2 changes: 1 addition & 1 deletion test/parsestring.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import RRule from '../src/rrule'
import { RRule } from '../src/rrule'
import { expect } from 'chai'
import { parseString } from '../src/parsestring'
import { Options, Frequency } from '../src/types';
Expand Down

0 comments on commit 484daef

Please sign in to comment.