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

Update dependencies; conform to ESLint no-prototype-builtins rule #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/asn1/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Entity.prototype._createNamed = function createNamed(Base) {
Entity.prototype._getDecoder = function _getDecoder(enc) {
enc = enc || 'der';
// Lazily create decoder
if (!this.decoders.hasOwnProperty(enc))
if (!Object.prototype.hasOwnProperty.call(this.decoders, enc))
this.decoders[enc] = this._createNamed(decoders[enc]);
return this.decoders[enc];
};
Expand All @@ -47,7 +47,7 @@ Entity.prototype.decode = function decode(data, enc, options) {
Entity.prototype._getEncoder = function _getEncoder(enc) {
enc = enc || 'der';
// Lazily create encoder
if (!this.encoders.hasOwnProperty(enc))
if (!Object.prototype.hasOwnProperty.call(this.encoders, enc))
this.encoders[enc] = this._createNamed(encoders[enc]);
return this.encoders[enc];
};
Expand Down
6 changes: 3 additions & 3 deletions lib/asn1/encoders/der.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {
if (typeof id === 'string') {
if (!values)
return this.reporter.error('string objid given, but no values map found');
if (!values.hasOwnProperty(id))
if (!Object.prototype.hasOwnProperty.call(values, id))
return this.reporter.error('objid not found in values map');
id = values[id].split(/[\s.]+/g);
for (let i = 0; i < id.length; i++)
Expand Down Expand Up @@ -186,7 +186,7 @@ DERNode.prototype._encodeInt = function encodeInt(num, values) {
if (typeof num === 'string') {
if (!values)
return this.reporter.error('String int or enum given, but no values map');
if (!values.hasOwnProperty(num)) {
if (!Object.prototype.hasOwnProperty.call(values, num)) {
return this.reporter.error('Values map doesn\'t contain: ' +
JSON.stringify(num));
}
Expand Down Expand Up @@ -276,7 +276,7 @@ function encodeTag(tag, primitive, cls, reporter) {
else if (tag === 'setof')
tag = 'set';

if (der.tagByName.hasOwnProperty(tag))
if (Object.prototype.hasOwnProperty.call(der.tagByName, tag))
res = der.tagByName[tag];
else if (typeof tag === 'number' && (tag | 0) === tag)
res = tag;
Expand Down
Loading