@onflow/util-address
Advanced tools
Comparing version 1.2.0-alpha.0 to 1.2.0
@@ -9,7 +9,8 @@ { | ||
"extends": [ | ||
"plugin:jsdoc/recommended" | ||
"plugin:jsdoc/recommended-typescript", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"plugins": [ | ||
"jsdoc" | ||
], | ||
"plugins": ["jsdoc", "@typescript-eslint"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
@@ -21,9 +22,4 @@ "ecmaVersion": "latest", | ||
"rules": { | ||
"jsdoc/require-jsdoc": [ | ||
"error", | ||
{ | ||
"publicOnly": true | ||
} | ||
] | ||
"@typescript-eslint/no-explicit-any": "off" | ||
} | ||
} | ||
} |
# @onflow/util-address | ||
## 1.2.0 | ||
### Minor Changes | ||
- [#1728](https://github.com/onflow/fcl-js/pull/1728) [`a4f8c00c`](https://github.com/onflow/fcl-js/commit/a4f8c00c4cf292d3a4afac610dedbc89ff3affea) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build | ||
- [#1750](https://github.com/onflow/fcl-js/pull/1750) [`845ffa75`](https://github.com/onflow/fcl-js/commit/845ffa756e07188557d150cdb9ff7af59019a477) Thanks [@jribbink](https://github.com/jribbink)! - Convert to Typescript | ||
## 1.2.0-alpha.0 | ||
@@ -4,0 +12,0 @@ |
@@ -7,27 +7,27 @@ 'use strict'; | ||
* @description Removes 0x from address if present | ||
* @param {string} address - Flow address | ||
* @returns {string} - Flow address without 0x prefix | ||
* @param address - Flow address | ||
* @returns Flow address without 0x prefix | ||
*/ | ||
function sansPrefix(address) { | ||
if (address == null) | ||
return null; | ||
return address.replace(/^0x/, "").replace(/^Fx/, ""); | ||
if (address == null) return null; | ||
return address.replace(/^0x/, "").replace(/^Fx/, ""); | ||
} | ||
/** | ||
* @description Adds 0x to address if not already present | ||
* @param {string} address - Flow address | ||
* @returns {string} - Flow address with 0x prefix | ||
* @param address - Flow address | ||
* @returns Flow address with 0x prefix | ||
*/ | ||
function withPrefix(address) { | ||
if (address == null) | ||
return null; | ||
return "0x" + sansPrefix(address); | ||
if (address == null) return null; | ||
return "0x" + sansPrefix(address); | ||
} | ||
/** | ||
* @description Adds 0x to address if not already present | ||
* @param {string} address - Flow address | ||
* @returns {string} - Flow address with 0x prefix | ||
* @param address - Flow address | ||
* @returns Flow address with 0x prefix | ||
*/ | ||
function display(address) { | ||
return withPrefix(address); | ||
return withPrefix(address); | ||
} | ||
@@ -34,0 +34,0 @@ |
/** | ||
* @description Removes 0x from address if present | ||
* @param {string} address - Flow address | ||
* @returns {string} - Flow address without 0x prefix | ||
* @param address - Flow address | ||
* @returns Flow address without 0x prefix | ||
*/ | ||
function sansPrefix(address) { | ||
if (address == null) | ||
return null; | ||
return address.replace(/^0x/, "").replace(/^Fx/, ""); | ||
if (address == null) return null; | ||
return address.replace(/^0x/, "").replace(/^Fx/, ""); | ||
} | ||
/** | ||
* @description Adds 0x to address if not already present | ||
* @param {string} address - Flow address | ||
* @returns {string} - Flow address with 0x prefix | ||
* @param address - Flow address | ||
* @returns Flow address with 0x prefix | ||
*/ | ||
function withPrefix(address) { | ||
if (address == null) | ||
return null; | ||
return "0x" + sansPrefix(address); | ||
if (address == null) return null; | ||
return "0x" + sansPrefix(address); | ||
} | ||
/** | ||
* @description Adds 0x to address if not already present | ||
* @param {string} address - Flow address | ||
* @returns {string} - Flow address with 0x prefix | ||
* @param address - Flow address | ||
* @returns Flow address with 0x prefix | ||
*/ | ||
function display(address) { | ||
return withPrefix(address); | ||
return withPrefix(address); | ||
} | ||
@@ -29,0 +29,0 @@ |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["onflowUtil-address"] = {})); | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["onflowUtil-address"] = {})); | ||
})(this, (function (exports) { 'use strict'; | ||
/** | ||
* @description Removes 0x from address if present | ||
* @param {string} address - Flow address | ||
* @returns {string} - Flow address without 0x prefix | ||
*/ | ||
function sansPrefix(address) { | ||
if (address == null) | ||
return null; | ||
return address.replace(/^0x/, "").replace(/^Fx/, ""); | ||
} | ||
/** | ||
* @description Adds 0x to address if not already present | ||
* @param {string} address - Flow address | ||
* @returns {string} - Flow address with 0x prefix | ||
*/ | ||
function withPrefix(address) { | ||
if (address == null) | ||
return null; | ||
return "0x" + sansPrefix(address); | ||
} | ||
/** | ||
* @description Adds 0x to address if not already present | ||
* @param {string} address - Flow address | ||
* @returns {string} - Flow address with 0x prefix | ||
*/ | ||
function display(address) { | ||
return withPrefix(address); | ||
} | ||
/** | ||
* @description Removes 0x from address if present | ||
* @param address - Flow address | ||
* @returns Flow address without 0x prefix | ||
*/ | ||
function sansPrefix(address) { | ||
if (address == null) return null; | ||
return address.replace(/^0x/, "").replace(/^Fx/, ""); | ||
} | ||
exports.display = display; | ||
exports.sansPrefix = sansPrefix; | ||
exports.withPrefix = withPrefix; | ||
/** | ||
* @description Adds 0x to address if not already present | ||
* @param address - Flow address | ||
* @returns Flow address with 0x prefix | ||
*/ | ||
function withPrefix(address) { | ||
if (address == null) return null; | ||
return "0x" + sansPrefix(address); | ||
} | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
/** | ||
* @description Adds 0x to address if not already present | ||
* @param address - Flow address | ||
* @returns Flow address with 0x prefix | ||
*/ | ||
function display(address) { | ||
return withPrefix(address); | ||
} | ||
exports.display = display; | ||
exports.sansPrefix = sansPrefix; | ||
exports.withPrefix = withPrefix; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
})); | ||
//# sourceMappingURL=util-address.umd.js.map |
{ | ||
"name": "@onflow/util-address", | ||
"version": "1.2.0-alpha.0", | ||
"version": "1.2.0", | ||
"description": "Flow JS SDK Util -- Address", | ||
@@ -16,7 +16,11 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"@onflow/fcl-bundle": "^1.4.0-alpha.0", | ||
"@onflow/types": "^1.2.0-alpha.0", | ||
"@babel/preset-typescript": "^7.22.5", | ||
"@onflow/fcl-bundle": "^1.4.0", | ||
"@onflow/types": "^1.2.0", | ||
"@types/jest": "^29.5.3", | ||
"@types/node": "^18.13.0", | ||
"eslint": "^8.33.0", | ||
"eslint-plugin-jsdoc": "^39.7.5", | ||
"@typescript-eslint/eslint-plugin": "^6.4.0", | ||
"@typescript-eslint/parser": "^6.4.0", | ||
"eslint": "^8.47.0", | ||
"eslint-plugin-jsdoc": "^46.4.6", | ||
"jest": "^29.5.0", | ||
@@ -29,3 +33,3 @@ "typescript": "^4.9.5" | ||
"unpkg": "dist/util-address.umd.js", | ||
"types": "dist/types/index.d.ts", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
@@ -32,0 +36,0 @@ "prepublishOnly": "npm test && npm run build", |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
18454
16
184
0
0
11