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

pinia-plugin-persist-uni

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pinia-plugin-persist-uni - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

2

dist/index.d.ts

@@ -13,3 +13,2 @@ import { PiniaPluginContext } from 'pinia';

}
declare type Store = PiniaPluginContext['store'];
declare module 'pinia' {

@@ -20,4 +19,3 @@ interface DefineStoreOptionsBase<S, Store> {

}
export declare const updateStorage: (strategy: PersistStrategy, store: Store) => void;
declare const _default: ({ options, store }: PiniaPluginContext) => void;
export default _default;

4

dist/pinia-persist-uni.es.js

@@ -1,2 +0,2 @@

const isH5 = window;
const isH5 = !!alert;
const updateStorage = (strategy, store) => {

@@ -53,2 +53,2 @@ const storage = strategy.storage;

};
export { index as default, updateStorage };
export { index as default };

@@ -1,1 +0,1 @@

(function(s,i){typeof exports=="object"&&typeof module!="undefined"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(s=typeof globalThis!="undefined"?globalThis:s||self,i(s.piniaPersist={}))})(this,function(s){"use strict";const i=window,g=(e,t)=>{const a=e.storage,n=e.key||t.$id;if(e.paths){const r=e.paths.reduce((d,o)=>(d[o]=t.$state[o],d),{});i&&a?a.setItem(n,JSON.stringify(r)):uni.setStorage({key:n,data:JSON.stringify(r)})}else i&&a?a.setItem(n,JSON.stringify(t.$state)):uni.setStorage({key:n,data:JSON.stringify(t.$state)})};var h=({options:e,store:t})=>{var a,n,r,d,o,c;if((a=e.persist)!=null&&a.enabled){const y=[{key:t.$id,storage:((n=e.persist)==null?void 0:n.H5Storage)||(window==null?void 0:window.sessionStorage)}],S=(d=(r=e.persist)==null?void 0:r.strategies)!=null&&d.length?(o=e.persist)==null?void 0:o.strategies:y;S.forEach(f=>{var p;const $=f.storage||((p=e.persist)==null?void 0:p.H5Storage)||(window==null?void 0:window.sessionStorage),l=f.key||t.$id;let u;i?u=$.getItem(l):u=uni.getStorageSync(l),u&&(t.$patch(JSON.parse(u)),g(f,t))}),t.$subscribe(()=>{S.forEach(f=>{g(f,t)})},{detached:!!((c=e.persist)!=null&&c.detached)})}};s.default=h,s.updateStorage=g,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
(function(s,n){typeof exports=="object"&&typeof module!="undefined"?module.exports=n():typeof define=="function"&&define.amd?define(n):(s=typeof globalThis!="undefined"?globalThis:s||self,s.piniaPersist=n())})(this,function(){"use strict";const s=!!alert,n=(e,t)=>{const i=e.storage,a=e.key||t.$id;if(e.paths){const r=e.paths.reduce((d,f)=>(d[f]=t.$state[f],d),{});s&&i?i.setItem(a,JSON.stringify(r)):uni.setStorage({key:a,data:JSON.stringify(r)})}else s&&i?i.setItem(a,JSON.stringify(t.$state)):uni.setStorage({key:a,data:JSON.stringify(t.$state)})};var p=({options:e,store:t})=>{var i,a,r,d,f,g;if((i=e.persist)!=null&&i.enabled){const h=[{key:t.$id,storage:((a=e.persist)==null?void 0:a.H5Storage)||(window==null?void 0:window.sessionStorage)}],u=(d=(r=e.persist)==null?void 0:r.strategies)!=null&&d.length?(f=e.persist)==null?void 0:f.strategies:h;u.forEach(o=>{var l;const y=o.storage||((l=e.persist)==null?void 0:l.H5Storage)||(window==null?void 0:window.sessionStorage),S=o.key||t.$id;let c;s?c=y.getItem(S):c=uni.getStorageSync(S),c&&(t.$patch(JSON.parse(c)),n(o,t))}),t.$subscribe(()=>{u.forEach(o=>{n(o,t)})},{detached:!!((g=e.persist)!=null&&g.detached)})}};return p});
{
"name": "pinia-plugin-persist-uni",
"version": "1.1.3",
"version": "1.1.4",
"repository": {

@@ -14,3 +14,3 @@ "type": "git",

"p": "git add . && git commit -m 'update' && git push",
"n": "npm version patch && git push && git push origin --tags"
"v": "npm version patch && git push && git push origin --tags"
},

@@ -17,0 +17,0 @@ "files": [

@@ -1,9 +0,9 @@

---
theme: channing-cyan
highlight: atom-one-dark
---
# pinia-plugin-persist-uni
[![NPM version](https://img.shields.io/npm/v/pinia-plugin-persist-uni?color=a1b858&label=)](https://www.npmjs.com/package/pinia-plugin-persist-uni)
[![NPM downloads](https://img.shields.io/npm/dm/pinia-plugin-persist-uni.svg?style=flat)](https://npmjs.com/package/pinia-plugin-persist-uni)
# 前言
> 尤雨溪在 3 月 24 日晚与掘金合作的直播[链接](https://live.juejin.cn/4354/vue3)中提到,pinia 就是实际上的 vuex5,作为新一代的状态管理器,更友好的 ts 支持,更轻量的打包体积,更简化的模块管理,无疑会在将来的市场中备受欢迎。
> 尤雨溪在 3 月 24 日晚与掘金合作的直播中提到[传送门](https://live.juejin.cn/4354/vue3),pinia 就是实际上的 vuex5,作为新一代的状态管理器,更友好的 ts 支持,更轻量的打包体积,更简化的模块管理,无疑会在将来的市场中备受欢迎。

@@ -103,4 +103,10 @@ pinia 的优点相比也不用多说了,但也正是由于其处于一个新生的阶段,周边生态还不够完善,在本人搭建项目的过程中便遇到了 pinia 在 uniapp 中数据持久化的问题。

目前源码已发布至 github,详情见 [源码地址](https://github.com/Allen-1998/pinia-plugin-persist-uni) [说明文档](https://allen-1998.github.io/pinia-plugin-persist-uni/) [使用案例](https://github.com/Allen-1998/uni-vue3-vite-ts-pinia),对你有帮助或者喜欢的话请点个 Star。
## 相关内容
- [掘金文章](https://juejin.cn/post/7081275565008748552)
- [说明文档](https://allen-1998.github.io/pinia-plugin-persist-uni/)
- [使用案例](https://github.com/Allen-1998/uni-vue3-vite-ts-pinia)
对你有帮助或者喜欢的话请点个 Star。
## 参考

@@ -107,0 +113,0 @@

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