@zenfs/core
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -90,2 +90,3 @@ import { dirname, resolve } from './emulation/path.js'; | ||
export const setImmediate = typeof globalThis.setImmediate == 'function' ? globalThis.setImmediate : (cb) => setTimeout(cb, 0); | ||
const encoder = new TextEncoder(); | ||
/** | ||
@@ -99,4 +100,5 @@ * Encodes a string into a buffer | ||
} | ||
return new Uint8Array(Array.from(input).map(char => char.charCodeAt(0))); | ||
return encoder.encode(input); | ||
} | ||
const decoder = new TextDecoder(); | ||
/** | ||
@@ -110,5 +112,3 @@ * Decodes a string from a buffer | ||
} | ||
return Array.from(input) | ||
.map(char => String.fromCharCode(char)) | ||
.join(''); | ||
return decoder.decode(input); | ||
} | ||
@@ -115,0 +115,0 @@ /** |
{ | ||
"name": "@zenfs/core", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "A filesystem, anywhere", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -7,4 +7,2 @@ # ZenFS | ||
ZenFS is a fork of [BrowserFS](https://github.com/jvilk/BrowserFS). If you are using ZenFS in a research paper, you may want to [cite BrowserFS](https://github.com/jvilk/BrowserFS#citing). | ||
## Backends | ||
@@ -109,3 +107,3 @@ | ||
if (!exists) { | ||
await writeFile('/myfile.txt', 'Lots of persistant data'); | ||
await writeFile('/myfile.txt', 'Lots of persistent data'); | ||
} | ||
@@ -167,1 +165,5 @@ ``` | ||
Run unit tests with `npm test`. | ||
### BrowserFS Fork | ||
ZenFS is a fork of [BrowserFS](https://github.com/jvilk/BrowserFS). If you are using ZenFS in a research paper, you may want to [cite BrowserFS](https://github.com/jvilk/BrowserFS#citing). |
@@ -120,2 +120,4 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-return */ | ||
const encoder = new TextEncoder(); | ||
/** | ||
@@ -129,5 +131,7 @@ * Encodes a string into a buffer | ||
} | ||
return new Uint8Array(Array.from(input).map(char => char.charCodeAt(0))); | ||
return encoder.encode(input); | ||
} | ||
const decoder = new TextDecoder(); | ||
/** | ||
@@ -142,5 +146,3 @@ * Decodes a string from a buffer | ||
return Array.from(input) | ||
.map(char => String.fromCharCode(char)) | ||
.join(''); | ||
return decoder.decode(input); | ||
} | ||
@@ -147,0 +149,0 @@ |
Sorry, the diff of this file is too big to display
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
167
1982707