@rarible/types
Advanced tools
Comparing version 0.1.3 to 0.1.4
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.randomAddress = exports.ZERO_ADDRESS = exports.toAddress = void 0; | ||
const binary_1 = require("./binary"); | ||
var binary_1 = require("./binary"); | ||
function toAddress(value) { | ||
let hex; | ||
var hex; | ||
if (value.startsWith("0x")) { | ||
@@ -13,8 +13,8 @@ hex = value.substring(2).toLowerCase(); | ||
} | ||
const re = /[0-9a-f]{40}/g; | ||
var re = /[0-9a-f]{40}/g; | ||
if (re.test(hex)) { | ||
return `0x${hex}`; | ||
return "0x" + hex; | ||
} | ||
else { | ||
throw new Error(`not an address: ${value}`); | ||
throw new Error("not an address: " + value); | ||
} | ||
@@ -21,0 +21,0 @@ } |
@@ -5,3 +5,3 @@ "use strict"; | ||
function toBinary(value) { | ||
let hex; | ||
var hex; | ||
if (value.startsWith("0x")) { | ||
@@ -13,8 +13,8 @@ hex = value.substring(2).toLowerCase(); | ||
} | ||
const re = /[0-9a-f]*/g; | ||
var re = /[0-9a-f]*/g; | ||
if (re.test(hex)) { | ||
return `0x${hex}`; | ||
return "0x" + hex; | ||
} | ||
else { | ||
throw new Error(`not a binary: ${value}`); | ||
throw new Error("not a binary: " + value); | ||
} | ||
@@ -24,6 +24,6 @@ } | ||
function randomBinary(size) { | ||
return `0x${Array.from(Array(size * 2)) | ||
.map(() => Math.floor(Math.random() * 16).toString(16)) | ||
.join("")}`; | ||
return "0x" + Array.from(Array(size * 2)) | ||
.map(function () { return Math.floor(Math.random() * 16).toString(16); }) | ||
.join(""); | ||
} | ||
exports.randomBinary = randomBinary; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./address"), exports); | ||
__exportStar(require("./word"), exports); | ||
__exportStar(require("./binary"), exports); | ||
__exportStar(require("./big-number"), exports); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./address"), exports); | ||
tslib_1.__exportStar(require("./word"), exports); | ||
tslib_1.__exportStar(require("./binary"), exports); | ||
tslib_1.__exportStar(require("./big-number"), exports); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.randomWord = exports.ZERO_WORD = exports.toWord = void 0; | ||
const binary_1 = require("./binary"); | ||
var binary_1 = require("./binary"); | ||
function toWord(value) { | ||
let hex; | ||
var hex; | ||
if (value.startsWith("0x")) { | ||
@@ -13,8 +13,8 @@ hex = value.substring(2).toLowerCase(); | ||
} | ||
const re = /[0-9a-f]{64}/g; | ||
var re = /[0-9a-f]{64}/g; | ||
if (re.test(hex)) { | ||
return `0x${hex}`; | ||
return "0x" + hex; | ||
} | ||
else { | ||
throw new Error(`not a word: ${value}`); | ||
throw new Error("not a word: " + value); | ||
} | ||
@@ -21,0 +21,0 @@ } |
{ | ||
"name": "@rarible/types", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"keywords": [ | ||
"rarible", | ||
"common", | ||
"types" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/rariblecom/ts-common.git" | ||
}, | ||
"license": "Apache-2.0", | ||
"main": "build/index.js", | ||
@@ -9,7 +19,2 @@ "types": "build/index.d.ts", | ||
], | ||
"keywords": [ | ||
"rarible", | ||
"common", | ||
"types" | ||
], | ||
"scripts": { | ||
@@ -21,10 +26,2 @@ "build": "tsc --project tsconfig-build.json", | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"license": "Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/rariblecom/ts-common.git" | ||
}, | ||
"devDependencies": { | ||
@@ -37,3 +34,9 @@ "@types/jest": "26.0.24", | ||
}, | ||
"gitHead": "c576463677c8d48dc202f2bee98ba5ec1e3d634c" | ||
"peerDependencies": { | ||
"tslib": "^2.3.1" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"gitHead": "8efd8e0c14342870b28bfbca5ee620031472ec48" | ||
} |
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
23621
1
7
93