Skip to content

Commit

Permalink
Merge pull request #177 from marp-team/remove-theme-meta-fallback
Browse files Browse the repository at this point in the history
Remove deprecated dot notation support for meta in ThemeSet#getThemeProp
  • Loading branch information
yhatt authored Jul 11, 2019
2 parents 1c4eec5 + 29488a8 commit 9068940
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
- Allow customization the content of pagination ([#175](https://github.com/marp-team/marpit/pull/175))
- Upgrade dependent packages to the latest version ([#176](https://github.com/marp-team/marpit/pull/176))

### Removed

- Remove deprecated dot notation support for meta in `ThemeSet#getThemeProp` ([#177](https://github.com/marp-team/marpit/pull/177))

## v1.2.0 - 2019-06-17

### Added
Expand Down
8 changes: 0 additions & 8 deletions src/theme_set.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,6 @@ class ThemeSet {
* @returns {*}
*/
getThemeProp(theme, prop) {
// TODO: Remove deprecated dot notation support for meta
if (prop.startsWith('meta.')) {
console.warn(
'Deprecation warning: Dot notation path in getThemeProp to get meta value has no longer supported. We still have a special fallback into getThemeMeta method, but it would remove soon.'
)
return this.getThemeMeta(theme, prop.slice(5))
}

const themeInstance = theme instanceof Theme ? theme : this.get(theme)
const props = themeInstance
? this.resolveImport(themeInstance).map(t => t[prop])
Expand Down
9 changes: 0 additions & 9 deletions test/theme_set.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,6 @@ describe('ThemeSet', () => {
it('ignores importing undefined theme and fallbacks to scaffold value', () =>
expect(getThemeProp('undefined-theme', 'width')).toBe(width))
})

context('[Deprecated] with dot notation path to meta property', () => {
it('returns the value of property by using #getThemeMeta', () => {
const spy = jest.spyOn(instance, 'getThemeMeta')

expect(getThemeProp('meta', 'meta.meta-value')).toBe('A')
expect(spy).toBeCalledWith('meta', 'meta-value')
})
})
})

describe('#has', () => {
Expand Down

0 comments on commit 9068940

Please sign in to comment.