@protocol-launcher/shared 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 MichaelSun
3
+ Copyright (c) 2026 MichaelSun
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function n(n){return void 0===n}function e(n){return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,(n,e)=>String.fromCharCode(parseInt(e,16))))}function t(n,t={}){const{useSafeEncoding:o=!1}=t,r=JSON.stringify(n);let c;if(o)c=e(r);else try{c=btoa(r)}catch{c=e(r)}return encodeURIComponent(c)}export{t as encodeUrlPayload,n as isUndefined};
1
+ function n(n){return void 0===n}function t(n,t){return t?encodeURIComponent(n):n}function e(n,e){return btoa(t(n,e).replace(/%([0-9A-F]{2})/g,(n,t)=>String.fromCharCode(parseInt(t,16))))}function r(n,r={}){const{useSafeEncoding:o=!1,encodeForUrl:c=!0}=r,i="string"==typeof n?n:JSON.stringify(n);let f;if(o)f=e(i,c);else try{f=btoa(i)}catch{f=e(i,c)}return t(f,c)}export{r as encodeUrlPayload,n as isUndefined};
@@ -1,5 +1,6 @@
1
1
  export interface EncodeOptions {
2
2
  useSafeEncoding?: boolean;
3
+ encodeForUrl?: boolean;
3
4
  }
4
5
  export declare function isUndefined(value: unknown): value is undefined;
5
6
  export declare function encodeUrlPayload(payload: unknown, options?: EncodeOptions): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protocol-launcher/shared",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "One-click launch URL generator for protocol-based apps.",
5
5
  "type": "module",
6
6
  "author": "zhensherlock",