Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getters for rrules, exrules, rdates, exdates #347

Merged
merged 6 commits into from
Jun 7, 2019

Conversation

epicfaace
Copy link
Contributor


Thanks for contributing to rrule!

To submit a pull request, please verify that you have done the following:

  • Merged in or rebased on the latest master commit
  • Linked to an existing bug or issue describing the bug or feature you're
    addressing
  • Written one or more tests showing that your change works as advertised
  • Run yarn build to rebuild the dist/ files

@codecov-io
Copy link

codecov-io commented Jun 6, 2019

Codecov Report

Merging #347 into master will increase coverage by 0.31%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #347      +/-   ##
==========================================
+ Coverage   89.74%   90.06%   +0.31%     
==========================================
  Files          27       28       +1     
  Lines        1902     1962      +60     
  Branches      578      583       +5     
==========================================
+ Hits         1707     1767      +60     
  Misses        195      195
Impacted Files Coverage Δ
src/rruleset.ts 100% <100%> (ø) ⬆️
src/iterinfo/easter.ts 100% <0%> (ø) ⬆️
src/iter/poslist.ts 100% <0%> (ø) ⬆️
src/masks.ts 100% <0%> (ø) ⬆️
src/index.ts 100% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 524f925...00df226. Read the comment docs.

Copy link
Collaborator

@davidgoli davidgoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, these properties are deliberately private, because they're not meant to be mutable from the outside. I'm concerned if we expose these getters, consumers will start mutating them, and then expecting those mutations to take effect. I'm not interested in supporting that at this time, and in fact, want to get away from mutability altogether. If there were a way to return copies of the properties, such that changing the copies did not change the original value, then we could accept that.

@epicfaace
Copy link
Contributor Author

@davidgoli sure thing -- I agree with your logic, our use case is not to modify them at all -- we just need to be able to generate RRules from an RRuleset for an RRuleset visual editor. I've modified the PR accordingly.

set.rrule(rrule);

expect(set.rrules().map(e => e.toString())).eql([rrule.toString()]);
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small style nitpick: can we make sure there are blank lines in between it blocks? thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@davidgoli davidgoli merged commit 7fd5993 into jkbrzt:master Jun 7, 2019
@epicfaace
Copy link
Contributor Author

@davidgoli could you create a release for this? Would be greatly appreciated -- thanks!

@davidgoli
Copy link
Collaborator

@epicfaace Published v2.6.2. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants