MCPcopy
hub / github.com/t4t5/sweetalert / swal

Function swal

src/core.ts:39–57  ·  view source on GitHub ↗
(...args)

Source from the content-addressed store, hash-verified

37};
38
39const swal:SweetAlert = (...args) => {
40
41 // Prevent library to be run in Node env:
42 if (typeof window === 'undefined') return;
43
44 const opts: SwalOptions = getOpts(...args);
45
46 return new Promise<any>((resolve, reject) => {
47 state.promise = { resolve, reject };
48
49 init(opts);
50
51 // For fade animation to work:
52 setTimeout(() => {
53 openModal();
54 });
55
56 });
57};
58
59swal.close = onAction;
60swal.getState = getState;

Callers 9

index.jsFile · 0.85
index.test.tsFile · 0.85
icons.test.tsFile · 0.85
actions.test.tsFile · 0.85
content.test.tsFile · 0.85
buttons.test.tsFile · 0.85
index.jsFile · 0.85

Calls 3

getOptsFunction · 0.90
openModalFunction · 0.90
initFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…