@prose-reader/shared 1.181.0 → 1.185.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.
@@ -1,2 +1,2 @@
1
- (function(o,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(o=typeof globalThis<"u"?globalThis:o||self,u(o["prose-shared"]={}))})(this,function(o){"use strict";const u=e=>{var n,t;return((t=(n=e.split(/[#?]/)[0])==null?void 0:n.split(".").pop())==null?void 0:t.trim())||""};function g(e){const n=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError(`Url must be a string. Received ${e[0]}`);e[0].match(/^[^/:]+:\/*$/)&&e.length>1&&(e[0]=e.shift()+e[0]),e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(let l=0;l<e.length;l++){let r=e[l];if(typeof r!="string")throw new TypeError(`Url must be a string. Received ${r}`);r!==""&&(l>0&&(r=r.replace(/^[/]+/,"")),l<e.length-1?r=r.replace(/[/]+$/,""):r=r.replace(/[/]+$/,"/"),n.push(r))}let t=n.join("/");t=t.replace(/\/(\?|&|#[^!])/g,"$1");const i=t.split("?");return t=i.shift()+(i.length>0?"?":"")+i.join("&"),t}function h(...e){const n=Array.from(Array.isArray(e[0])?e[0]:e);return g(n)}function R(e){const n=e.split("/");return n.pop(),n.join("/")}const a=e=>{switch(u(e)){case"png":return"image/png";case"jpg":return"image/jpg";case"jpeg":return"image/jpeg";case"txt":return"text/plain";case"webp":return"image/webp";case"xhtml":return"application/xhtml+xml"}},m=({mimeType:e,uri:n})=>{const t=e??a(n??"");return t==null?void 0:t.startsWith("application/xhtml+xml")},y=e=>e.length?e.indexOf(";")?e.substring(0,e.indexOf(";")):e:void 0,_="prose-reader-resource-error",w=Object.prototype.hasOwnProperty,E=(e,n)=>e===n?e!==0||n!==0||1/e===1/n:!1,O=(e,n,t)=>{if(e===n)return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;const i=Object.keys(e),l=Object.keys(n);if(i.length!==l.length)return!1;const r=t&&typeof t.customEqual=="function"?t.customEqual:E;for(let f=0;f<i.length;f++){const p=i[f]||"";if(!w.call(n,p)||!r(e[p],n[p]))return!1}return!0},T=(e,n)=>e.reduce((t,i)=>{const l=n(i);return t[l]||(t[l]=[]),t[l].push(i),t},{});function $(e,n){const t={...e};for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)){const l=n[i];(l!==void 0||!(i in e))&&(t[i]=l)}return t}const s="@prose-reader",c=e=>`[${e}]`,d=(e,n)=>({debug:!n||(window==null?void 0:window.__PROSE_READER_DEBUG)!==!0?()=>{}:e?Function.prototype.bind.call(console.debug,console,c(`${s}`),c(e)):Function.prototype.bind.call(console.debug,console,c(`${s}`)),info:!n||(window==null?void 0:window.__PROSE_READER_DEBUG)!==!0?()=>{}:e?Function.prototype.bind.call(console.info,console,c(`${s}`),c(e)):Function.prototype.bind.call(console.info,console,c(`${s}`)),error:!n||(window==null?void 0:window.__PROSE_READER_DEBUG)!==!0?()=>{}:e?Function.prototype.bind.call(console.error,console,c(`${s}`),c(e)):Function.prototype.bind.call(console.error,console,c(`${s}`))}),P={...d(),namespace:(e,n)=>d(e,n)},D=(e,n)=>e===n?!0:e.length!==n.length?!1:e.every((t,i)=>t===n[i]);o.PROSE_READER_RESOURCE_ERROR_INJECTED_META_NAME=_,o.Report=P,o.arrayEqual=D,o.detectMimeTypeFromName=a,o.getParentPath=R,o.getUrlExtension=u,o.groupBy=T,o.is=E,o.isShallowEqual=O,o.isXmlBasedMimeType=m,o.parseContentType=y,o.shallowMergeIfDefined=$,o.urlJoin=h,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(o=typeof globalThis<"u"?globalThis:o||self,u(o["prose-shared"]={}))})(this,function(o){"use strict";const u=e=>{var n,t;return((t=(n=e.split(/[#?]/)[0])==null?void 0:n.split(".").pop())==null?void 0:t.trim())||""};function d(e){const n=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError(`Url must be a string. Received ${e[0]}`);e[0].match(/^[^/:]+:\/*$/)&&e.length>1&&(e[0]=e.shift()+e[0]),e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(let l=0;l<e.length;l++){let r=e[l];if(typeof r!="string")throw new TypeError(`Url must be a string. Received ${r}`);r!==""&&(l>0&&(r=r.replace(/^[/]+/,"")),l<e.length-1?r=r.replace(/[/]+$/,""):r=r.replace(/[/]+$/,"/"),n.push(r))}let t=n.join("/");t=t.replace(/\/(\?|&|#[^!])/g,"$1");const i=t.split("?");return t=i.shift()+(i.length>0?"?":"")+i.join("&"),t}function h(...e){const n=Array.from(Array.isArray(e[0])?e[0]:e);return d(n)}function R(e){const n=e.split("/");return n.pop(),n.join("/")}const a=e=>{switch(u(e)){case"png":return"image/png";case"jpg":return"image/jpg";case"jpeg":return"image/jpeg";case"txt":return"text/plain";case"webp":return"image/webp";case"xhtml":return"application/xhtml+xml"}},m=({mimeType:e,uri:n})=>{const t=e??a(n??"");return t==null?void 0:t.startsWith("application/xhtml+xml")},y=e=>e.length?e.indexOf(";")?e.substring(0,e.indexOf(";")):e:void 0,_="prose-reader-resource-error",w=Object.prototype.hasOwnProperty,E=(e,n)=>e===n?e!==0||n!==0||1/e===1/n:!1,O=(e,n,t)=>{if(e===n)return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;const i=Object.keys(e),l=Object.keys(n);if(i.length!==l.length)return!1;const r=t&&typeof t.customEqual=="function"?t.customEqual:E;for(let f=0;f<i.length;f++){const p=i[f]||"";if(!w.call(n,p)||!r(e[p],n[p]))return!1}return!0},T=(e,n)=>e.reduce((t,i)=>{const l=n(i);return t[l]||(t[l]=[]),t[l].push(i),t},{});function $(e,n){const t={...e};for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)){const l=n[i];(l!==void 0||!(i in e))&&(t[i]=l)}return t}const s="@prose-reader",c=e=>`[${e}]`,g=(e,n)=>({debug:!n||(window==null?void 0:window.__PROSE_READER_DEBUG)!==!0?()=>{}:e?Function.prototype.bind.call(console.debug,console,c(`${s}`),c(e)):Function.prototype.bind.call(console.debug,console,c(`${s}`)),info:!n||(window==null?void 0:window.__PROSE_READER_DEBUG)!==!0?()=>{}:e?Function.prototype.bind.call(console.info,console,c(`${s}`),c(e)):Function.prototype.bind.call(console.info,console,c(`${s}`)),error:!n||(window==null?void 0:window.__PROSE_READER_DEBUG)!==!0?()=>{}:e?Function.prototype.bind.call(console.error,console,c(`${s}`),c(e)):Function.prototype.bind.call(console.error,console,c(`${s}`))}),P={...g(),namespace:(e,n)=>g(e,n)},D=(e,n)=>e===n?!0:e.length!==n.length?!1:e.every((t,i)=>t===n[i]);o.PROSE_READER_RESOURCE_ERROR_INJECTED_META_NAME=_,o.Report=P,o.arrayEqual=D,o.detectMimeTypeFromName=a,o.getParentPath=R,o.getUrlExtension=u,o.groupBy=T,o.is=E,o.isShallowEqual=O,o.isXmlBasedMimeType=m,o.parseContentType=y,o.shallowMergeIfDefined=$,o.urlJoin=h,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=index.umd.cjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prose-reader/shared",
3
- "version": "1.181.0",
3
+ "version": "1.185.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",
@@ -20,5 +20,5 @@
20
20
  "build": "tsc && vite build",
21
21
  "test": "vitest run --coverage"
22
22
  },
23
- "gitHead": "468603245df9b98713baa40f30846caeb75eefd4"
23
+ "gitHead": "8a1b7236ea277b81b31801ce31f3771fd2240048"
24
24
  }