Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: supertokens/browser-tabs-lock
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.15
Choose a base ref
...
head repository: supertokens/browser-tabs-lock
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.3.0
Choose a head ref
  • 3 commits
  • 8 files changed
  • 1 contributor

Commits on Apr 25, 2023

  1. initial impl

    rishabhpoddar committed Apr 25, 2023
    Copy the full SHA
    b8b90fe View commit details
  2. fixes bug

    rishabhpoddar committed Apr 25, 2023
    Copy the full SHA
    215fee4 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ce35f6c View commit details
Showing with 6,830 additions and 109 deletions.
  1. +3 −0 CHANGELOG.md
  2. +1 −1 bundle/bundle.js
  3. +17 −1 index.d.ts
  4. +87 −33 index.js
  5. +92 −30 index.ts
  6. +6,607 −21 package-lock.json
  7. +1 −1 package.json
  8. +22 −22 test/index.test.js
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.0] - 2023-04-25
- Allows passing of custom storage handler which can be used to override the fact that this lib writes to localstorage

## [1.2.15] - 2021-08-09

### Changed
2 changes: 1 addition & 1 deletion bundle/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
export declare type StorageHandler = {
key: (index: number) => Promise<string | null>;
getItem: (key: string) => Promise<string | null>;
clear: () => Promise<void>;
removeItem: (key: string) => Promise<void>;
setItem: (key: string, value: string) => Promise<void>;
/**
* Sync versions of the storage functions
*/
keySync: (index: number) => string | null;
getItemSync: (key: string) => string | null;
clearSync: () => void;
removeItemSync: (key: string) => void;
setItemSync: (key: string, value: string) => void;
};
export default class SuperTokensLock {
private static waiters;
private id;
private acquiredIatSet;
constructor();
private storageHandler;
constructor(storageHandler?: StorageHandler);
/**
* @async
* @memberOf Lock
Loading