@onflow/util-address
Advanced tools
Comparing version 1.1.0 to 1.2.0-alpha.0
# @onflow/util-address | ||
## 1.2.0-alpha.0 | ||
### Minor Changes | ||
- TS build | ||
## 1.1.0 | ||
@@ -4,0 +10,0 @@ |
@@ -11,6 +11,6 @@ 'use strict'; | ||
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/, ""); | ||
} | ||
/** | ||
@@ -22,6 +22,6 @@ * @description Adds 0x to address if not already present | ||
function withPrefix(address) { | ||
if (address == null) return null; | ||
return "0x" + sansPrefix(address); | ||
if (address == null) | ||
return null; | ||
return "0x" + sansPrefix(address); | ||
} | ||
/** | ||
@@ -33,3 +33,3 @@ * @description Adds 0x to address if not already present | ||
function display(address) { | ||
return withPrefix(address); | ||
return withPrefix(address); | ||
} | ||
@@ -36,0 +36,0 @@ |
@@ -7,6 +7,6 @@ /** | ||
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/, ""); | ||
} | ||
/** | ||
@@ -18,6 +18,6 @@ * @description Adds 0x to address if not already present | ||
function withPrefix(address) { | ||
if (address == null) return null; | ||
return "0x" + sansPrefix(address); | ||
if (address == null) | ||
return null; | ||
return "0x" + sansPrefix(address); | ||
} | ||
/** | ||
@@ -29,3 +29,3 @@ * @description Adds 0x to address if not already present | ||
function display(address) { | ||
return withPrefix(address); | ||
return withPrefix(address); | ||
} | ||
@@ -32,0 +32,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 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 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); | ||
} | ||
exports.display = display; | ||
exports.sansPrefix = sansPrefix; | ||
exports.withPrefix = withPrefix; | ||
/** | ||
* @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); | ||
} | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
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.1.0", | ||
"version": "1.2.0-alpha.0", | ||
"description": "Flow JS SDK Util -- Address", | ||
@@ -16,4 +16,4 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"@onflow/fcl-bundle": "^1.3.0", | ||
"@onflow/types": "^1.1.0", | ||
"@onflow/fcl-bundle": "^1.4.0-alpha.0", | ||
"@onflow/types": "^1.2.0-alpha.0", | ||
"@types/node": "^18.13.0", | ||
@@ -25,7 +25,7 @@ "eslint": "^8.33.0", | ||
}, | ||
"source": "src/index.js", | ||
"source": "src/index.ts", | ||
"main": "dist/util-address.js", | ||
"module": "dist/util-address.module.js", | ||
"unpkg": "dist/util-address.umd.js", | ||
"types": "types/index.d.ts", | ||
"types": "dist/types/index.d.ts", | ||
"scripts": { | ||
@@ -35,3 +35,2 @@ "prepublishOnly": "npm test && npm run build", | ||
"build": "npm run lint && fcl-bundle", | ||
"build:types": "tsc", | ||
"test:watch": "jest --watch", | ||
@@ -38,0 +37,0 @@ "start": "fcl-bundle --watch", |
{ | ||
"extends": "../../tsconfig", | ||
// Change this to match your project | ||
"include": ["src/**/*"], | ||
"exclude": [ | ||
"src/**/*.test.js", | ||
], | ||
"compilerOptions": { | ||
"types" : ["node"], | ||
// Tells TypeScript to read JS files, as | ||
// normally they are ignored as source files | ||
"allowJs": true, | ||
// Generate d.ts files | ||
"declaration": true, | ||
// This compiler run should | ||
// only output d.ts files | ||
"emitDeclarationOnly": true, | ||
// Types should go into this directory. | ||
@@ -21,6 +10,3 @@ // Removing this would place the .d.ts files | ||
"outDir": "types", | ||
// go to js file when using IDE functions like | ||
// "Go to Definition" in VSCode | ||
"declarationMap": false, | ||
} | ||
} |
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
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
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
17190
15
175
1
1