mirror of
https://github.com/jimeh/node-base58.git
synced 2026-02-19 07:36:40 +00:00
Lint using semistandard
This commit is contained in:
@@ -1,10 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
extends: 'flickr',
|
extends: 'semistandard',
|
||||||
|
|
||||||
env: {
|
env: {
|
||||||
browser: true,
|
browser: true,
|
||||||
node: true
|
node: true
|
||||||
},
|
}
|
||||||
|
|
||||||
rules: {}
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^4.1.1",
|
"eslint": "^4.1.1",
|
||||||
"eslint-config-flickr": "^1.3.1",
|
"eslint-config-semistandard": "^11.0.0",
|
||||||
"mocha": "^3.4.2"
|
"mocha": "^3.4.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -7,19 +7,19 @@ var alphabetLookup = alphabet.split('').reduce(function (lookup, char, index) {
|
|||||||
return lookup;
|
return lookup;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
function assertNonNegativeSafeInteger(val) {
|
function assertNonNegativeSafeInteger (val) {
|
||||||
if (typeof val !== 'number' || isNaN(val) || val < 0 || val > Number.MAX_SAFE_INTEGER || Math.floor(val) !== val) {
|
if (typeof val !== 'number' || isNaN(val) || val < 0 || val > Number.MAX_SAFE_INTEGER || Math.floor(val) !== val) {
|
||||||
throw new Error('Value passed is not a non-negative safe integer.');
|
throw new Error('Value passed is not a non-negative safe integer.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertString(str) {
|
function assertString (str) {
|
||||||
if (typeof str !== 'string') {
|
if (typeof str !== 'string') {
|
||||||
throw new Error('Value passed is not a string.');
|
throw new Error('Value passed is not a string.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertBase58Character(character) {
|
function assertBase58Character (character) {
|
||||||
if (alphabetLookup[character] === undefined) {
|
if (alphabetLookup[character] === undefined) {
|
||||||
throw new Error('Value passed is not a valid Base58 string.');
|
throw new Error('Value passed is not a valid Base58 string.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ var assert = require('assert');
|
|||||||
var examples = require('./examples');
|
var examples = require('./examples');
|
||||||
var base58 = require('..');
|
var base58 = require('..');
|
||||||
|
|
||||||
function exampleRunner(callback) {
|
function exampleRunner (callback) {
|
||||||
Object.keys(examples).forEach(function (str) {
|
Object.keys(examples).forEach(function (str) {
|
||||||
callback(str, examples[str]);
|
callback(str, examples[str]);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user