@iota/converter
Advanced tools
Comparing version 1.0.0-beta.5 to 1.0.0-beta.6
"use strict"; | ||
exports.__esModule = true; | ||
var _1 = require("./"); | ||
var errors = require("./errors"); | ||
var _1 = require("./"); | ||
/** | ||
@@ -56,3 +56,3 @@ * Converts an ascii encoded string to trytes. | ||
trytes += _1.TRYTE_ALPHABET[dec % 27]; | ||
trytes += _1.TRYTE_ALPHABET[(dec - dec % 27) / 27]; | ||
trytes += _1.TRYTE_ALPHABET[(dec - (dec % 27)) / 27]; | ||
} | ||
@@ -59,0 +59,0 @@ return trytes; |
@@ -92,3 +92,3 @@ "use strict"; | ||
function trytes(trits) { | ||
if (!(trits instanceof Int8Array)) { | ||
if (!(trits instanceof Int8Array) && !Array.isArray(trits)) { | ||
throw new Error(errors.INVALID_TRITS); | ||
@@ -95,0 +95,0 @@ } |
"use strict"; | ||
exports.__esModule = true; | ||
var ava_1 = require("ava"); | ||
var src_1 = require("../src"); | ||
var errors_1 = require("../src/errors"); | ||
var src_1 = require("../src"); | ||
ava_1["default"]('asciiToTrytes()', function (t) { | ||
@@ -7,0 +7,0 @@ var ascii = 'IOTA'; |
"use strict"; | ||
exports.__esModule = true; | ||
var ava_1 = require("ava"); | ||
var src_1 = require("../src"); | ||
var errors = require("../src/errors"); | ||
var src_1 = require("../src"); | ||
var INVALID_ODD_LENGTH = errors.INVALID_ODD_LENGTH, INVALID_TRYTES = errors.INVALID_TRYTES; | ||
@@ -7,0 +7,0 @@ ava_1["default"]('trytesToAscii()', function (t) { |
{ | ||
"name": "@iota/converter", | ||
"version": "1.0.0-beta.5", | ||
"version": "1.0.0-beta.6", | ||
"description": "Convert values & trytes to trits and back", | ||
@@ -14,3 +14,3 @@ "main": "./out/src/index.js", | ||
"test-ci": "nyc ava", | ||
"format": "prettier", | ||
"lint": "tslint --project .", | ||
"docs": "tsc && jsdoc2md --no-cache --plugin dmd-clear -t README_tpl.hbs --files './out/**/*.js' > README.md" | ||
@@ -17,0 +17,0 @@ }, |
@@ -0,3 +1,3 @@ | ||
import { TRYTE_ALPHABET } from './' | ||
import * as errors from './errors' | ||
import { TRYTE_ALPHABET } from './' | ||
@@ -58,3 +58,3 @@ /** | ||
trytes += TRYTE_ALPHABET[dec % 27] | ||
trytes += TRYTE_ALPHABET[(dec - dec % 27) / 27] | ||
trytes += TRYTE_ALPHABET[(dec - (dec % 27)) / 27] | ||
} | ||
@@ -61,0 +61,0 @@ |
@@ -96,3 +96,3 @@ import * as errors from './errors' | ||
export function trytes(trits: Int8Array): string { | ||
if (!(trits instanceof Int8Array)) { | ||
if (!(trits instanceof Int8Array) && !Array.isArray(trits)) { | ||
throw new Error(errors.INVALID_TRITS) | ||
@@ -99,0 +99,0 @@ } |
import test from 'ava' | ||
import { asciiToTrytes } from '../src' | ||
import { INVALID_ASCII_CHARS } from '../src/errors' | ||
import { asciiToTrytes } from '../src' | ||
@@ -5,0 +5,0 @@ test('asciiToTrytes()', t => { |
import test from 'ava' | ||
import { trytesToAscii } from '../src' | ||
import * as errors from '../src/errors' | ||
import { trytesToAscii } from '../src' | ||
@@ -5,0 +5,0 @@ const { INVALID_ODD_LENGTH, INVALID_TRYTES } = errors |
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
36904
29
802