diff --git a/.docs/How-To/05-Missing-Encryption-Behavior.md b/.docs/How-To/05-Missing-Encryption-Behavior.md index 839baab..5c4c10e 100644 --- a/.docs/How-To/05-Missing-Encryption-Behavior.md +++ b/.docs/How-To/05-Missing-Encryption-Behavior.md @@ -3,7 +3,7 @@ name: Change behavior with missing encryption order: 5 --- -# This article is not applicable anymore. (since v2.1.?) +# This article is not applicable anymore. (since v2.2.0) --- diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 913f30f..3c184b3 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -12,12 +12,11 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup node with version 16 - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: "16.x" - registry-url: "https://registry.npmjs.org" + node-version: 16 - name: Install dependencies run: npm ci - name: Run Lint @@ -26,12 +25,11 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup node with version 16 - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: "16.x" - registry-url: "https://registry.npmjs.org" + node-version: 16 - name: Install dependencies run: npm ci - name: Prepare test diff --git a/CHANGELOG.md b/CHANGELOG.md index b82d911..0d062d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fix class definition type not wide enough ([Issue#32]) + +### Changed + +- (dev) Update Github actions versions. + ## [2.2.0] ### Added @@ -160,4 +168,5 @@ First version [Issue#23]: https://github.com/MacFJA/svelte-persistent-store/issues/23 [Issue#26]: https://github.com/MacFJA/svelte-persistent-store/issues/26 [Issue#31]: https://github.com/MacFJA/svelte-persistent-store/issues/31 +[Issue#32]: https://github.com/MacFJA/svelte-persistent-store/issues/32 [PR#8]: https://github.com/MacFJA/svelte-persistent-store/pull/8 diff --git a/package-lock.json b/package-lock.json index b9b8049..49a6026 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "2.2.0", "license": "MIT", "dependencies": { - "@macfja/serializer": "^1.1.1", + "@macfja/serializer": "^1.1.2", "browser-cookies": "^1.2.0", "idb-keyval": "^5.1.3", "sjcl-codec-hex": "^1.0.0", @@ -2108,9 +2108,9 @@ } }, "node_modules/@macfja/serializer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@macfja/serializer/-/serializer-1.1.1.tgz", - "integrity": "sha512-kZ0fYQNpSfzpZIGZWcfd6KPXtLTjvYEGZux4etIJcg8N64CTYmDen+CJhqjQ2vUG3IAteOmIFystzKrtLjISbw==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@macfja/serializer/-/serializer-1.1.2.tgz", + "integrity": "sha512-kqEg3Zu5/g3ivdeb+jP4rBVVdmtKXVsRwH+x9KdM2Y7d2mKLq54g+YLSgTQ4KwJvWmyHFvRq0ouX5Dr4H1Hw3Q==" }, "node_modules/@miherlosev/esm": { "version": "3.2.26", @@ -10523,9 +10523,9 @@ } }, "@macfja/serializer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@macfja/serializer/-/serializer-1.1.1.tgz", - "integrity": "sha512-kZ0fYQNpSfzpZIGZWcfd6KPXtLTjvYEGZux4etIJcg8N64CTYmDen+CJhqjQ2vUG3IAteOmIFystzKrtLjISbw==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@macfja/serializer/-/serializer-1.1.2.tgz", + "integrity": "sha512-kqEg3Zu5/g3ivdeb+jP4rBVVdmtKXVsRwH+x9KdM2Y7d2mKLq54g+YLSgTQ4KwJvWmyHFvRq0ouX5Dr4H1Hw3Q==" }, "@miherlosev/esm": { "version": "3.2.26", diff --git a/package.json b/package.json index 8c14f9e..702ae64 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "README.md" ], "dependencies": { - "@macfja/serializer": "^1.1.1", + "@macfja/serializer": "^1.1.2", "browser-cookies": "^1.2.0", "idb-keyval": "^5.1.3", "sjcl-codec-hex": "^1.0.0", diff --git a/src/core.ts b/src/core.ts index d5630d8..de916fa 100644 --- a/src/core.ts +++ b/src/core.ts @@ -2,6 +2,7 @@ import { serialize as defaultSerializer, deserialize as defaultDeserializer, addGlobalAllowedClass, + type ClassDefinition, } from "@macfja/serializer" import { get as getCookie, set as setCookie, erase as removeCookie } from "browser-cookies" import { get, set, createStore, del } from "idb-keyval" @@ -48,7 +49,7 @@ const warnStorageNotFound = (storageName) => { * Add a class to the allowed list of classes to be serialized * @param classDef The class to add to the list */ -export const addSerializableClass = (classDef: FunctionConstructor): void => { +export const addSerializableClass = (classDef: ClassDefinition): void => { addSerializable(classDef) } @@ -68,7 +69,7 @@ export let serialize = defaultSerializer export let deserialize = defaultDeserializer /** * The function used to add a class in the serializer allowed class - * @type {(classConstructor: FunctionConstructor) => void} + * @type {(classConstructor: ClassDefinition) => void} */ let addSerializable = addGlobalAllowedClass @@ -76,12 +77,12 @@ let addSerializable = addGlobalAllowedClass * Set the serialization functions to use * @param {(data: any) => string} serializer The function to use to transform any data into a string * @param {(input: string) => any} deserializer The function to use to transform back string into the original data (reverse of the serializer) - * @param {(classConstructor: FunctionConstructor) => void} [addSerializableClass] The function to use to add a class in the serializer/deserializer allowed class + * @param {(classConstructor: ClassDefinition) => void} [addSerializableClass] The function to use to add a class in the serializer/deserializer allowed class */ export function setSerialization( serializer: (data: any) => string, deserializer: (input: string) => any, - addSerializableClass?: (classConstructor: FunctionConstructor) => void + addSerializableClass?: (classConstructor: ClassDefinition) => void ): void { serialize = serializer deserialize = deserializer