@burstjs/util
Advanced tools
Comparing version 0.0.14 to 0.1.0-rc.2
{ | ||
"name": "@burstjs/util", | ||
"version": "0.0.14", | ||
"version": "0.1.0-rc.2", | ||
"description": "Useful utilities and tools for building Burstcoin applications", | ||
@@ -59,3 +59,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "52816c035b215eeff299acec2dc9877ec69622ae" | ||
"gitHead": "8080c7a2fef903055d44793fe8ed5d1a864ff398" | ||
} |
114
README.md
@@ -20,7 +20,22 @@ # @burstjs/util | ||
## API Reference | ||
## Modules | ||
<dl> | ||
<dt><a href="#module_util">util</a></dt> | ||
<dd></dd> | ||
</dl> | ||
## Members | ||
<dl> | ||
<dt><a href="#isValid">isValid</a> ⇒ <code>boolean</code></dt> | ||
<dd><p>Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)</p></dd> | ||
</dl> | ||
## Constants | ||
<dl> | ||
<dt><a href="#burstAddressPattern">burstAddressPattern</a></dt> | ||
<dd><p>A useful regex for matching burst addresses</p></dd> | ||
<dt><a href="#initialCodeword">initialCodeword</a></dt> | ||
<dd><p>Original work Copyright (c) 2018 PoC-Consortium | ||
Modified work Copyright (c) 2019 Burst Apps Team</p></dd> | ||
</dl> | ||
@@ -33,13 +48,11 @@ | ||
<dd><p>Construct a Burst address from a string array</p></dd> | ||
<dt><a href="#convertNumberToString">convertNumberToString(n)</a> ⇒</dt> | ||
<dt><a href="#convertAddressToNumericId">convertAddressToNumericId(address)</a> ⇒</dt> | ||
<dd><p>Converts BURST-XXXX-XXXX-XXXX-XXXXX into numeric Id</p></dd> | ||
<dt><a href="#convertNQTStringToNumber">convertNQTStringToNumber(amount)</a> ⇒</dt> | ||
<dd><p>Helper method to convert a String to number</p></dd> | ||
<dt><a href="#convertNumberToNQTString">convertNumberToNQTString(n)</a> ⇒</dt> | ||
<dd><p>Helper method to Number to String(8 decimals) representation</p></dd> | ||
<dt><a href="#convertStringToNumber">convertStringToNumber(amount)</a> ⇒</dt> | ||
<dd><p>Helper method to convert a String to number</p></dd> | ||
<dt><a href="#decode">decode(address)</a></dt> | ||
<dd><p>Decode BURST-XXXX-XXXX-XXXX-XXXXX into numeric Id</p></dd> | ||
<dt><a href="#encode">encode(numericId)</a></dt> | ||
<dt><a href="#convertNumericIdToAddress">convertNumericIdToAddress(numericId)</a> ⇒</dt> | ||
<dd><p>Encode a numeric id into BURST-XXXX-XXXX-XXXX-XXXXX</p></dd> | ||
<dt><a href="#isBurstAddress">isBurstAddress(address)</a></dt> | ||
<dd><p>Validation Check. Quick validation of Burst addresses included</p></dd> | ||
<dt><a href="#isValid">isValid(address)</a></dt> | ||
<dt><a href="#isValid">isValid(address)</a> ⇒ <code>boolean</code></dt> | ||
<dd><p>Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)</p></dd> | ||
@@ -50,7 +63,30 @@ <dt><a href="#splitBurstAddress">splitBurstAddress(address)</a></dt> | ||
<a name="burstAddressPattern"></a> | ||
<a name="module_util"></a> | ||
## burstAddressPattern | ||
## util | ||
<a name="module_util..burstAddressPattern"></a> | ||
### util~burstAddressPattern | ||
<p>A useful regex for matching burst addresses</p> | ||
**Kind**: inner constant of [<code>util</code>](#module_util) | ||
<a name="isValid"></a> | ||
## isValid ⇒ <code>boolean</code> | ||
<p>Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)</p> | ||
**Kind**: global variable | ||
**Returns**: <code>boolean</code> - <p>true, if is a valid address, else false</p> | ||
**Note**: This is with prior quick check | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| address | <code>string</code> | <p>The address</p> | | ||
<a name="initialCodeword"></a> | ||
## initialCodeword | ||
<p>Original work Copyright (c) 2018 PoC-Consortium | ||
Modified work Copyright (c) 2019 Burst Apps Team</p> | ||
**Kind**: global constant | ||
@@ -68,17 +104,17 @@ <a name="constructBurstAddress"></a> | ||
<a name="convertNumberToString"></a> | ||
<a name="convertAddressToNumericId"></a> | ||
## convertNumberToString(n) ⇒ | ||
<p>Helper method to Number to String(8 decimals) representation</p> | ||
## convertAddressToNumericId(address) ⇒ | ||
<p>Converts BURST-XXXX-XXXX-XXXX-XXXXX into numeric Id</p> | ||
**Kind**: global function | ||
**Returns**: <p>a NQT number string</p> | ||
**Returns**: <p>The numeric id, or undefined if address is invalid</p> | ||
| Param | Description | | ||
| --- | --- | | ||
| n | <p>the number</p> | | ||
| address | <p>The BURST address</p> | | ||
<a name="convertStringToNumber"></a> | ||
<a name="convertNQTStringToNumber"></a> | ||
## convertStringToNumber(amount) ⇒ | ||
## convertNQTStringToNumber(amount) ⇒ | ||
<p>Helper method to convert a String to number</p> | ||
@@ -88,3 +124,7 @@ | ||
**Returns**: <p>A number expressed in Burst (not NQT)</p> | ||
**Throws**: | ||
- <p>exception if argument is invalid</p> | ||
| Param | Description | | ||
@@ -94,19 +134,21 @@ | --- | --- | | ||
<a name="decode"></a> | ||
<a name="convertNumberToNQTString"></a> | ||
## decode(address) | ||
<p>Decode BURST-XXXX-XXXX-XXXX-XXXXX into numeric Id</p> | ||
## convertNumberToNQTString(n) ⇒ | ||
<p>Helper method to Number to String(8 decimals) representation</p> | ||
**Kind**: global function | ||
**Returns**: <p>a NQT number string</p> | ||
| Param | Description | | ||
| --- | --- | | ||
| address | <p>The BURST address</p> | | ||
| n | <p>the number</p> | | ||
<a name="encode"></a> | ||
<a name="convertNumericIdToAddress"></a> | ||
## encode(numericId) | ||
## convertNumericIdToAddress(numericId) ⇒ | ||
<p>Encode a numeric id into BURST-XXXX-XXXX-XXXX-XXXXX</p> | ||
**Kind**: global function | ||
**Returns**: <p>the BURST address in Reed-Solomon encoding, or undefined if passed null, undefined</p> | ||
@@ -117,23 +159,13 @@ | Param | Description | | ||
<a name="isBurstAddress"></a> | ||
## isBurstAddress(address) | ||
<p>Validation Check. Quick validation of Burst addresses included</p> | ||
**Kind**: global function | ||
| Param | Description | | ||
| --- | --- | | ||
| address | <p>Burst Address</p> | | ||
<a name="isValid"></a> | ||
## isValid(address) | ||
## isValid(address) ⇒ <code>boolean</code> | ||
<p>Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)</p> | ||
**Kind**: global function | ||
**Returns**: <code>boolean</code> - <p>true, if is a valid address, else false</p> | ||
| Param | Description | | ||
| --- | --- | | ||
| address | <p>The address</p> | | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| address | <code>string</code> | <p>The address</p> | | ||
@@ -140,0 +172,0 @@ <a name="splitBurstAddress"></a> |
@@ -1,2 +0,2 @@ | ||
// @todo review the need of this function...IMHO too trivial | ||
/** @module util */ | ||
@@ -3,0 +3,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
/** @module util */ | ||
// tslint:disable:no-bitwise | ||
@@ -2,0 +3,0 @@ |
@@ -0,1 +1,3 @@ | ||
/** @module util */ | ||
/** | ||
@@ -2,0 +4,0 @@ * Original work Copyright (c) 2018 PoC-Consortium |
@@ -0,1 +1,3 @@ | ||
/** @module util */ | ||
/** | ||
@@ -2,0 +4,0 @@ * Original work Copyright (c) 2018 PoC-Consortium |
// tslint:disable:no-bitwise | ||
/** @module util */ | ||
@@ -3,0 +4,0 @@ /** |
@@ -10,7 +10,7 @@ /** @module util */ | ||
/** | ||
* A useful regex for matching burst addresses | ||
*/ | ||
/** | ||
* A useful regex for matching burst addresses | ||
*/ | ||
export const burstAddressPattern = { | ||
'_': { pattern: new RegExp('\[a-zA-Z0-9\]') } | ||
'_': {pattern: new RegExp('\[a-zA-Z0-9\]')} | ||
}; |
@@ -0,3 +1,6 @@ | ||
/** @ignore */ | ||
/** @module util */ | ||
// tslint:disable:max-line-length | ||
/** | ||
/* | ||
* Original work Copyright (c) 2018 PoC-Consortium | ||
@@ -7,2 +10,3 @@ * Modified work Copyright (c) 2019 Burst Apps Team | ||
// Internal helper functions and structures | ||
@@ -9,0 +13,0 @@ |
// tslint:disable:no-bitwise | ||
/** @module util */ | ||
/** | ||
@@ -4,0 +4,0 @@ * Original work Copyright (c) 2018 PoC-Consortium |
@@ -0,1 +1,3 @@ | ||
/** @module util */ | ||
/** | ||
@@ -2,0 +4,0 @@ * Original work Copyright (c) 2018 PoC-Consortium |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
43008
48
737
176
0