@xyo-network/data
Advanced tools
Comparing version 2.83.5 to 2.83.6
@@ -5,4 +5,3 @@ import { AbstractData } from './AbstractData'; | ||
private _length; | ||
constructor(length: number, bytes?: string | ArrayBuffer); | ||
constructor(length: number, bytes: string, base?: number); | ||
constructor(length: number, bytes: ArrayBuffer, base?: number); | ||
get base58(): string; | ||
@@ -12,6 +11,5 @@ get bytes(): ArrayBuffer; | ||
get keccak256(): Uint8Array; | ||
static from(data: string | ArrayBuffer | undefined): Data | undefined; | ||
static lengthOf(data: string | ArrayBuffer): number; | ||
static from(data: ArrayBuffer | undefined): Data | undefined; | ||
private checkLength; | ||
} | ||
//# sourceMappingURL=Data.d.ts.map |
@@ -40,13 +40,4 @@ // src/AbstractData.ts | ||
static from(data) { | ||
return data ? new _Data(_Data.lengthOf(data), data) : void 0; | ||
return data ? new _Data(data.byteLength, data) : void 0; | ||
} | ||
static lengthOf(data) { | ||
if (typeof data === "string") { | ||
return data.length / 2; | ||
} else if (data instanceof AbstractData) { | ||
return data.length; | ||
} else { | ||
return typeof data.byteLength === "function" ? data.byteLength : data.byteLength; | ||
} | ||
} | ||
checkLength() { | ||
@@ -53,0 +44,0 @@ assertEx(this.bytes.byteLength === this._length, `Length Mismatch: ${this.bytes.byteLength} !== ${this._length}`); |
@@ -5,4 +5,3 @@ import { AbstractData } from './AbstractData'; | ||
private _length; | ||
constructor(length: number, bytes?: string | ArrayBuffer); | ||
constructor(length: number, bytes: string, base?: number); | ||
constructor(length: number, bytes: ArrayBuffer, base?: number); | ||
get base58(): string; | ||
@@ -12,6 +11,5 @@ get bytes(): ArrayBuffer; | ||
get keccak256(): Uint8Array; | ||
static from(data: string | ArrayBuffer | undefined): Data | undefined; | ||
static lengthOf(data: string | ArrayBuffer): number; | ||
static from(data: ArrayBuffer | undefined): Data | undefined; | ||
private checkLength; | ||
} | ||
//# sourceMappingURL=Data.d.ts.map |
@@ -40,13 +40,4 @@ // src/AbstractData.ts | ||
static from(data) { | ||
return data ? new _Data(_Data.lengthOf(data), data) : void 0; | ||
return data ? new _Data(data.byteLength, data) : void 0; | ||
} | ||
static lengthOf(data) { | ||
if (typeof data === "string") { | ||
return data.length / 2; | ||
} else if (data instanceof AbstractData) { | ||
return data.length; | ||
} else { | ||
return typeof data.byteLength === "function" ? data.byteLength : data.byteLength; | ||
} | ||
} | ||
checkLength() { | ||
@@ -53,0 +44,0 @@ assertEx(this.bytes.byteLength === this._length, `Length Mismatch: ${this.bytes.byteLength} !== ${this._length}`); |
@@ -63,3 +63,3 @@ { | ||
"sideEffects": false, | ||
"version": "2.83.5" | ||
"version": "2.83.6" | ||
} |
@@ -13,5 +13,3 @@ /* eslint-disable import/no-deprecated */ | ||
constructor(length: number, bytes?: string | ArrayBuffer) | ||
constructor(length: number, bytes: string, base?: number) | ||
constructor(length: number, bytes?: string | ArrayBuffer, base?: number) { | ||
constructor(length: number, bytes: ArrayBuffer, base?: number) { | ||
super() | ||
@@ -41,16 +39,6 @@ this._bytes = toUint8Array(bytes, length, base) | ||
static from(data: string | ArrayBuffer | undefined) { | ||
return data ? new Data(Data.lengthOf(data), data) : undefined | ||
static from(data: ArrayBuffer | undefined) { | ||
return data ? new Data(data.byteLength, data) : undefined | ||
} | ||
static lengthOf(data: string | ArrayBuffer): number { | ||
if (typeof data === 'string') { | ||
return data.length / 2 | ||
} else if (data instanceof AbstractData) { | ||
return data.length | ||
} else { | ||
return typeof data.byteLength === 'function' ? data.byteLength : data.byteLength | ||
} | ||
} | ||
private checkLength() { | ||
@@ -57,0 +45,0 @@ assertEx(this.bytes.byteLength === this._length, `Length Mismatch: ${this.bytes.byteLength} !== ${this._length}`) |
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
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
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
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
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
0
75155
334