@piyushdoorwar/yamlet 1.0.5 → 1.1.1

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.
Files changed (2) hide show
  1. package/dist/yamlet.js +10 -1
  2. package/package.json +1 -1
package/dist/yamlet.js CHANGED
@@ -135,6 +135,14 @@ var CookieJar = class _CookieJar {
135
135
  this.remove(domain, cookie.name, cookie.path);
136
136
  this.cookies.push({ ...cookie, domain, hostOnly: cookie.hostOnly ?? false, createdAt: cookie.createdAt ?? (/* @__PURE__ */ new Date()).toISOString() });
137
137
  }
138
+ /** Replace only cookies previously imported for this site. */
139
+ replaceBrowserSite(site, cookies) {
140
+ this.cookies = this.cookies.filter((cookie) => cookie.browserSite !== site);
141
+ for (const cookie of cookies) this.set({ ...cookie, browserSite: site });
142
+ }
143
+ clearBrowserSites() {
144
+ this.cookies = this.cookies.filter((cookie) => !cookie.browserSite);
145
+ }
138
146
  remove(domain, name, path4) {
139
147
  const d = domain.replace(/^\./, "").toLowerCase();
140
148
  this.cookies = this.cookies.filter((c) => !(c.domain === d && c.name === name && (path4 === void 0 || c.path === path4)));
@@ -165,7 +173,8 @@ var CookieJar = class _CookieJar {
165
173
  httpOnly: !!c.httpOnly,
166
174
  sameSite: c.sameSite,
167
175
  expires: c.expires,
168
- createdAt: c.createdAt ?? (/* @__PURE__ */ new Date()).toISOString()
176
+ createdAt: c.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
177
+ browserSite: typeof c.browserSite === "string" ? c.browserSite : void 0
169
178
  });
170
179
  }
171
180
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piyushdoorwar/yamlet",
3
- "version": "1.0.5",
3
+ "version": "1.1.1",
4
4
  "description": "Run Yamlet API collections (Git-friendly YAML) from the command line or CI.",
5
5
  "type": "module",
6
6
  "bin": {