mobiletto 1.1.12 → 1.1.15
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/drivers/b2/index.js +1 -0
- package/drivers/s3/index.js +2 -1
- package/package.json +1 -1
- package/test/api.spec.js +1 -0
- package/util/logger.js +1 -1
- package/util/redis.js +1 -1
package/drivers/b2/index.js
CHANGED
package/drivers/s3/index.js
CHANGED
|
@@ -181,7 +181,8 @@ class StorageClient {
|
|
|
181
181
|
const head = await this.client.send(new HeadObjectCommand(bucketParams))
|
|
182
182
|
const meta = {
|
|
183
183
|
name: this.stripPrefix(path),
|
|
184
|
-
size: head.ContentLength
|
|
184
|
+
size: head.ContentLength,
|
|
185
|
+
type: path.endsWith(this.delimiter) ? M_DIR : M_FILE
|
|
185
186
|
}
|
|
186
187
|
if (head.LastModified) {
|
|
187
188
|
meta.mtime = Date.parse(head.LastModified)
|
package/package.json
CHANGED
package/test/api.spec.js
CHANGED
|
@@ -62,6 +62,7 @@ async function assertMeta (api, name, expectedSize) {
|
|
|
62
62
|
should().exist(meta, 'expected return value from metadata call')
|
|
63
63
|
expect(meta.name).equals(name, 'expected name of written file to be correct')
|
|
64
64
|
expect(meta.size).equals(expectedSize, 'expected size of written file to equal size of randomData')
|
|
65
|
+
expect(meta.mtime).is.greaterThan(0, 'expected mtime of written file to be > 0')
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
async function assertMetaFail (api, name) {
|
package/util/logger.js
CHANGED
|
@@ -2,7 +2,7 @@ const winston = require('winston')
|
|
|
2
2
|
|
|
3
3
|
const logger = winston.createLogger({
|
|
4
4
|
level: process.env.MOBILETTO_LOG_LEVEL || 'error',
|
|
5
|
-
format: winston.format.
|
|
5
|
+
format: winston.format.timestamp(),
|
|
6
6
|
transports: process.env.MOBILETTO_LOG_FILE
|
|
7
7
|
? [ new winston.transports.File({ filename: process.env.MOBILETTO_LOG_FILE }) ]
|
|
8
8
|
: [ new winston.transports.Console() ]
|
package/util/redis.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const Redis = require('ioredis')
|
|
2
2
|
const generators = require('redis-async-gen')
|
|
3
3
|
const { logger } = require('./logger')
|
|
4
|
-
const LRU = require(
|
|
4
|
+
const LRU = require('lru-cache')
|
|
5
5
|
|
|
6
6
|
const { DEFAULT_REDIS_OPTIONS } = require('ioredis/built/redis/RedisOptions')
|
|
7
7
|
|