New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@audiowalk/sdk

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@audiowalk/sdk - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

dist/story/story-controller.d.ts

1

dist/index.d.ts
export * from "./player/player-controller";
export * from "./storage/local-storage";
export * from "./story/story-controller";
//# sourceMappingURL=index.d.ts.map
export * from "./player/player-controller";
export * from "./storage/local-storage";
export * from "./story/story-controller";

4

dist/player/player-controller.js

@@ -82,5 +82,5 @@ import { BehaviorSubject, combineLatest, map, Subject } from "rxjs";

this.playerElement.src = file;
const position = await this.localStorage.get(`progress-${this.playerElement.src}`);
const position = await this.localStorage.get(`progress-${this.playerElement.src}`, (value) => typeof value === "number");
if (position && this.options.autoSave)
this.playerElement.currentTime = parseFloat(position);
this.playerElement.currentTime = position;
if (this.options.playOnInit)

@@ -87,0 +87,0 @@ await this.playerElement.play();

@@ -7,6 +7,7 @@ export interface LocalStorageOptions {

constructor(options?: Partial<LocalStorageOptions>);
get(key: string): Promise<string | null>;
get<T = unknown>(key: string, validate?: (value: unknown) => value is T): Promise<T | null>;
set(key: string, value: any): Promise<void>;
private parseData;
private getPrefixedKey;
}
//# sourceMappingURL=local-storage.d.ts.map

@@ -6,8 +6,31 @@ export class LocalStorage {

}
async get(key) {
return window.localStorage.getItem(this.getPrefixedKey(key));
async get(key, validate) {
const data = window.localStorage.getItem(this.getPrefixedKey(key));
if (data === null)
return null;
const value = this.parseData(data);
if (typeof validate === "function") {
if (validate(value)) {
return this.parseData(data);
}
else {
return null;
}
}
else {
return value;
}
}
async set(key, value) {
return window.localStorage.setItem(this.getPrefixedKey(key), value);
const data = JSON.stringify(value);
return window.localStorage.setItem(this.getPrefixedKey(key), data);
}
parseData(data) {
try {
return JSON.parse(data);
}
catch (e) {
return data;
}
}
getPrefixedKey(key) {

@@ -14,0 +37,0 @@ const keyParts = ["audiowalk"];

{
"name": "@audiowalk/sdk",
"version": "1.3.0",
"version": "1.3.1",
"repository": {

@@ -15,4 +15,5 @@ "type": "git",

"scripts": {
"dev": "tsc -w",
"dev": "npm run build:watch",
"build": "tsc",
"build:watch": "tsc -w",
"prepublishOnly": "npm run build",

@@ -19,0 +20,0 @@ "release:patch": "git switch master && npm version patch && git switch release && git merge master --ff-only && git push --follow-tags && git switch master && git push",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc