BREAKING CHANGE(core): switch to esm
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import * as plugins from './levelcache.plugins';
|
||||
import * as plugins from './levelcache.plugins.js';
|
||||
|
||||
export interface ICacheEntryConstructorOptions {
|
||||
key?: string;
|
||||
@@ -12,7 +12,8 @@ export interface ICacheEntryConstructorOptions {
|
||||
*/
|
||||
export class CacheEntry
|
||||
extends plugins.smartjson.Smartjson
|
||||
implements ICacheEntryConstructorOptions {
|
||||
implements ICacheEntryConstructorOptions
|
||||
{
|
||||
public static fromStorageJsonString(storageJsonString: string) {
|
||||
return new CacheEntry(plugins.smartjson.parse(storageJsonString));
|
||||
}
|
||||
@@ -23,15 +24,15 @@ export class CacheEntry
|
||||
@plugins.smartjson.foldDec()
|
||||
public ttl: number;
|
||||
|
||||
@plugins.smartjson.foldDec()
|
||||
public createdAt: number;
|
||||
|
||||
@plugins.smartjson.foldDec()
|
||||
public typeInfo: string;
|
||||
|
||||
@plugins.smartjson.foldDec()
|
||||
contents: Buffer;
|
||||
|
||||
@plugins.smartjson.foldDec()
|
||||
public createdAt: number;
|
||||
|
||||
public toStorageJsonString(): string {
|
||||
return this.foldToJson();
|
||||
}
|
||||
|
Reference in New Issue
Block a user