Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@onflow/util-address

Package Overview
Dependencies
Maintainers
12
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onflow/util-address - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0-alpha.0

dist/types/index.d.ts

6

CHANGELOG.md
# @onflow/util-address
## 1.2.0-alpha.0
### Minor Changes
- TS build
## 1.1.0

@@ -4,0 +10,0 @@

14

dist/util-address.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc