@rescale/nemo
Version:
A middleware composition library for Next.js applications that allows you to organize and chain middleware functions based on URL patterns.
2 lines (1 loc) • 766 B
JavaScript
import{a as e}from"./chunk-JRB5LDYT.js";var s=class extends e{storage={};constructor(t){super(),t&&(this.storage={...t})}get(t){return this.storage[t]}set(t,r){this.storage[t]=r}has(t){return t in this.storage}delete(t){let r=t in this.storage;return delete this.storage[t],r}clear(){this.storage={}}entries(){return Object.entries(this.storage)[Symbol.iterator]()}keys(){return Object.keys(this.storage)[Symbol.iterator]()}values(){return Object.values(this.storage)[Symbol.iterator]()}get size(){return Object.keys(this.storage).length}fromEntries(t){this.storage=Object.fromEntries(t)}toString(){return JSON.stringify(this.storage)}fromString(t){try{let r=JSON.parse(t);return typeof r!="object"||r===null?!1:(this.storage=r,!0)}catch{return!1}}};export{s as a};