-
Notifications
You must be signed in to change notification settings - Fork 72
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
Fix install #15
Fix install #15
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
"scripts": { | ||
"lint": "eslint .", | ||
"build": "tsc src/*.ts -d --strictNullChecks --sourceMap --outdir ./lib --lib ES6,ES5", | ||
"postinstall": "npm run build", | ||
"prepublish": "not-in-install && npm run build || in-install", | ||
"test": "ava test", | ||
"coverage": "nyc --check-coverage=true npm test", | ||
"coveralls": "nyc report --reporter=text-lcov | coveralls" | ||
|
@@ -29,7 +29,7 @@ | |
"request": "^2.74.0" | ||
}, | ||
"engines": { | ||
"node": "6" | ||
"node": ">=6" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You test on node 4, though, why lock it to 6? |
||
}, | ||
"files": [ | ||
"lib", | ||
|
@@ -42,6 +42,7 @@ | |
"coveralls": "^2.11.2", | ||
"eslint": "^3.3.1", | ||
"eslint-config-finn": "^1.0.0-alpha.9", | ||
"in-publish": "^2.0.0", | ||
"mkdirp": "^0.5.1", | ||
"nock": "^1.2.1", | ||
"nyc": "^8.3.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ export default class Repository extends EventEmitter implements EventEmitter { | |
private storage: Storage; | ||
private etag: string; | ||
|
||
constructor (backupPath: string, url: string, refreshIntervall?: number, StorageImpl = Storage) { | ||
constructor (backupPath: string, url: string, refreshInterval?: number, StorageImpl = Storage) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Breaking change, I suppose... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New client is breaking, so fine to fix this as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
super(); | ||
if (!url.startsWith('http')) { | ||
throw new Error(`Wrong url: ${url}`); | ||
|
@@ -24,8 +24,8 @@ export default class Repository extends EventEmitter implements EventEmitter { | |
|
||
process.nextTick(() => this.fetch()); | ||
|
||
if (refreshIntervall != null && refreshIntervall > 0) { | ||
this.timer = setInterval(() => this.fetch(), refreshIntervall); | ||
if (refreshInterval != null && refreshInterval > 0) { | ||
this.timer = setInterval(() => this.fetch(), refreshInterval); | ||
this.timer.unref(); | ||
} | ||
} | ||
|
@@ -61,7 +61,7 @@ export default class Repository extends EventEmitter implements EventEmitter { | |
} | ||
|
||
if (res.statusCode !== 200) { | ||
return this.emit('error', new Error('Reponse was not statusCode 200')); | ||
return this.emit('error', new Error('Response was not statusCode 200')); | ||
} | ||
|
||
try { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing as this typo was present in the old version as well, maybe we should do something like
and map it? Making migration from old to new easier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sure add this.