@dropins/tools 1.5.1-alpha2861 → 1.5.1-beta1

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/lib/aem/assets.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{getConfigValue as O}from"./configs.js";import{p as f,I as g}from"../../chunks/Image.js";import"../../chunks/get-path-value.js";import"../../chunks/cjs.js";import"../../preact-jsx-runtime.js";import"../../chunks/icons/Add.js";import"../../i18n.js";import"../../chunks/vcomponent.js";import"../../chunks/image-params-keymap.js";import"../../signals.js";const b=["gif","jpg","jpeg","png","webp"],v=[90,180,270],U=["h","v","hv"];function l(e){let t=e;if(t.startsWith("//")){const{protocol:s}=window.location;t=s+t}return t}function I(e){return U.includes(e)}function L(e){return v.includes(e)}function y(e){return b.includes(e)}function u(e,t,s){if(e!==void 0&&!t(e))throw new Error(s)}function h(){const e=O("commerce-assets-enabled");return e&&(typeof e=="string"&&e.toLowerCase()==="true"||typeof e=="boolean"&&e===!0)}function R(){return{quality:80,format:"webp"}}function A(e){return!!(typeof e=="string"?new URL(l(e)):e).pathname.startsWith("/adobe/assets/urn:aaid:aem")}function w(e,t,s={}){const r={...R(),...s},{format:i,crop:n,...o}=r;u(i,y,"Invalid format"),u(o.flip,I,"Invalid flip"),u(o.rotate,L,"Invalid rotation");const a=Object.fromEntries(Object.entries(o).map(([p,d])=>[p,String(d)])),c=new URLSearchParams(a);if(n){const[p,d]=[n.xOrigin||0,n.yOrigin||0],[P,E]=[n.width||100,n.height||100],S=`${p}p,${d}p,${P}p,${E}p`;c.set("crop",S)}return`${e}/as/${t}.${i}?${c.toString()}`}function q(e,t,s={}){if(!h())return e;const r=new URL(l(e));if(!A(r))return e;const i=r.origin+r.pathname;return w(i,t,s)}function _(e){return t=>{const{wrapper:s,alias:m,params:r,imageProps:i}=e;if(!i.src)throw new Error("An image source is required. Please provide a `src` or `imageProps.src`.");const n=s??document.createElement("div"),o=w(i.src,m,r),a={width:r.width,height:r.height,crop:void 0,fit:void 0,auto:void 0},c={...i,width:r.width,height:r.height,src:o,params:a};f.render(g,c)(n),t.replaceWith(n)}}function x(e,t){function s(){const i=t.wrapper??document.createElement("div"),{imageProps:n,params:o}=t,a={...n,width:o.width,height:o.height};f.render(g,a)(i),e.replaceWith(i)}if(!h()){s();return}if(!t.imageProps.src)throw new Error("An image source is required. Please provide a `src` or `imageProps.src`.");const r=new URL(l(t.imageProps.src));if(!A(r)){s();return}_(t)(e)}export{w as generateAemAssetsOptimizedUrl,R as getDefaultAemAssetsOptimizationParams,h as isAemAssetsEnabled,A as isAemAssetsUrl,_ as makeAemAssetsImageSlot,q as tryGenerateAemAssetsOptimizedUrl,x as tryRenderAemAssetsImage};
3
+ import{getConfigValue as O}from"./configs.js";import{p as f,I as g}from"../../chunks/Image.js";import"../../chunks/cjs.js";import"../../chunks/get-path-value.js";import"../../preact-jsx-runtime.js";import"../../chunks/icons/Add.js";import"../../i18n.js";import"../../chunks/vcomponent.js";import"../../chunks/image-params-keymap.js";import"../../signals.js";const b=["gif","jpg","jpeg","png","webp"],v=[90,180,270],U=["h","v","hv"];function l(e){let t=e;if(t.startsWith("//")){const{protocol:s}=window.location;t=s+t}return t}function I(e){return U.includes(e)}function L(e){return v.includes(e)}function y(e){return b.includes(e)}function u(e,t,s){if(e!==void 0&&!t(e))throw new Error(s)}function h(){const e=O("commerce-assets-enabled");return e&&(typeof e=="string"&&e.toLowerCase()==="true"||typeof e=="boolean"&&e===!0)}function R(){return{quality:80,format:"webp"}}function A(e){return!!(typeof e=="string"?new URL(l(e)):e).pathname.startsWith("/adobe/assets/urn:aaid:aem")}function w(e,t,s={}){const r={...R(),...s},{format:i,crop:n,...o}=r;u(i,y,"Invalid format"),u(o.flip,I,"Invalid flip"),u(o.rotate,L,"Invalid rotation");const a=Object.fromEntries(Object.entries(o).map(([p,d])=>[p,String(d)])),c=new URLSearchParams(a);if(n){const[p,d]=[n.xOrigin||0,n.yOrigin||0],[P,E]=[n.width||100,n.height||100],S=`${p}p,${d}p,${P}p,${E}p`;c.set("crop",S)}return`${e}/as/${t}.${i}?${c.toString()}`}function q(e,t,s={}){if(!h())return e;const r=new URL(l(e));if(!A(r))return e;const i=r.origin+r.pathname;return w(i,t,s)}function _(e){return t=>{const{wrapper:s,alias:m,params:r,imageProps:i}=e;if(!i.src)throw new Error("An image source is required. Please provide a `src` or `imageProps.src`.");const n=s??document.createElement("div"),o=w(i.src,m,r),a={width:r.width,height:r.height,crop:void 0,fit:void 0,auto:void 0},c={...i,width:r.width,height:r.height,src:o,params:a};f.render(g,c)(n),t.replaceWith(n)}}function x(e,t){function s(){const i=t.wrapper??document.createElement("div"),{imageProps:n,params:o}=t,a={...n,width:o.width,height:o.height};f.render(g,a)(i),e.replaceWith(i)}if(!h()){s();return}if(!t.imageProps.src)throw new Error("An image source is required. Please provide a `src` or `imageProps.src`.");const r=new URL(l(t.imageProps.src));if(!A(r)){s();return}_(t)(e)}export{w as generateAemAssetsOptimizedUrl,R as getDefaultAemAssetsOptimizationParams,h as isAemAssetsEnabled,A as isAemAssetsUrl,_ as makeAemAssetsImageSlot,q as tryGenerateAemAssetsOptimizedUrl,x as tryRenderAemAssetsImage};
4
4
  //# sourceMappingURL=assets.js.map
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{g as o}from"../../chunks/get-path-value.js";import{d as c}from"../../chunks/cjs.js";let i=null,u=null,l=null;function w(){i=null,u=null,l=null}function s(t=i,e){return t?Object.keys(t==null?void 0:t.public).sort((n,r)=>{const f=n.split("/").filter(Boolean).length;return r.split("/").filter(Boolean).length-f}).find(n=>{var r;return window.location.pathname===n||(((r=e==null?void 0:e.match)==null?void 0:r.call(e,n))??window.location.pathname.startsWith(n))})??"/":(console.warn("No config found. Please call initializeConfig() first."),"/")}function g(){return i?Object.keys(i.public).filter(t=>t!=="default"):(console.warn("No config found. Please call initializeConfig() first."),[])}function z(){return g().length>=1}function P(t){if(!l)throw new Error("Configuration not initialized. Call initializeConfig() first.");const e=l.headers??{};return{...e.all??{},...e[t]??{}}}function h(t,e){var n;const a=(n=t.public)==null?void 0:n.default;return e==="/"||!t.public[e]?a:c(a,t.public[e])}function p(t,e){return i=t,u=s(i,{match:e==null?void 0:e.match}),l=h(i,u),l}function v(t){if(!l)throw new Error("Configuration not initialized. Call initializeConfig() first.");return o(l,t)}export{v as getConfigValue,P as getHeaders,g as getListOfRootPaths,s as getRootPath,p as initializeConfig,z as isMultistore,w as resetConfig};
3
+ import{d as c}from"../../chunks/cjs.js";import{g as s}from"../../chunks/get-path-value.js";let l=null,f=null,u=null,i=null;function z(){l=null,f=null,u=null,i=null}function g(e=l,t=f){return e?Object.keys(e==null?void 0:e.public).sort((n,r)=>{const o=n.split("/").filter(Boolean).length;return r.split("/").filter(Boolean).length-o}).find(n=>{var r;return window.location.pathname===n||(((r=t==null?void 0:t.match)==null?void 0:r.call(t,n))??window.location.pathname.startsWith(n))})??"/":(console.warn("No config found. Please call initializeConfig() first."),"/")}function h(){return l?Object.keys(l.public).filter(e=>e!=="default"):(console.warn("No config found. Please call initializeConfig() first."),[])}function P(){return h().length>=1}function p(e){if(!i)throw new Error("Configuration not initialized. Call initializeConfig() first.");const t=i.headers??{};return{...t.all??{},...t[e]??{}}}function d(e,t){var n;const a=(n=e.public)==null?void 0:n.default;return t==="/"||!e.public[t]?a:c(a,e.public[t])}function v(e,t){return l=e,f=t??null,u=g(l,{match:t==null?void 0:t.match}),i=d(l,u),i}function S(e){if(!i)throw new Error("Configuration not initialized. Call initializeConfig() first.");return s(i,e)}export{S as getConfigValue,p as getHeaders,h as getListOfRootPaths,g as getRootPath,v as initializeConfig,P as isMultistore,z as resetConfig};
4
4
  //# sourceMappingURL=configs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configs.js","sources":["/@dropins/tools/src/lib/aem/configs.ts"],"sourcesContent":["import { deepmerge } from '../deepmerge';\nimport { getPathValue } from '../get-path-value';\n\ninterface ConfigHeaders {\n all?: Record<string, string>;\n [key: string]: Record<string, string> | undefined;\n}\n\ninterface ConfigPublic {\n default: ConfigRoot;\n [key: string]: ConfigRoot;\n}\n\ninterface ConfigRoot {\n headers?: ConfigHeaders;\n [key: string]: any;\n}\n\ninterface Config {\n public: ConfigPublic;\n [key: string]: any;\n}\n\n// Private state\nlet config: Config | null = null;\nlet rootPath: string | null = null;\nlet rootConfig: ConfigRoot | null = null;\n\n/**\n * Reset the config state\n */\nfunction resetConfig() {\n config = null;\n rootPath = null;\n rootConfig = null;\n}\n\n/**\n * Get root path\n * @param {Object} [configObj=config] - The config object.\n * @returns {string} - The root path.\n */\nfunction getRootPath(configObj: Config | null = config, options?: { match?: (key: string) => boolean }): string {\n if (!configObj) {\n console.warn('No config found. Please call initializeConfig() first.');\n return '/';\n }\n\n const value = Object.keys(configObj?.public)\n // Sort by number of non-empty segments to find the deepest path\n .sort((a, b) => {\n const aSegments = a.split('/').filter(Boolean).length;\n const bSegments = b.split('/').filter(Boolean).length;\n return bSegments - aSegments;\n })\n .find(\n (key) =>\n window.location.pathname === key ||\n (options?.match?.(key) ?? window.location.pathname.startsWith(key))\n );\n\n return value ?? '/';\n}\n\n/**\n * Get list of root paths from public config\n * @returns {Array} - The list of root paths.\n */\nfunction getListOfRootPaths(): string[] {\n if (!config) {\n console.warn('No config found. Please call initializeConfig() first.');\n return [];\n }\n\n return Object.keys(config.public).filter((root) => root !== 'default');\n}\n\n/**\n * Checks if the public config contains more than \"default\"\n * @returns {boolean} - true if public config contains more than \"default\"\n */\nfunction isMultistore(): boolean {\n return getListOfRootPaths().length >= 1;\n}\n\n/**\n * Retrieves headers from config entries like commerce.headers.pdp.my-header, etc and\n * returns as object of all headers like { my-header: value, ... }\n * @param {string} scope - The scope of the headers to retrieve.\n * @returns {Object} - The headers.\n */\nfunction getHeaders(scope: string): Record<string, string> {\n if (!rootConfig) {\n throw new Error(\n 'Configuration not initialized. Call initializeConfig() first.'\n );\n }\n const headers = rootConfig.headers ?? {};\n return {\n ...(headers.all ?? {}),\n ...(headers[scope] ?? {}),\n };\n}\n\n/**\n * Applies config overrides from metadata.\n *\n * @param {Object} [configObj] - The base config.\n * @param {string} [root] - The root path.\n * @returns {Object} - The config with overrides applied.\n */\nfunction applyConfigOverrides(\n configObj: Config | null,\n root: string | null\n): ConfigRoot {\n const defaultConfig = configObj!.public?.default;\n\n if (root === '/' || !configObj!.public[root as keyof ConfigPublic])\n return defaultConfig;\n\n return deepmerge(\n defaultConfig,\n configObj!.public[root as keyof ConfigPublic]\n );\n}\n\n/**\n * Initializes the configuration system.\n * @param {Object} configObj - The config object.\n * @param {Object} [options] - The options object.\n * @param {Function} [options.match] - The function to match the path to the config.\n * @returns {Object} The initialized root configuration\n */\nfunction initializeConfig(configObj: Config, options?: { match?: (key: string) => boolean }): ConfigRoot {\n config = configObj;\n rootPath = getRootPath(config, { match: options?.match });\n rootConfig = applyConfigOverrides(config, rootPath);\n return rootConfig;\n}\n\n/**\n * Retrieves a configuration value.\n *\n * @param {string} configParam - The configuration parameter to retrieve.\n * @returns {string|undefined} - The value of the configuration parameter, or undefined.\n */\nfunction getConfigValue(configParam: string): any {\n if (!rootConfig) {\n throw new Error(\n 'Configuration not initialized. Call initializeConfig() first.'\n );\n }\n return getPathValue(rootConfig, configParam);\n}\n\nexport {\n initializeConfig,\n getRootPath,\n getListOfRootPaths,\n isMultistore,\n getConfigValue,\n getHeaders,\n resetConfig,\n};\n"],"names":["config","rootPath","rootConfig","resetConfig","getRootPath","configObj","options","a","b","aSegments","key","_a","getListOfRootPaths","root","isMultistore","getHeaders","scope","headers","applyConfigOverrides","defaultConfig","deepmerge","initializeConfig","getConfigValue","configParam","getPathValue"],"mappings":"2FAwBA,IAAIA,EAAwB,KACxBC,EAA0B,KAC1BC,EAAgC,KAKpC,SAASC,GAAc,CACZH,EAAA,KACEC,EAAA,KACEC,EAAA,IACf,CAOA,SAASE,EAAYC,EAA2BL,EAAQM,EAAwD,CAC9G,OAAKD,EAKS,OAAO,KAAKA,GAAA,YAAAA,EAAW,MAAM,EAExC,KAAK,CAACE,EAAGC,IAAM,CACd,MAAMC,EAAYF,EAAE,MAAM,GAAG,EAAE,OAAO,OAAO,EAAE,OAE/C,OADkBC,EAAE,MAAM,GAAG,EAAE,OAAO,OAAO,EAAE,OAC5BC,CACpB,CAAA,EACA,KACEC,GAAA,OACC,cAAO,SAAS,WAAaA,MAC5BC,EAAAL,GAAA,YAAAA,EAAS,QAAT,YAAAK,EAAA,KAAAL,EAAiBI,KAAQ,OAAO,SAAS,SAAS,WAAWA,CAAG,GACrE,GAEc,KAjBd,QAAQ,KAAK,wDAAwD,EAC9D,IAiBX,CAMA,SAASE,GAA+B,CACtC,OAAKZ,EAKE,OAAO,KAAKA,EAAO,MAAM,EAAE,OAAQa,GAASA,IAAS,SAAS,GAJnE,QAAQ,KAAK,wDAAwD,EAC9D,CAAC,EAIZ,CAMA,SAASC,GAAwB,CACxB,OAAAF,EAAA,EAAqB,QAAU,CACxC,CAQA,SAASG,EAAWC,EAAuC,CACzD,GAAI,CAACd,EACH,MAAM,IAAI,MACR,+DACF,EAEI,MAAAe,EAAUf,EAAW,SAAW,CAAC,EAChC,MAAA,CACL,GAAIe,EAAQ,KAAO,CAAC,EACpB,GAAIA,EAAQD,CAAK,GAAK,CAAA,CACxB,CACF,CASA,SAASE,EACPb,EACAQ,EACY,OACN,MAAAM,GAAgBR,EAAAN,EAAW,SAAX,YAAAM,EAAmB,QAEzC,OAAIE,IAAS,KAAO,CAACR,EAAW,OAAOQ,CAA0B,EACxDM,EAEFC,EACLD,EACAd,EAAW,OAAOQ,CAA0B,CAC9C,CACF,CASA,SAASQ,EAAiBhB,EAAmBC,EAA4D,CAC9F,OAAAN,EAAAK,EACTJ,EAAWG,EAAYJ,EAAQ,CAAE,MAAOM,GAAA,YAAAA,EAAS,MAAO,EAC3CJ,EAAAgB,EAAqBlB,EAAQC,CAAQ,EAC3CC,CACT,CAQA,SAASoB,EAAeC,EAA0B,CAChD,GAAI,CAACrB,EACH,MAAM,IAAI,MACR,+DACF,EAEK,OAAAsB,EAAatB,EAAYqB,CAAW,CAC7C"}
1
+ {"version":3,"file":"configs.js","sources":["/@dropins/tools/src/lib/aem/configs.ts"],"sourcesContent":["import { deepmerge } from '../deepmerge';\nimport { getPathValue } from '../get-path-value';\n\ninterface ConfigHeaders {\n all?: Record<string, string>;\n [key: string]: Record<string, string> | undefined;\n}\n\ninterface ConfigPublic {\n default: ConfigRoot;\n [key: string]: ConfigRoot;\n}\n\ninterface ConfigRoot {\n headers?: ConfigHeaders;\n [key: string]: any;\n}\n\ninterface Config {\n public: ConfigPublic;\n [key: string]: any;\n}\n\n// Private state\nlet config: Config | null = null;\nlet options: { match?: (key: string) => boolean } | null = null;\nlet rootPath: string | null = null;\nlet rootConfig: ConfigRoot | null = null;\n\n/**\n * Reset the config state\n */\nfunction resetConfig() {\n config = null;\n options = null;\n rootPath = null;\n rootConfig = null;\n}\n\n/**\n * Get root path\n * @param {Object} [configObj=config] - The config object.\n * @returns {string} - The root path.\n */\nfunction getRootPath(configObj: Config | null = config, optionsObj: { match?: (key: string) => boolean } | null = options): string {\n if (!configObj) {\n console.warn('No config found. Please call initializeConfig() first.');\n return '/';\n }\n\n const value = Object.keys(configObj?.public)\n // Sort by number of non-empty segments to find the deepest path\n .sort((a, b) => {\n const aSegments = a.split('/').filter(Boolean).length;\n const bSegments = b.split('/').filter(Boolean).length;\n return bSegments - aSegments;\n })\n .find(\n (key) =>\n window.location.pathname === key ||\n (optionsObj?.match?.(key) ?? window.location.pathname.startsWith(key))\n );\n\n return value ?? '/';\n}\n\n/**\n * Get list of root paths from public config\n * @returns {Array} - The list of root paths.\n */\nfunction getListOfRootPaths(): string[] {\n if (!config) {\n console.warn('No config found. Please call initializeConfig() first.');\n return [];\n }\n\n return Object.keys(config.public).filter((root) => root !== 'default');\n}\n\n/**\n * Checks if the public config contains more than \"default\"\n * @returns {boolean} - true if public config contains more than \"default\"\n */\nfunction isMultistore(): boolean {\n return getListOfRootPaths().length >= 1;\n}\n\n/**\n * Retrieves headers from config entries like commerce.headers.pdp.my-header, etc and\n * returns as object of all headers like { my-header: value, ... }\n * @param {string} scope - The scope of the headers to retrieve.\n * @returns {Object} - The headers.\n */\nfunction getHeaders(scope: string): Record<string, string> {\n if (!rootConfig) {\n throw new Error(\n 'Configuration not initialized. Call initializeConfig() first.'\n );\n }\n const headers = rootConfig.headers ?? {};\n return {\n ...(headers.all ?? {}),\n ...(headers[scope] ?? {}),\n };\n}\n\n/**\n * Applies config overrides from metadata.\n *\n * @param {Object} [configObj] - The base config.\n * @param {string} [root] - The root path.\n * @returns {Object} - The config with overrides applied.\n */\nfunction applyConfigOverrides(\n configObj: Config | null,\n root: string | null\n): ConfigRoot {\n const defaultConfig = configObj!.public?.default;\n\n if (root === '/' || !configObj!.public[root as keyof ConfigPublic])\n return defaultConfig;\n\n return deepmerge(\n defaultConfig,\n configObj!.public[root as keyof ConfigPublic]\n );\n}\n\n/**\n * Initializes the configuration system.\n * @param {Object} configObj - The config object.\n * @param {Object} [options] - The options object.\n * @param {Function} [options.match] - The function to match the path to the config.\n * @returns {Object} The initialized root configuration\n */\nfunction initializeConfig(configObj: Config, optionsObj?: { match?: (key: string) => boolean }): ConfigRoot {\n config = configObj;\n options = optionsObj ?? null;\n rootPath = getRootPath(config, { match: optionsObj?.match });\n rootConfig = applyConfigOverrides(config, rootPath);\n return rootConfig;\n}\n\n/**\n * Retrieves a configuration value.\n *\n * @param {string} configParam - The configuration parameter to retrieve.\n * @returns {string|undefined} - The value of the configuration parameter, or undefined.\n */\nfunction getConfigValue(configParam: string): any {\n if (!rootConfig) {\n throw new Error(\n 'Configuration not initialized. Call initializeConfig() first.'\n );\n }\n return getPathValue(rootConfig, configParam);\n}\n\nexport {\n initializeConfig,\n getRootPath,\n getListOfRootPaths,\n isMultistore,\n getConfigValue,\n getHeaders,\n resetConfig,\n};\n"],"names":["config","options","rootPath","rootConfig","resetConfig","getRootPath","configObj","optionsObj","a","b","aSegments","key","_a","getListOfRootPaths","root","isMultistore","getHeaders","scope","headers","applyConfigOverrides","defaultConfig","deepmerge","initializeConfig","getConfigValue","configParam","getPathValue"],"mappings":"2FAwBA,IAAIA,EAAwB,KACxBC,EAAuD,KACvDC,EAA0B,KAC1BC,EAAgC,KAKpC,SAASC,GAAc,CACZJ,EAAA,KACCC,EAAA,KACCC,EAAA,KACEC,EAAA,IACf,CAOA,SAASE,EAAYC,EAA2BN,EAAQO,EAA0DN,EAAiB,CACjI,OAAKK,EAKS,OAAO,KAAKA,GAAA,YAAAA,EAAW,MAAM,EAExC,KAAK,CAACE,EAAGC,IAAM,CACd,MAAMC,EAAYF,EAAE,MAAM,GAAG,EAAE,OAAO,OAAO,EAAE,OAE/C,OADkBC,EAAE,MAAM,GAAG,EAAE,OAAO,OAAO,EAAE,OAC5BC,CACpB,CAAA,EACA,KACEC,GAAA,OACC,cAAO,SAAS,WAAaA,MAC5BC,EAAAL,GAAA,YAAAA,EAAY,QAAZ,YAAAK,EAAA,KAAAL,EAAoBI,KAAQ,OAAO,SAAS,SAAS,WAAWA,CAAG,GACxE,GAEc,KAjBd,QAAQ,KAAK,wDAAwD,EAC9D,IAiBX,CAMA,SAASE,GAA+B,CACtC,OAAKb,EAKE,OAAO,KAAKA,EAAO,MAAM,EAAE,OAAQc,GAASA,IAAS,SAAS,GAJnE,QAAQ,KAAK,wDAAwD,EAC9D,CAAC,EAIZ,CAMA,SAASC,GAAwB,CACxB,OAAAF,EAAA,EAAqB,QAAU,CACxC,CAQA,SAASG,EAAWC,EAAuC,CACzD,GAAI,CAACd,EACH,MAAM,IAAI,MACR,+DACF,EAEI,MAAAe,EAAUf,EAAW,SAAW,CAAC,EAChC,MAAA,CACL,GAAIe,EAAQ,KAAO,CAAC,EACpB,GAAIA,EAAQD,CAAK,GAAK,CAAA,CACxB,CACF,CASA,SAASE,EACPb,EACAQ,EACY,OACN,MAAAM,GAAgBR,EAAAN,EAAW,SAAX,YAAAM,EAAmB,QAEzC,OAAIE,IAAS,KAAO,CAACR,EAAW,OAAOQ,CAA0B,EACxDM,EAEFC,EACLD,EACAd,EAAW,OAAOQ,CAA0B,CAC9C,CACF,CASA,SAASQ,EAAiBhB,EAAmBC,EAA+D,CACjG,OAAAP,EAAAM,EACTL,EAAUM,GAAc,KACxBL,EAAWG,EAAYL,EAAQ,CAAE,MAAOO,GAAA,YAAAA,EAAY,MAAO,EAC9CJ,EAAAgB,EAAqBnB,EAAQE,CAAQ,EAC3CC,CACT,CAQA,SAASoB,EAAeC,EAA0B,CAChD,GAAI,CAACrB,EACH,MAAM,IAAI,MACR,+DACF,EAEK,OAAAsB,EAAatB,EAAYqB,CAAW,CAC7C"}
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/tools", "version": "1.5.1-alpha2861", "license": "SEE LICENSE IN LICENSE.md"}
1
+ {"name": "@dropins/tools", "version": "1.5.1-beta1", "license": "SEE LICENSE IN LICENSE.md"}
@@ -23,9 +23,9 @@ declare function resetConfig(): void;
23
23
  * @param {Object} [configObj=config] - The config object.
24
24
  * @returns {string} - The root path.
25
25
  */
26
- declare function getRootPath(configObj?: Config | null, options?: {
26
+ declare function getRootPath(configObj?: Config | null, optionsObj?: {
27
27
  match?: (key: string) => boolean;
28
- }): string;
28
+ } | null): string;
29
29
  /**
30
30
  * Get list of root paths from public config
31
31
  * @returns {Array} - The list of root paths.
@@ -50,7 +50,7 @@ declare function getHeaders(scope: string): Record<string, string>;
50
50
  * @param {Function} [options.match] - The function to match the path to the config.
51
51
  * @returns {Object} The initialized root configuration
52
52
  */
53
- declare function initializeConfig(configObj: Config, options?: {
53
+ declare function initializeConfig(configObj: Config, optionsObj?: {
54
54
  match?: (key: string) => boolean;
55
55
  }): ConfigRoot;
56
56
  /**