byte-encoder
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -158,3 +158,7 @@ | ||
constructor () { | ||
static encode (string = '') { | ||
return new ByteView(new ByteEncoderIterator(string)) | ||
} | ||
constructor (string) { | ||
this.#encoding = 'utf-8' | ||
@@ -161,0 +165,0 @@ } |
{ | ||
"name": "byte-encoder", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Encode data to utf8 bytes. Browser or NodeJS.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -47,2 +47,14 @@ | ||
### static (method) `ByteEncoder.encode`: | ||
Args [`string: string`] | ||
```js | ||
import ByteEncoder from 'byte-encoder' | ||
console.log(ByteEncoder.encode('Hello World!')) | ||
// prints: ByteView(12) [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33] | ||
``` | ||
### (method) `ByteEncoder.encode`: | ||
@@ -49,0 +61,0 @@ |
@@ -6,3 +6,3 @@ | ||
export class ByteEncoderIterator { | ||
declare class ByteEncoderIterator { | ||
#string: string | ||
@@ -9,0 +9,0 @@ #units: number |
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
10035
210
92