@prismicio/editor-support
Advanced tools
Comparing version 0.4.48 to 0.4.50-alpha.xru-test-extension.0
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function l(n,t,r){const e=n.slice();return e.splice(t,0,r),e}function g(n,t){return n.filter((r,e)=>e!==t)}function h(n){return n[n.length-1]}function p(n,t){const r=new Set;return n.filter(e=>{const u=t(e);return r.has(u)?!1:(r.add(u),!0)})}function m(n,t,r){if(t===r||c(n,t)||c(n,r))return n;const e=n.slice(),u=e.splice(t,1)[0];return e.splice(r,0,u),e}function c(n,t){return t<0||t>=n.length}function d(n,t,r=1){return Array.from({length:(t-n)/r+1},(e,u)=>n+u*r)}function v(n,t){const r=[];let e=[];return n.forEach((u,f)=>{e.length<t&&e.push(u),(e.length===t||f===n.length-1)&&(r.push(e),e=[])}),r}function A(n,...t){const r=n.slice();return t.length===0&&(t=[e=>e]),r.sort((e,u)=>{for(const f of t){const o=f(e),i=f(u);if(o==null)return 1;if(i==null)return-1;if(typeof o=="string"&&typeof i=="string"){const s=o.localeCompare(i);if(s!==0)return s}else if(typeof o=="number"&&typeof i=="number"){if(o<i)return-1;if(o>i)return 1}}return 0}),r}exports.chunk=v;exports.insertAtIndex=l;exports.last=h;exports.move=m;exports.range=d;exports.removeIndex=g;exports.sort=A;exports.uniqBy=p; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function l(n,t,...r){const e=n.slice();return e.splice(t,0,...r),e}function g(n,t){return n.filter((r,e)=>e!==t)}function h(n){return n[n.length-1]}function p(n,t){const r=new Set;return n.filter(e=>{const u=t(e);return r.has(u)?!1:(r.add(u),!0)})}function m(n,t,r){if(t===r||c(n,t)||c(n,r))return n;const e=n.slice(),u=e.splice(t,1)[0];return e.splice(r,0,u),e}function c(n,t){return t<0||t>=n.length}function d(n,t,r=1){return Array.from({length:(t-n)/r+1},(e,u)=>n+u*r)}function v(n,t){const r=[];let e=[];return n.forEach((u,f)=>{e.length<t&&e.push(u),(e.length===t||f===n.length-1)&&(r.push(e),e=[])}),r}function A(n,...t){const r=n.slice();return t.length===0&&(t=[e=>e]),r.sort((e,u)=>{for(const f of t){const o=f(e),i=f(u);if(o==null)return 1;if(i==null)return-1;if(typeof o=="string"&&typeof i=="string"){const s=o.localeCompare(i);if(s!==0)return s}else if(typeof o=="number"&&typeof i=="number"){if(o<i)return-1;if(o>i)return 1}}return 0}),r}exports.chunk=v;exports.insertAtIndex=l;exports.last=h;exports.move=m;exports.range=d;exports.removeIndex=g;exports.sort=A;exports.uniqBy=p; |
@@ -1,2 +0,2 @@ | ||
export declare function insertAtIndex<A>(array: readonly A[], index: number, item: A): A[]; | ||
export declare function insertAtIndex<A>(array: readonly A[], index: number, ...items: A[]): A[]; | ||
export declare function removeIndex<A>(array: readonly A[], index: number): A[]; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
function l(n, t, r) { | ||
function l(n, t, ...r) { | ||
const e = n.slice(); | ||
return e.splice(t, 0, r), e; | ||
return e.splice(t, 0, ...r), e; | ||
} | ||
@@ -5,0 +5,0 @@ function h(n, t) { |
/** | ||
* Throws a fatal error that the user cannot recover from | ||
* A fatal error that the user cannot recover from. | ||
*/ | ||
@@ -4,0 +4,0 @@ export declare class FatalError extends Error { |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./Type.cjs.js");async function v(e,t){const{okType:n,signal:r,headers:b,body:f,timeout:T=15e3,...m}=t,o=new Headers(b);!o.has("Content-Type")&&f&&o.set("Content-Type","application/json"),o.get("Content-Type")==="multipart/form-data"&&o.delete("Content-Type");const d=g();d&&o.set("Authorization",`Bearer ${d}`);const w=o.get("Content-Type")==="application/json"?JSON.stringify(f):f;let p=!1;try{const i=!t.method||t.method==="GET"?new AbortController:void 0,E=R([i==null?void 0:i.signal,r].filter(q.isDefined));i&&setTimeout(()=>{p=!0,i.abort()},T);const c=await fetch(e,{...m,body:w,headers:o,signal:E}),{status:y}=c,k=c.clone(),h=await c.json().catch(u=>k.text());if(c.ok){const u=n.safeParse(h);if(!u.success)throw new a(e,{type:"validation",status:y,cause:u.error});return u.data}else throw new a(e,{type:"http",status:y,body:h})}catch(s){throw l(s)?s:B(s)?new a(e,{type:p?"timeout":"abort"}):new a(e,A(s))}}class a extends Error{constructor(t,n){super(JSON.stringify({url:t,...n},null,2)),this.detail=n,this.name="RequestError"}}function A(e){var t;return{type:"unknown",cause:C(e),online:navigator.onLine,connectionType:(t=navigator.connection)==null?void 0:t.effectiveType}}function C(e){return e instanceof Error?{name:e.name,message:e.message,stack:e.stack}:e}function l(e){return e instanceof a}function O(e){return!l(e)||e.detail.type!=="http"?!1:e.detail.status===401||e.detail.status===403}function R(e){const t=new AbortController;function n(){t.abort();for(const r of e)r.removeEventListener("abort",n)}for(const r of e){if(r.aborted){n();break}r.addEventListener("abort",n)}return t.signal}function B(e){return e instanceof DOMException&&e.name==="AbortError"}let g=()=>"";function S(e){g=e}function j(e){return e==="token"?"omit":"include"}exports.getRequestCredentials=j;exports.isAuthError=O;exports.isRequestError=l;exports.registerBearerTokenGetter=S;exports.request=v; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./Type.cjs.js");async function v(e,t){const{okType:n,signal:o,headers:b,body:f,timeout:T=15e3,...m}=t,r=new Headers(b);!r.has("Content-Type")&&f&&r.set("Content-Type","application/json"),r.get("Content-Type")==="multipart/form-data"&&r.delete("Content-Type");const d=g();d&&r.set("Authorization",`Bearer ${d}`);const w=r.get("Content-Type")==="application/json"?JSON.stringify(f):f;let p=!1;try{const a=!t.method||t.method==="GET"?new AbortController:void 0,E=O([a==null?void 0:a.signal,o].filter(q.isDefined));a&&setTimeout(()=>{p=!0,a.abort()},T);const c=await fetch(e,{...m,body:w,headers:r,signal:E}),{status:y}=c,k=c.clone(),h=await c.json().catch(u=>k.text());if(c.ok){const u=n.safeParse(h);if(!u.success)throw new s(e,{type:"validation",status:y,cause:u.error});return u.data}else throw new s(e,{type:"http",status:y,body:h})}catch(i){throw l(i)?i:B(i)?new s(e,{type:p?"timeout":"abort"}):new s(e,A(i))}}class s extends Error{constructor(t,n){super(JSON.stringify({url:t,...n},null,2)),this.detail=n,this.name="RequestError"}}function A(e){var t;return{type:"unknown",cause:C(e),online:navigator.onLine,connectionType:(t=navigator.connection)==null?void 0:t.effectiveType}}function C(e){return e instanceof Error?{name:e.name,message:e.message,stack:e.stack}:e}function l(e){return e instanceof s}function R(e){return!l(e)||e.detail.type!=="http"?!1:e.detail.status===401||e.detail.status===403}function O(e){const t=new AbortController;function n(){t.abort();for(const o of e)o.removeEventListener("abort",n)}for(const o of e){if(o.aborted){n();break}o.addEventListener("abort",n)}return t.signal}function B(e){return e instanceof DOMException&&e.name==="AbortError"}let g=()=>"";function S(e){g=e}function j(e){return e==="token"?"omit":"include"}exports.RequestError=s;exports.getRequestCredentials=j;exports.isAuthError=R;exports.isRequestError=l;exports.registerBearerTokenGetter=S;exports.request=v; |
@@ -8,3 +8,3 @@ import type { ZodError, ZodType, ZodTypeDef } from "zod"; | ||
} | ||
declare class RequestError extends Error { | ||
export declare class RequestError extends Error { | ||
detail: RequestErrorDetail; | ||
@@ -11,0 +11,0 @@ constructor(url: string | URL, detail: RequestErrorDetail); |
@@ -99,2 +99,3 @@ import { isDefined as v } from "./Type.es.js"; | ||
export { | ||
a as RequestError, | ||
S as getRequestCredentials, | ||
@@ -101,0 +102,0 @@ R as isAuthError, |
export declare function mapValues<K extends string | number, A, B>(record: Readonly<Record<K, A>>, mapFunction: (value: A, key: K) => B): Record<K, B>; | ||
export declare function filterValues<K extends string | number, A, B extends A>(record: Readonly<Record<K, A>>, filterFunction: (value: A, key: K) => value is B): Record<K, B>; | ||
export declare function filterValues<K extends string | number, A>(record: Readonly<Record<K, A>>, filterFunction: (value: A, key: K) => boolean): Record<K, A>; | ||
export declare function filterValues<K extends string | number, A, B extends A>(record: Readonly<Partial<Record<K, A>>>, filterFunction: (value: A, key: K) => value is B): Record<K, B>; | ||
export declare function filterValues<K extends string | number, A>(record: Readonly<Partial<Record<K, A>>>, filterFunction: (value: A, key: K) => boolean): Record<K, A>; | ||
/** | ||
@@ -5,0 +5,0 @@ * Removes a key/value from an object and returns a new object (and type) |
@@ -6,2 +6,3 @@ import { type JSXElementConstructor, type ReactNode, type RefObject, type TransitionStartFunction } from "react"; | ||
} | ||
function forwardRef<T, P = object>(render: (props: P, ref: React.ForwardedRef<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null; | ||
} | ||
@@ -8,0 +9,0 @@ /** |
@@ -67,3 +67,3 @@ { | ||
}, | ||
"version": "0.4.48" | ||
"version": "0.4.50-alpha.xru-test-extension.0" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
62767
1482
3