Skip to content

Commit 2dba2c2

Browse files
authored
Merge pull request #3 from johantor/fix/underlying-filesystem
fix: underlying filesystem, linting and package updates
2 parents 8563d6f + e718d26 commit 2dba2c2

16 files changed

Lines changed: 4431 additions & 1051 deletions

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ${{ matrix.os }}
77
strategy:
88
matrix:
9-
node-version: [16.x]
9+
node-version: [22.x]
1010
os: [ubuntu-latest]
1111
steps:
1212
- uses: actions/checkout@v1

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v1
1313
- uses: actions/setup-node@v1
1414
with:
15-
node-version: 16
15+
node-version: 22
1616
- run: npm install
1717

1818
- name: Setup GIT

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": false,
7+
"printWidth": 80,
8+
"bracketSpacing": true,
9+
"objectWrap": "preserve"
10+
}

dist/StoreManager.d.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

dist/index.d.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
export { default as StoreManager } from './StoreManager';
1+
export declare class StoreManager {
2+
private prefix;
3+
constructor(_prefix?: string);
4+
private getStorageMedium;
5+
Has(key: string): boolean;
6+
Get(key: string): any;
7+
private toJSONIfJSON;
8+
Save(key: string, data: any, permanent?: boolean): void;
9+
Set(key: string, data: any, permanent?: boolean): boolean;
10+
Remove(key: string): void;
11+
}
12+
13+
export { }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var u = Object.defineProperty;
22
var c = (o, e, t) => e in o ? u(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3-
var f = (o, e, t) => (c(o, typeof e != "symbol" ? e + "" : e, t), t);
3+
var f = (o, e, t) => c(o, typeof e != "symbol" ? e + "" : e, t);
44
class g {
55
constructor(e = "cache") {
66
f(this, "prefix");

dist/index.umd.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(function(r,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(r=typeof globalThis<"u"?globalThis:r||self,t(r.storemanager={}))})(this,function(r){"use strict";var S=Object.defineProperty;var g=(r,t,f)=>t in r?S(r,t,{enumerable:!0,configurable:!0,writable:!0,value:f}):r[t]=f;var c=(r,t,f)=>g(r,typeof t!="symbol"?t+"":t,f);class t{constructor(e="cache"){c(this,"prefix");this.prefix=e}getStorageMedium(e=!0){return typeof window>"u"||typeof window.localStorage>"u"?null:e?window.localStorage:window.sessionStorage}Has(e){return typeof this.Get(`${this.prefix}-${e}`)<"u"}Get(e){const i=this.getStorageMedium(!1),s=this.getStorageMedium(!0);let n=!1,o=null;if(i&&s){try{o=i.getItem(`${this.prefix}-${e}`),o=this.toJSONIfJSON(o),n=o!==null}catch{}if(!n)try{o=s.getItem(`${this.prefix}-${e}`),o=this.toJSONIfJSON(o),n=o!==null}catch{}}return o}toJSONIfJSON(e){return typeof e=="string"&&(e.indexOf("{")===0||e.indexOf("[")===0)&&(e=JSON.parse(e)),e}Save(e,i,s=!0){console.warn("StoreManager.Save is deprecated"),this.Set(e,i,s)}Set(e,i,s=!0){const n=this.getStorageMedium(s);let o=!1;if(n){typeof i=="object"&&(i=JSON.stringify(i));try{n.setItem(`${this.prefix}-${e}`,i),o=!0}catch(u){console.error("Unable to save object",u)}}return o}Remove(e){const i=this.getStorageMedium(!0),s=this.getStorageMedium(!1);i&&i.removeItem(`${this.prefix}-${e}`),s&&s.removeItem(`${this.prefix}-${e}`)}}r.StoreManager=t,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});

dist/storemanager.umd.cjs

Lines changed: 0 additions & 1 deletion
This file was deleted.

eslint.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import eslint from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
import { globalIgnores } from "eslint/config";
4+
5+
export default tseslint.config(
6+
globalIgnores(
7+
["dist/**/*", "scripts/**/*"],
8+
"Ignore build and scripts directory",
9+
),
10+
eslint.configs.recommended,
11+
tseslint.configs.strict,
12+
tseslint.configs.stylistic,
13+
);

0 commit comments

Comments
 (0)