-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into console-to-debug
- Loading branch information
Showing
14 changed files
with
108 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
const steem = require('..'); | ||
const steem = require('../lib'); | ||
|
||
const resultP = steem.api.getContentAsync('yamadapc', 'test-1-2-3-4-5-6-7-9'); | ||
resultP.then(result => console.log(result)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const api = require('./api'); | ||
const auth = require('./auth'); | ||
const broadcast = require('./broadcast'); | ||
const formatter = require('./formatter')(api); | ||
const memo = require('./auth/memo'); | ||
const config = require('./config'); | ||
const utils = require('./utils'); | ||
|
||
module.exports = { | ||
api, | ||
auth, | ||
broadcast, | ||
formatter, | ||
memo, | ||
config, | ||
utils, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const snakeCaseRe = /_([a-z])/g; | ||
export function camelCase(str) { | ||
return str.replace(snakeCaseRe, function(_m, l) { | ||
return l.toUpperCase(); | ||
}); | ||
} | ||
|
||
export function validateAccountName(value) { | ||
let i, label, len, suffix; | ||
|
||
suffix = "Account name should "; | ||
if (!value) { | ||
return suffix + "not be empty."; | ||
} | ||
const length = value.length; | ||
if (length < 3) { | ||
return suffix + "be longer."; | ||
} | ||
if (length > 16) { | ||
return suffix + "be shorter."; | ||
} | ||
if (/\./.test(value)) { | ||
suffix = "Each account segment should "; | ||
} | ||
const ref = value.split("."); | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
label = ref[i]; | ||
if (!/^[a-z]/.test(label)) { | ||
return suffix + "start with a letter."; | ||
} | ||
if (!/^[a-z0-9-]*$/.test(label)) { | ||
return suffix + "have only letters, digits, or dashes."; | ||
} | ||
if (/--/.test(label)) { | ||
return suffix + "have only one dash in a row."; | ||
} | ||
if (!/[a-z0-9]$/.test(label)) { | ||
return suffix + "end with a letter or digit."; | ||
} | ||
if (!(label.length >= 3)) { | ||
return suffix + "be longer"; | ||
} | ||
} | ||
return null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters