UNPKG

@updatedev/js

Version:

Update JavaScript SDK

48 lines 1.59 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var storage_exports = {}; __export(storage_exports, { StorageClient: () => StorageClient }); module.exports = __toCommonJS(storage_exports); class StorageClient { constructor(getAll, setAll) { this.getAll = getAll; this.setAll = setAll; this.getAll = getAll; this.setAll = setAll; } async set(name, value, options) { if (this.setAll == null) return; await this.setAll([{ name, value, options }]); } async get(name) { var _a; const cookies = await this.getAll(); if (!cookies) { return void 0; } return (_a = cookies.find((cookie) => cookie.name === name)) == null ? void 0 : _a.value; } } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { StorageClient }); //# sourceMappingURL=storage.js.map