utilitas 1995.2.78 → 1995.2.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/manifest.mjs +1 -1
- package/lib/storage.mjs +3 -1
- package/package.json +1 -1
package/lib/manifest.mjs
CHANGED
package/lib/storage.mjs
CHANGED
|
@@ -21,6 +21,7 @@ const getIdByGs = gs => gs.replace(/^gs:\/\/[^/]*\/(.*)$/, '$1');
|
|
|
21
21
|
const mapFilename = name => join(name.substr(0, 2), name.substr(2, 2));
|
|
22
22
|
const [_zip, _unzip] = [__zip, __unzip].map(promisify);
|
|
23
23
|
const log = content => _log(content, import.meta.url);
|
|
24
|
+
const sanitizeFilename = (s, r) => s.replace(/[\/?<>\\:*|"]/g, r || '_').trim();
|
|
24
25
|
|
|
25
26
|
const [
|
|
26
27
|
NULL, BASE64, BUFFER, FILE, STREAM, TEXT, _JSON, encoding, BINARY, mode,
|
|
@@ -36,7 +37,7 @@ const [encodeBase64, encodeBinary, encodeNull]
|
|
|
36
37
|
let [client, bucket, url] = [null, null, null];
|
|
37
38
|
|
|
38
39
|
const readFile = async (name, options) => await fs.readFile(
|
|
39
|
-
name, [
|
|
40
|
+
name, [NULL, BUFFER].includes(
|
|
40
41
|
ensureString(options?.encoding, { case: 'UP' })
|
|
41
42
|
) ? null : (options?.encoding || encoding)
|
|
42
43
|
);
|
|
@@ -451,6 +452,7 @@ export {
|
|
|
451
452
|
mergeFile,
|
|
452
453
|
readFile,
|
|
453
454
|
readJson,
|
|
455
|
+
sanitizeFilename,
|
|
454
456
|
setConfig,
|
|
455
457
|
sliceFile,
|
|
456
458
|
touchPath,
|