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 hasDRM() and update typings #44

Merged
merged 3 commits into from Nov 4, 2019
Merged

Add hasDRM() and update typings #44

merged 3 commits into from Nov 4, 2019

Conversation

xavdid
Copy link
Collaborator

@xavdid xavdid commented Nov 3, 2019

Hi there!

This PR adds one function: hasDRM() it checks for the existence of the encryption file, and if it's there, the book is protected. I didn't add a test here, but the functionality is tested where I use it, here.

I also updated your typescript definitions. I was following this blueprint. I also updated the triple-slash directive per these instructions.

Thanks a bunch!

export = EPub;
import { EventEmitter } from 'events'

declare class EPub extends EventEmitter {
Copy link
Collaborator Author

@xavdid xavdid Nov 3, 2019

Choose a reason for hiding this comment

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

this was auto-formatted with prettier, sorry about that. It happens by default in my editor, so it happened at one point while editing. If it's a sticking point, i'm happy to go through and un-format it.

export = EPub

declare namespace EPub {
export interface TocElement {
Copy link
Collaborator Author

@xavdid xavdid Nov 3, 2019

Choose a reason for hiding this comment

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

This pattern allows things like:

import EPub = require('epub')
import { TocElement } from 'epub'

const func = (book: EPub, chapter: TocElement) => ...

@xavdid
Copy link
Collaborator Author

xavdid commented Nov 3, 2019

Looks like there's a test failure. Maybe try updating the @types/node dependency: microsoft/TypeScript#32333

@julien-c
Copy link
Owner

julien-c commented Nov 4, 2019

LGTM, thanks!

@julien-c julien-c merged commit 9571357 into julien-c:master Nov 4, 2019
1 check failed
@julien-c
Copy link
Owner

julien-c commented Nov 4, 2019

(if you find a way to fix the tests that'd be awesome)

@xavdid
Copy link
Collaborator Author

xavdid commented Nov 4, 2019

sure, I'll take a look!

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.

None yet

2 participants