@flex-development/mlly 1.0.0-beta.6 → 1.0.0-beta.7
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.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/dist/index.d.mts +831 -831
- package/dist/lib/get-source.mjs +1 -1
- package/dist/lib/is-directory.mjs +1 -1
- package/dist/lib/is-file.mjs +1 -1
- package/dist/lib/lookup-package-scope.mjs +1 -1
- package/dist/lib/read-package-json.mjs +1 -1
- package/dist/lib/resolve-module.mjs +1 -1
- package/dist/lib/resolver.mjs +1 -1
- package/package.json +7 -3
- package/dist/internal/chain-or-call.d.mts +0 -51
- package/dist/internal/chain-or-call.mjs +0 -1
- package/dist/internal/chars.d.mts +0 -16
- package/dist/internal/check-invalid-segments.d.mts +0 -18
- package/dist/internal/constant.d.mts +0 -21
- package/dist/internal/fs.browser.d.mts +0 -12
- package/dist/internal/fs.node.d.mts +0 -12
- package/dist/internal/identity.d.mts +0 -21
- package/dist/internal/invalid-package-target.d.mts +0 -31
- package/dist/internal/invalid-subpath.d.mts +0 -32
- package/dist/internal/is-promise.d.mts +0 -21
- package/dist/internal/is-promise.mjs +0 -1
- package/dist/internal/process.browser.d.mts +0 -9
package/dist/lib/get-source.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var c=Object.defineProperty;var o=(e,t)=>c(e,"name",{value:t,configurable:!0});import m from"#internal/fs";import p from"#internal/identity";import a from"#internal/process";import h from"#lib/is-file";import l from"#lib/is-module-id";import u from"#lib/to-url";import{ERR_UNSUPPORTED_ESM_URL_SCHEME as R}from"@flex-development/errnode";import s from"@flex-development/when";import{ok as n}from"devlop";var I=U;function U(e,t){if(!l(e))return null;const r={...t,fs:t?.fs??m,handlers:{"data:":x,"file:":w,"http:":d,"https:":d,"node:":E,...t?.handlers},req:{...t?.req},schemes:new Set(t?.schemes?[...t.schemes]:["data","file","http","https","node"])},f=u(e);let i;if(i=r.handlers[f.protocol],typeof i!="function"){if(r.ignoreErrors)return;throw new R(f,[...r.schemes],a.platform==="win32")}return s(i.call(r,f),p)}o(U,"getSource");function x(e){const[t,r=""]=e.pathname.split(",");return n(e.protocol==="data:","expected `data:` URL"),n(t!==void 0,"expected `mime` to be a string"),Buffer.from(decodeURIComponent(r),t.endsWith("base64")?"base64":"utf8")}o(x,"data");function w(e){return n(e.protocol==="file:","expected `file:` URL"),s(h(e,this.fs),t=>t?this.fs.readFile(e,this.encoding):null)}o(w,"file");async function d(e){return n(/^https?:$/.test(e.protocol),"expected `http:` or `https:` URL"),(await fetch(e.href,this.req)).text()}o(d,"https");function E(e){n(e.protocol==="node:","expected `node:` URL")}o(E,"node");export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var f=Object.defineProperty;var e=(t,r)=>f(t,"name",{value:r,configurable:!0});import s from"#internal/constant";import i from"#internal/fs";import n from"#lib/is-module-id";import a from"@flex-development/when";var h=m;function m(t,r){if(typeof t=="string"&&t.startsWith("file:")&&(t=new URL(t)),!n(t))return!1;r??=i;try{return a(r.stat(t),o=>o.isDirectory(),s(!1))}catch{return!1}}e(m,"isDirectory");export{h as default};
|
package/dist/lib/is-file.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var o=Object.defineProperty;var e=(t,r)=>o(t,"name",{value:r,configurable:!0});import s from"#internal/constant";import i from"#internal/fs";import n from"#lib/is-module-id";import a from"@flex-development/when";var w=l;function l(t,r){if(typeof t=="string"&&t.startsWith("file:")&&(t=new URL(t)),!n(t))return!1;r??=i;try{return a(r.stat(t),f=>f.isFile(),s(!1))}catch{return!1}}e(l,"isFile");export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var f=Object.defineProperty;var
|
|
1
|
+
var f=Object.defineProperty;var l=(o,r)=>f(o,"name",{value:r,configurable:!0});import u from"#lib/can-parse-url";import d from"#lib/is-file";import h from"#lib/is-module-id";import U from"#lib/root";import g from"#lib/to-url";import m from"@flex-development/pathe";import{isThenable as k}from"@flex-development/when";var v=w;function w(o,r,a){if(h(o)&&u(o)){const n={scope:null},i=[];let e=new URL(o),t;for(;String(e)!==String(r??U)&&(e=g(m.dot.repeat(/[/\\]$/.test(e.pathname)?2:1),e),!/node_modules[/\\]$/.test(e.pathname));){const s=new URL("package.json",e),p=new URL(m.dot,s);if(t=d(s,a),k(t))i.push(t.then(c=>{if(!(!c||n.scope))return n.scope=p,void 0}));else if(t)return p}if(i.length)return Promise.all(i).then(()=>n.scope)}return null}l(w,"lookupPackageScope");export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var p=Object.defineProperty;var n=(r,o)=>p(r,"name",{value:o,configurable:!0});import h from"#internal/fs";import d from"#lib/can-parse-url";import w from"#lib/is-file";import P from"#lib/is-module-id";import{ERR_INVALID_PACKAGE_CONFIG as g}from"@flex-development/errnode";import u from"@flex-development/pathe";import c from"@flex-development/when";var J=A;function A(r,o,a,m){if(P(r)&&d(r)){const e=new URL("package.json",r);return c(w(e,m??=h),i=>i?c(m.readFile(e,"utf8"),l=>{try{const t=JSON.parse(l);if(I(t))return t;throw new Error("Invalid package manifest object",{cause:t})}catch(t){const s=t,f=new g(e.pathname,a&&o?`"${o}" from ${u.fileURLToPath(a)}`:o&&u.fileURLToPath(o),s.message);throw f.cause=s,f}}):null)}return null}n(A,"readPackageJson");function I(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}n(I,"isPackageJson");export{J as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var c=Object.defineProperty;var m=(t,n)=>c(t,"name",{value:n,configurable:!0});import i from"#internal/constant";import x from"#internal/identity";import U from"#lib/default-extensions";import y from"#lib/resolve-alias";import{moduleResolve as _}from"#lib/resolver";import{codes as f,isNodeError as D}from"@flex-development/errnode";import d from"@flex-development/pathe";import{isThenable as N,when as T}from"@flex-development/when";var j=P;function P(t,n,e){t=String(t),t=y(t,{...e,parent:n})??t;let r;try{r=_(t,n,e?.conditions,e?.mainFields,e?.preserveSymlinks,e?.fs)}catch(l){return O(l,t,n,e)}return T(r,{chain:m(l=>R(l,t,e?.ext),"chain"),reject:m(l=>O(l,t,n,e),"reject")})}m(P,"resolveModule");function O(t,n,e,r){const l=new Set([f.ERR_MODULE_NOT_FOUND,f.ERR_UNSUPPORTED_DIR_IMPORT]);if(D(t)&&l.has(t.code)){const u=[...r?.extensions??U],h=[];let a,s=[];t.code===f.ERR_MODULE_NOT_FOUND&&!t.url&&(s=[n.startsWith("@types/")?n:"@types/"+n].flatMap(o=>[o,o+d.sep+"index.d.ts",o+d.sep+"index.d.mts",o+d.sep+"index.d.cts"])),t.code===f.ERR_MODULE_NOT_FOUND&&t.url&&(s=u.map(o=>n+d.formatExt(o))),t.code===f.ERR_UNSUPPORTED_DIR_IMPORT&&(s=u.map(o=>n+d.sep+"index"+d.formatExt(o)));for(let o of s){try{if(a=_(o,e,r?.conditions,r?.mainFields,r?.preserveSymlinks,r?.fs),!N(a))return R(a,n,r?.ext)}catch{continue}h.push(a.then(x,i(void 0)))}if(h.length)return Promise.all(h).then(o=>{for(const E of o)if(E)return R(E,n,r?.ext);throw t})}throw t}m(O,"retry");function R(t,n,e){if(t.protocol==="file:"&&e!==void 0){let r;typeof e=="function"?r=e(t,n):typeof e=="object"&&e?r=d.extToValue(t.href,e):r=e,t.href=d.changeExt(t.href,r||null),t=new URL(d.toPosix(t.href).replace(/\/index$/,d.sep))}return t}m(R,"rewriteExtension");export{j as default};
|
package/dist/lib/resolver.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var H=Object.defineProperty;var w=(o,e)=>H(o,"name",{value:e,configurable:!0});import y from"#internal/chars";import j from"#internal/check-invalid-segments";import J from"#internal/fs";import O from"#internal/identity";import v from"#internal/invalid-package-target";import Q from"#internal/invalid-subpath";import X from"#lib/can-parse-url";import q from"#lib/default-conditions";import z from"#lib/default-main-fields";import M from"#lib/is-array-index";import W from"#lib/is-directory";import b from"#lib/is-file";import Y from"#lib/is-imports-subpath";import Z from"#lib/is-module-id";import p from"#lib/is-relative-specifier";import C from"#lib/lookup-package-scope";import ee from"#lib/pattern-match";import S from"#lib/read-package-json";import oe from"#lib/root";import te from"#lib/to-url";import{codes as re,ERR_INVALID_MODULE_SPECIFIER as U,ERR_INVALID_PACKAGE_CONFIG as $,ERR_MODULE_NOT_FOUND as N,ERR_PACKAGE_IMPORT_NOT_DEFINED as ne,ERR_PACKAGE_PATH_NOT_EXPORTED as ie,ERR_UNSUPPORTED_DIR_IMPORT as fe,ERR_UNSUPPORTED_RESOLVE_REQUEST as F}from"@flex-development/errnode";import{isBuiltin as G}from"@flex-development/is-builtin";import c from"@flex-development/pathe";import{isThenable as P,when as a}from"@flex-development/when";import{ok as L}from"devlop";function V(o,e,f,m,l){if(e){const u={url:null},n=[];for(const t of f??z){const i=e[t],s=[];let h;typeof i=="string"&&s.push(i,`./${i}.js`,`./${i}.json`,`./${i}.node`,`./${i}/index.js`,`./${i}/index.json`,`./${i}/index.node`),s.push("./index.js","./index.json","./index.node");for(const d of s.map(R=>new URL(R,o)))if(h=b(d,l),P(h))n.push(h.then(R=>{if(!(!R||u.url))return u.url=d,void 0}));else if(h&&!n.length)return d}if(n.length)return Promise.all(n).then(()=>r(u.url))}return r(null);function r(u){if(u)return u;throw new N(c.fileURLToPath(o),m&&c.fileURLToPath(m))}}w(V,"legacyMainResolve");function le(o,e,f,m,l,r){const u=typeof e=="string"?e.slice(0,e.indexOf(":")+1):e.protocol;let n;if(c.isAbsolute(o)||p(o))try{n=new URL(o,e)}catch(t){let i;throw i=new F(o,e),i.cause=t,i}else if(u==="file:"&&Y(o))n=g(o,e,f,m,r);else try{n=new URL(o)}catch(t){if(u==="data:"&&!G(o)){let i;throw i=new F(String(o),e),i.cause=t,i}n=I(o,e,f,m,r)}return a(n,t=>{if(t.protocol!=="file:")return t;const i=c.fileURLToPath(e);if(/%2f|%5c/i.test(t.pathname)){const s='must not include encoded "/" or "\\" characters';throw new U(t.pathname,s,i)}return a(W(t,r),s=>{if(s){let h;throw h=new fe(t.pathname,i),h.url=String(t),h}return a(b(t,r),h=>{if(h)return l?t:a((r??J).realpath(t),d=>{const{hash:R,search:E}=t;return t=new URL(c.pathToFileURL(d)),t.hash=R,t.search=E,t});throw new N(t.pathname,i,t)})})})}w(le,"moduleResolve");function k(o,e,f,m,l,r){if(f){let u=!1;if(!Array.isArray(f)&&typeof f=="object")for(const[t,i]of Object.getOwnPropertyNames(f).entries()){let s=i[0]===c.dot;if(t===0){u=s;continue}if(u!==s)throw new $(c.fileURLToPath(new URL("package.json",o)),l,`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}let n=null;if(e===c.dot){let t;Array.isArray(f)||typeof f=="string"||!u?t=f:Object.prototype.hasOwnProperty.call(f,e)&&(t=f[e]),t!==void 0&&(n=T(o,t,e,null,!1,m,null,l,r))}else!Array.isArray(f)&&typeof f=="object"&&u&&(L(e.startsWith("./"),'expected `subpath` to start with "./"'),n=D(e,f,o,!1,m,null,l,r));if(L(!P(n),"expected `resolved` not to be a promise"),n)return n}throw new ie(c.fileURLToPath(o),e,l&&c.fileURLToPath(l))}w(k,"packageExportsResolve");function D(o,e,f,m,l,r,u,n){const t=ee(o,e);return t&&(L(e,"expected `matchObject`"),T(f,e[t[0]],...t,m,l,r,u,n))}w(D,"packageImportsExportsResolve");function g(o,e,f,m,l){if(!o.startsWith(y.hash)||o===y.hash||o.startsWith(y.hash+c.sep))throw new U(o,"is not a valid internal imports specifier name",c.fileURLToPath(e));return a(C(e,null,l),r=>{return a(S(r,o,e,l),n=>{if(n){L(r instanceof URL,"expected `scope` to be a URL");let t;if(t=D(o,n.imports,r,!0,f,m,e,l),P(t))return t.then(u);if(t)return t}return u(null)});function u(n){if(n)return n;throw new ne(o,r&&c.fileURLToPath(r),e&&c.fileURLToPath(e))}})}w(g,"packageImportsResolve");function I(o,e,f,m,l){if(G(o))return te(o);let r=o.indexOf(c.sep),u=!!o;o[0]===y.at&&(r===-1?u=!1:r=o.indexOf(c.sep,r+1));const n=r===-1?o:o.slice(0,r);if(/^\.|%|\\/.exec(n)!==null&&(u=!1),!u){const d="is not a valid package name";throw new U(o,d,e)}const t=c.dot+(r===-1?y.empty:o.slice(r)),i=K(n,t,e,f,l);return a(i,d=>{if(d)return d;const R={url:null},E=[];let _,A=new URL(e);for(;String(A)!==String(oe);){const x=new URL(`node_modules/${n}/`,A);if(_=W(x,l),P(_))E.push(_.then(B=>{if(!(!B||R.url))return R.url=h(x),void 0}));else if(_)return h(x);A=new URL(c.dirname(A.href))}return E.length?a(Promise.all(E),()=>P(R.url)?R.url.then(s):s(R.url)):s(null)});function s(d){if(d)return d;throw new N(n,e&&c.fileURLToPath(e))}function h(d){return a(S(d,null,e,l),R=>R?.exports?k(d,t,R.exports,f,e,l):t!==c.dot?new URL(t,d):V(d,R,m,e,l))}}w(I,"packageResolve");function K(o,e,f,m,l){return a(C(f,null,l),r=>a(S(r,null,f,l),u=>{if(u?.exports&&o===u.name)return L(r,"expected `scope`"),k(r,e,u.exports,m,f,l)}))}w(K,"packageSelfResolve");function T(o,e,f,m,l,r,u,n,t){if(e===null)return e;if(Array.isArray(e)){const i=[];let s,h;for(const d of e){try{h=T(o,d,f,m,l,r,u,n,t)}catch(R){if(s=R,s.code!==re.ERR_INVALID_PACKAGE_TARGET)throw s}if(P(h))i.push(h.then(O,O));else if(h&&!i.length)return h}if(i.length)return s=null,Promise.all(i).then(d=>{for(const R of d){if(Z(R))return R;/* v8 ignore else -- @preserve */R&&(s=R)}/* v8 ignore else -- @preserve */if(s)throw s;/* v8 ignore next -- @preserve */return null});if(s)throw s;return null}if(typeof e=="object"){for(const h of Object.getOwnPropertyNames(e))if(M(h))throw new $(c.fileURLToPath(new URL("package.json",o)),n,'"exports" cannot contain numeric property keys');r??=q,Array.isArray(r)&&(r=new Set(r));const i=[];let s;for(const h of Object.getOwnPropertyNames(e))if(r.has(h)||h==="default"){if(s=T(o,e[h],f,m,l,r,u,n,t),P(s))i.push(s.then(O));else if(s!==void 0&&!i.length)return s}return i.length?Promise.all(i).then(h=>h.find(d=>!!d)):void 0}if(typeof e=="string"){if(!e.startsWith("./")){if(!l||e.startsWith("../")||e.startsWith(c.sep)||X(e))throw v(o,f,e,l,n);return I(typeof m=="string"?e.replace(y.asterisk,m):e,o,r,u,t)}if(L(e.startsWith("./"),'expected `target` to start with "./"'),j(e))throw v(o,f,e,l,n);let i=new URL(e,o);if(!i.href.startsWith(String(o)))throw v(o,f,e,l,n);if(typeof m=="string"){if(m&&j(m))throw Q(f,m,o,l,n);e=e.replace(y.asterisk,m),L(typeof e=="string","expected string `target`"),i=new URL(e,o)}return i}throw v(o,f,e,l,n)}w(T,"packageTargetResolve");export{V as legacyMainResolve,le as moduleResolve,k as packageExportsResolve,D as packageImportsExportsResolve,g as packageImportsResolve,I as packageResolve,K as packageSelfResolve,T as packageTargetResolve};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flex-development/mlly",
|
|
3
3
|
"description": "ESM utilities for modern tooling — spec-compliant, developer-friendly, and fully typed",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.7",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bundle",
|
|
7
7
|
"cli",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
},
|
|
123
123
|
"scripts": {
|
|
124
124
|
"build": "yarn clean:build && tsc -p tsconfig.build.json --noEmit false && yarn bundle:dts && yarn minify:build",
|
|
125
|
-
"bundle:dts": "
|
|
125
|
+
"bundle:dts": "rollup --config=rollup.config.mts && trash dist/{interfaces,types} && trash dist/{internal,lib}/*.d.mts",
|
|
126
126
|
"check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn typecheck && yarn check:types && yarn test:cov && yarn pack && yarn check:types:build && attw package.tgz && yarn clean:pack",
|
|
127
127
|
"check:format": "dprint check --incremental=false",
|
|
128
128
|
"check:lint": "eslint --exit-on-fatal-error --max-warnings 0 .",
|
|
@@ -165,12 +165,14 @@
|
|
|
165
165
|
"@flex-development/is-builtin": "3.2.0",
|
|
166
166
|
"@flex-development/pathe": "4.0.2",
|
|
167
167
|
"@flex-development/pkg-types": "4.1.0",
|
|
168
|
+
"@flex-development/when": "1.0.0",
|
|
168
169
|
"devlop": "1.1.0"
|
|
169
170
|
},
|
|
170
171
|
"devDependencies": {
|
|
171
172
|
"@arethetypeswrong/cli": "0.18.2",
|
|
172
173
|
"@commitlint/cli": "20.4.1",
|
|
173
174
|
"@commitlint/types": "20.4.0",
|
|
175
|
+
"@edge-runtime/vm": "5.0.0",
|
|
174
176
|
"@faker-js/faker": "10.3.0",
|
|
175
177
|
"@flex-development/commitlint-config": "1.0.1",
|
|
176
178
|
"@flex-development/eslint-config": "1.1.1",
|
|
@@ -179,6 +181,7 @@
|
|
|
179
181
|
"@flex-development/remark-preset": "1.0.0",
|
|
180
182
|
"@flex-development/tsconfig-types": "5.1.0",
|
|
181
183
|
"@flex-development/tutils": "6.0.0-alpha.25",
|
|
184
|
+
"@rollup/plugin-node-resolve": "16.0.3",
|
|
182
185
|
"@tsconfig/strictest": "2.0.8",
|
|
183
186
|
"@types/chai": "5.2.3",
|
|
184
187
|
"@types/chai-string": "1.4.5",
|
|
@@ -195,7 +198,6 @@
|
|
|
195
198
|
"cross-env": "10.1.0",
|
|
196
199
|
"cspell": "9.6.4",
|
|
197
200
|
"dprint": "0.51.1",
|
|
198
|
-
"dtsroll": "1.7.6",
|
|
199
201
|
"editorconfig": "3.0.1",
|
|
200
202
|
"esbuild": "0.27.3",
|
|
201
203
|
"eslint": "9.39.2",
|
|
@@ -209,6 +211,8 @@
|
|
|
209
211
|
"remark": "15.0.1",
|
|
210
212
|
"remark-cli": "12.0.1",
|
|
211
213
|
"remark-lint-maximum-heading-length": "4.1.1",
|
|
214
|
+
"rollup": "4.57.1",
|
|
215
|
+
"rollup-plugin-dts": "6.3.0",
|
|
212
216
|
"sh-syntax": "0.5.8",
|
|
213
217
|
"trash-cli": "7.2.0",
|
|
214
218
|
"typescript": "5.9.3",
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Internal - chainOrCall
|
|
3
|
-
* @module mlly/internal/chainOrCall
|
|
4
|
-
*/
|
|
5
|
-
import type { Awaitable } from '@flex-development/mlly';
|
|
6
|
-
export default chainOrCall;
|
|
7
|
-
/**
|
|
8
|
-
* Chain function parameters.
|
|
9
|
-
*
|
|
10
|
-
* @internal
|
|
11
|
-
*
|
|
12
|
-
* @template {any} R
|
|
13
|
-
* The previous resolved value
|
|
14
|
-
* @template {any[]} P
|
|
15
|
-
* The function parameters
|
|
16
|
-
*/
|
|
17
|
-
type ChainParams<R, P extends any[]> = [...P, R?];
|
|
18
|
-
/**
|
|
19
|
-
* Chain a callback, calling the function after `promise` is resolved,
|
|
20
|
-
* otherwise synchronously call `fn`.
|
|
21
|
-
*
|
|
22
|
-
* @see {@linkcode Awaitable}
|
|
23
|
-
* @see {@linkcode ChainParams}
|
|
24
|
-
*
|
|
25
|
-
* @internal
|
|
26
|
-
*
|
|
27
|
-
* @template {any} T
|
|
28
|
-
* The resolved value of `fn`
|
|
29
|
-
* @template {any} [R=unknown]
|
|
30
|
-
* The previous resolved value
|
|
31
|
-
* @template {any[]} [P=any[]]
|
|
32
|
-
* The function parameters
|
|
33
|
-
* @template {any} [Self=unknown]
|
|
34
|
-
* The `this` context of `fn`
|
|
35
|
-
*
|
|
36
|
-
* @this {void}
|
|
37
|
-
*
|
|
38
|
-
* @param {Awaitable<R>} promise
|
|
39
|
-
* The promise to chain or the resolved value
|
|
40
|
-
* @param {(this: Self, ...params: ChainParams<R, P>) => Awaitable<T>} fn
|
|
41
|
-
* The function to call
|
|
42
|
-
* @param {(e: unknown) => Awaitable<T>} [reject]
|
|
43
|
-
* The callback to fire when a promise is rejected
|
|
44
|
-
* @param {Self | null | undefined} [self]
|
|
45
|
-
* The `this` context of `fn`
|
|
46
|
-
* @param {P} params
|
|
47
|
-
* The arguments to pass to `fn`
|
|
48
|
-
* @return {Awaitable<T>}
|
|
49
|
-
* A new promise to resolve or the result of `fn`
|
|
50
|
-
*/
|
|
51
|
-
declare function chainOrCall<T = unknown, R = unknown, P extends any[] = any[], Self = unknown>(this: void, promise: Awaitable<R>, fn: (this: Self, ...params: ChainParams<R, P>) => Awaitable<T>, reject?: (e: unknown) => Awaitable<T>, self?: Self | null | undefined, ...params: P): Awaitable<T>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a=Object.defineProperty;var i=(l,t)=>a(l,"name",{value:t,configurable:!0});import e from"#internal/is-promise";var f=u;function u(l,t,n,r,...c){return e(l)?l.then(o=>t.call(r,...c,o),n):t.call(r,...c)}i(u,"chainOrCall");export{f as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Internal - chars
|
|
3
|
-
* @module mlly/internal/chars
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Characters that may have special meaning.
|
|
7
|
-
*
|
|
8
|
-
* @enum {string}
|
|
9
|
-
*/
|
|
10
|
-
declare enum chars {
|
|
11
|
-
asterisk = "*",
|
|
12
|
-
at = "@",
|
|
13
|
-
empty = "",
|
|
14
|
-
hash = "#"
|
|
15
|
-
}
|
|
16
|
-
export default chars;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Internal - checkInvalidSegments
|
|
3
|
-
* @module mlly/internal/checkInvalidSegments
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Check `str` for invalid path segments.
|
|
7
|
-
*
|
|
8
|
-
* @internal
|
|
9
|
-
*
|
|
10
|
-
* @this {void}
|
|
11
|
-
*
|
|
12
|
-
* @param {string} str
|
|
13
|
-
* The package target or subpath pattern match to check
|
|
14
|
-
* @return {boolean}
|
|
15
|
-
* `true` if `str` contains invalid path segments, `false` otherwise
|
|
16
|
-
*/
|
|
17
|
-
declare function checkInvalidSegments(this: void, str: string): boolean;
|
|
18
|
-
export default checkInvalidSegments;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Internal - constant
|
|
3
|
-
* @module mlly/internal/constant
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Create a function that returns a constant value.
|
|
7
|
-
*
|
|
8
|
-
* @internal
|
|
9
|
-
*
|
|
10
|
-
* @template {unknown} T
|
|
11
|
-
* The value
|
|
12
|
-
*
|
|
13
|
-
* @this {void}
|
|
14
|
-
*
|
|
15
|
-
* @param {T} value
|
|
16
|
-
* The value
|
|
17
|
-
* @return {(this: void) => T}
|
|
18
|
-
* `value`
|
|
19
|
-
*/
|
|
20
|
-
declare function constant<T>(this: void, value: T): (this: void) => T;
|
|
21
|
-
export default constant;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Internal - fs/browser
|
|
3
|
-
* @module mlly/internal/fs/browser
|
|
4
|
-
*/
|
|
5
|
-
import type { FileSystem } from '@flex-development/mlly';
|
|
6
|
-
/**
|
|
7
|
-
* The file system API.
|
|
8
|
-
*
|
|
9
|
-
* @const {FileSystem} fs
|
|
10
|
-
*/
|
|
11
|
-
declare const fs: FileSystem;
|
|
12
|
-
export default fs;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Internal - identity
|
|
3
|
-
* @module mlly/internal/identity
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Return a constant value.
|
|
7
|
-
*
|
|
8
|
-
* @internal
|
|
9
|
-
*
|
|
10
|
-
* @template {unknown} T
|
|
11
|
-
* The value
|
|
12
|
-
*
|
|
13
|
-
* @this {void}
|
|
14
|
-
*
|
|
15
|
-
* @param {T} value
|
|
16
|
-
* The value
|
|
17
|
-
* @return {T}
|
|
18
|
-
* `value`
|
|
19
|
-
*/
|
|
20
|
-
declare function identity<T>(this: void, value: T): T;
|
|
21
|
-
export default identity;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Internal - invalidPackageTarget
|
|
3
|
-
* @module mlly/internal/invalidPackageTarget
|
|
4
|
-
*/
|
|
5
|
-
import { type ErrInvalidPackageTarget } from '@flex-development/errnode';
|
|
6
|
-
import type { ModuleId } from '@flex-development/mlly';
|
|
7
|
-
/**
|
|
8
|
-
* Create an {@linkcode ERR_INVALID_PACKAGE_TARGET} error.
|
|
9
|
-
*
|
|
10
|
-
* @see {@linkcode ErrInvalidPackageTarget}
|
|
11
|
-
* @see {@linkcode ModuleId}
|
|
12
|
-
*
|
|
13
|
-
* @internal
|
|
14
|
-
*
|
|
15
|
-
* @this {void}
|
|
16
|
-
*
|
|
17
|
-
* @param {ModuleId} packageUrl
|
|
18
|
-
* The URL of the directory containing the `package.json` file
|
|
19
|
-
* @param {string} subpath
|
|
20
|
-
* The subpath pattern
|
|
21
|
-
* @param {unknown} target
|
|
22
|
-
* The invalid package target
|
|
23
|
-
* @param {boolean | null | undefined} [isImports]
|
|
24
|
-
* Whether `target` is internal to the package
|
|
25
|
-
* @param {ModuleId | null | undefined} [parent]
|
|
26
|
-
* The URL of the parent module
|
|
27
|
-
* @return {ErrInvalidPackageTarget}
|
|
28
|
-
* New node error
|
|
29
|
-
*/
|
|
30
|
-
declare function invalidPackageTarget(this: void, packageUrl: ModuleId, subpath: string, target: unknown, isImports?: boolean | null | undefined, parent?: ModuleId | null | undefined): ErrInvalidPackageTarget;
|
|
31
|
-
export default invalidPackageTarget;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Internal - invalidSubpath
|
|
3
|
-
* @module mlly/internal/invalidSubpath
|
|
4
|
-
*/
|
|
5
|
-
import { type ErrInvalidModuleSpecifier } from '@flex-development/errnode';
|
|
6
|
-
import type { ModuleId } from '@flex-development/mlly';
|
|
7
|
-
/**
|
|
8
|
-
* Create an {@linkcode ERR_INVALID_MODULE_SPECIFIER} error for an invalid
|
|
9
|
-
* subpath pattern match.
|
|
10
|
-
*
|
|
11
|
-
* @see {@linkcode ErrInvalidModuleSpecifier}
|
|
12
|
-
* @see {@linkcode ModuleId}
|
|
13
|
-
*
|
|
14
|
-
* @internal
|
|
15
|
-
*
|
|
16
|
-
* @this {void}
|
|
17
|
-
*
|
|
18
|
-
* @param {string} subpath
|
|
19
|
-
* The subpath pattern
|
|
20
|
-
* @param {string} patternMatch
|
|
21
|
-
* The subpath pattern match
|
|
22
|
-
* @param {ModuleId} packageUrl
|
|
23
|
-
* The URL of the directory containing the `package.json` file
|
|
24
|
-
* @param {boolean | null | undefined} [isImports]
|
|
25
|
-
* Whether `target` is internal to the package
|
|
26
|
-
* @param {ModuleId | null | undefined} [parent]
|
|
27
|
-
* The URL of the parent module
|
|
28
|
-
* @return {ErrInvalidModuleSpecifier}
|
|
29
|
-
* New node error
|
|
30
|
-
*/
|
|
31
|
-
declare function invalidSubpath(this: void, subpath: string, patternMatch: string, packageUrl: ModuleId, isImports?: boolean | null | undefined, parent?: ModuleId | null | undefined): ErrInvalidModuleSpecifier;
|
|
32
|
-
export default invalidSubpath;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Internal - isPromise
|
|
3
|
-
* @module mlly/internal/isPromise
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Check if `value` is a {@linkcode PromiseLike} object.
|
|
7
|
-
*
|
|
8
|
-
* @internal
|
|
9
|
-
*
|
|
10
|
-
* @template {any} T
|
|
11
|
-
* The resolved value of the promise
|
|
12
|
-
*
|
|
13
|
-
* @this {void}
|
|
14
|
-
*
|
|
15
|
-
* @param {unknown} value
|
|
16
|
-
* The thing to check
|
|
17
|
-
* @return {value is PromiseLike<T>}
|
|
18
|
-
* `true` if `value` is {@linkcode PromiseLike}, `false` otherwise
|
|
19
|
-
*/
|
|
20
|
-
declare function isPromise<T>(this: void, value: unknown): value is PromiseLike<T>;
|
|
21
|
-
export default isPromise;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.defineProperty;var n=(t,o)=>e(t,"name",{value:o,configurable:!0});function f(t){return typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"}n(f,"isPromise");var r=f;export{r as default};
|