@isdk/util 0.1.4 → 0.1.5

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/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.create,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,i=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,a=(e,t,i,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let f of o(t))s.call(e,f)||f===i||r(e,f,{get:()=>t[f],enumerable:!(a=n(t,f))||a.enumerable});return e},f=(e,n,o)=>(o=null!=e?t(i(e)):{},a(!n&&e&&e.__esModule?o:r(o,"default",{value:e,enumerable:!0}),e)),u={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(u,{ConfigFile:()=>w,DefaultAllTextFiles:()=>T,getMultiLevelExtname:()=>y,glob:()=>A,isStringIn:()=>C,normalizeIncludeFiles:()=>k,parseFrontMatter:()=>q,parseYaml:()=>d,registerYamlTag:()=>b,removeLeadingEmptyLines:()=>j,stringifyYaml:()=>h,toCamelCase:()=>M,toCapitalCase:()=>Y,toPascalCase:()=>E,traverseFolder:()=>S,traverseFolderSync:()=>_}),module.exports=(e=u,a(r({},"__esModule",{value:!0}),e));var l=require("fs"),c=f(require("path")),m=require("load-config-file"),p=f(require("path"));function y(e,t=1){let r="";for(;t--;){const t=p.default.extname(e);if(!t)break;r=t+r,e=p.default.basename(e,t)}return r}var g=require("yaml"),v=[];function b(e){Array.isArray(e)||(e=[e]);for(const t of e){-1===v.indexOf(t)&&v.push(t)}}function d(e,t){if(t)if(t.customTags){if(Array.isArray(t.customTags))t.customTags=v.concat(t.customTags);else if("function"==typeof t.customTags){const e=t.customTags;t.customTags=t=>e(v.concat(t))}}else t.customTags=v;else t={customTags:v};return(0,g.parse)(e,t)}function h(e,t){if(t)if(t.customTags){if(Array.isArray(t.customTags))t.customTags=v.concat(t.customTags);else if("function"==typeof t.customTags){const e=t.customTags;t.customTags=t=>e(v.concat(t))}}else t.customTags=v;else t={customTags:v};return(0,g.stringify)(e,t)}function j(e){const t=/^\s*(#[^\r\n]*)?[\r\n]+/;let r;for(;null!==(r=t.exec(e))&&((e=e.substring(r[0].length)).startsWith("\n")||e.startsWith("\r")||e.trimStart().startsWith("#")););return e}var x="---";function q(e,t=x){const r=t.length,n=j(e);if(n.startsWith(t)&&("\n"===n[t.length]||"\r"===n[t.length])){let e=n.indexOf("\n"+t,r);if(-1!==e){const o=n.slice(r,e);for(e+=t.length+1;"\n"===n[e]||"\r"===n[e];)e++;const i=n.slice(e);return{data:d(o)||{},content:i}}}return{data:{},content:e}}var w=class{static register(e,t,r){m.Config.register(e,t),"string"==typeof e&&(e=[e]);for(const t of e)this.stringifys[t]=r}static load(e,t){return function(e,{extLevel:t=1,externalFile:r}={}){"."===e[0]&&t++;const n=y(e,t);n&&n.split(".").length>1&&(e=e.slice(0,-n.length));let o=m.Config.loadSync(e);if(!o&&r){if(!c.default.isAbsolute(r)){const t=c.default.dirname(e);r=c.default.join(t,r)}if((0,l.existsSync)(r)){const e=q((0,l.readFileSync)(r,"utf8")).data;Object.keys(e).length&&(o=e)}}return o}(e,t)}static save(e,t,r){return function(e,t,{extLevel:r=1}={}){"."===e[0]&&r++;let n=y(e,r);(!n||n.split(".").length<=1)&&(e+=".yaml",n=".yaml");const o=w.stringifys[n];if(!o)throw new Error(`${e} unsupported mime type: ${n}`);t=o(t);const i=c.default.dirname(e);(0,l.existsSync)(i)||(0,l.mkdirSync)(i,{recursive:!0});return(0,l.writeFileSync)(e,t,{encoding:"utf8"}),e}(e,t,r)}};w.stringifys={},w.register([".yml",".yaml"],d,h),w.register([".json"],(function(e){return JSON.parse(e)}),(e=>JSON.stringify(e,null,2)));var F=require("@isdk/glob"),O=f(require("path"));function A(e,t,r){return r&&(e=O.default.relative(r,e)),(0,F.globMatch)(e,t)}function C(e,t){return"string"==typeof t&&(t=[t]),-1!==t.indexOf(e)}var T=["**/*.((j|t)s?(x)|m(j|t)s)?(x)","**/*.(md|markdown|txt|?(x)htm?(l)|yaml|yml|xml|json|bat|sh|bash|zsh|ini|css|scss|less|sass|py|rb|php|go|java|c|cpp|h|hpp|hxx|rust|zig)"];function k(e,t=T){if(e)if(Array.isArray(e))e=[...e];else{const r=e.include||[],n=e.exclude||[];0===r.length&&r.push(...t),e=[...r];for(const t of n)e.push(`!${t}`)}else e=[...t];return 0===e.length&&e.push(...t),e}var L=require("fs/promises"),$=require("fs"),z=f(require("path"));async function S(e,t){const r=await(0,L.readdir)(e,{withFileTypes:!0});for(const n of r){const r=z.default.join(e,n.name);if(n.isDirectory()){await t(r,n)||await S(r,t)}else{if(!0===await t(r,n))break}}}function _(e,t){const r=(0,$.readdirSync)(e,{withFileTypes:!0});for(const n of r){const r=z.default.join(e,n.name);if(n.isDirectory()){t(r,n)||S(r,t)}else{if(!0===t(r,n))break}}}function E(e){if(!e)return"";return e.replace(/[-_ ]+/g," ").split(" ").filter(Boolean).map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("")}function M(e){return(e=E(e)).charAt(0).toLowerCase()+e.slice(1)}function Y(e){if(!e)return"";return e.replace(/[-_ ]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").split(" ").filter(Boolean).map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join(" ")}
1
+ "use strict";var e,t=Object.create,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,a=(e,t,s,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let c of o(t))i.call(e,c)||c===s||r(e,c,{get:()=>t[c],enumerable:!(a=n(t,c))||a.enumerable});return e},c=(e,n,o)=>(o=null!=e?t(s(e)):{},a(!n&&e&&e.__esModule?o:r(o,"default",{value:e,enumerable:!0}),e)),f={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(f,{ConfigFile:()=>w,DefaultAllTextFiles:()=>C,getMultiLevelExtname:()=>y,glob:()=>$,isStringIn:()=>A,normalizeIncludeFiles:()=>T,parseFrontMatter:()=>q,parseYaml:()=>h,registerYamlTag:()=>b,removeLeadingEmptyLines:()=>j,stringifyYaml:()=>d,toCamelCase:()=>M,toCapitalCase:()=>Y,toPascalCase:()=>_,traverseFolder:()=>z,traverseFolderSync:()=>S}),module.exports=(e=f,a(r({},"__esModule",{value:!0}),e));var l=require("fs"),u=c(require("path")),m=require("load-config-file"),p=c(require("path"));function y(e,t=1){let r="";for(;t--;){const t=p.default.extname(e);if(!t)break;r=t+r,e=p.default.basename(e,t)}return r}var g=require("yaml"),v=[];function b(e){Array.isArray(e)||(e=[e]);for(const t of e){-1===v.indexOf(t)&&v.push(t)}}function h(e,t){if(t)if(t.customTags){if(Array.isArray(t.customTags))t.customTags=v.concat(t.customTags);else if("function"==typeof t.customTags){const e=t.customTags;t.customTags=t=>e(v.concat(t))}}else t.customTags=v;else t={customTags:v};return(0,g.parse)(e,t)}function d(e,t){if(t)if(t.customTags){if(Array.isArray(t.customTags))t.customTags=v.concat(t.customTags);else if("function"==typeof t.customTags){const e=t.customTags;t.customTags=t=>e(v.concat(t))}}else t.customTags=v;else t={customTags:v};return(0,g.stringify)(e,t)}function j(e){const t=/^\s*(#[^\r\n]*)?[\r\n]+/;let r;for(;null!==(r=t.exec(e))&&((e=e.substring(r[0].length)).startsWith("\n")||e.startsWith("\r")||e.trimStart().startsWith("#")););return e}var x="---";function q(e,t=x){const r=t.length,n=j(e);if(n.startsWith(t)&&("\n"===n[t.length]||"\r"===n[t.length])){let e=n.indexOf("\n"+t,r);if(-1!==e){const o=n.slice(r,e);for(e+=t.length+1;"\n"===n[e]||"\r"===n[e];)e++;const s=n.slice(e);return{data:h(o)||{},content:s}}}return{data:{},content:e}}var w=class{static register(e,t,r){m.Config.register(e,t),"string"==typeof e&&(e=[e]);for(const t of e)this.stringifys[t]=r}static load(e,t){return function(e,{extLevel:t=1,externalFile:r}={}){"."===e[0]&&t++;const n=y(e,t);n&&n.split(".").length>1&&(e=e.slice(0,-n.length));let o=m.Config.loadSync(e);if(!o&&r){if(!u.default.isAbsolute(r)){const t=u.default.dirname(e);r=u.default.join(t,r)}if((0,l.existsSync)(r)){const e=q((0,l.readFileSync)(r,"utf8")).data;Object.keys(e).length&&(o=e)}}return o}(e,t)}static save(e,t,r){return function(e,t,{extLevel:r=1}={}){"."===e[0]&&r++;let n=y(e,r);(!n||n.split(".").length<=1)&&(e+=".yaml",n=".yaml");const o=w.stringifys[n];if(!o)throw new Error(`${e} unsupported mime type: ${n}`);t=o(t);const s=u.default.dirname(e);(0,l.existsSync)(s)||(0,l.mkdirSync)(s,{recursive:!0});return(0,l.writeFileSync)(e,t,{encoding:"utf8"}),e}(e,t,r)}};w.stringifys={},w.register([".yml",".yaml"],h,d),w.register([".json"],(function(e){return JSON.parse(e)}),(e=>JSON.stringify(e,null,2)));var F=require("@isdk/glob"),O=c(require("path"));function $(e,t,r){return r&&(e=O.default.relative(r,e)),(0,F.globMatch)(e,t)}function A(e,t){return"string"==typeof t&&(t=[t]),-1!==t.indexOf(e)}var C=["**/*.((j|t)s?(x)|m(j|t)s)?(x)","**/*.(md|markdown|txt|?(x)htm?(l)|yaml|yml|xml|json|bat|sh|bash|zsh|ini|css|scss|less|sass|py|rb|php|go|java|c|cpp|h|hpp|hxx|rust|zig)"];function T(e,t=C){if(e)if(Array.isArray(e))e=[...e];else{const r=e.include||[],n=e.exclude||[];0===r.length&&r.push(...t),e=[...r];for(const t of n)e.push(`!${t}`)}else e=[...t];return 0===e.length&&e.push(...t),e}var k=require("fs/promises"),E=require("fs"),L=c(require("path"));async function z(e,t){const r=await(0,k.readdir)(e,{withFileTypes:!0});for(const n of r){const r=L.default.join(e,n.name);try{if(n.isDirectory()){await t(r,n)||await z(r,t)}else{if(!0===await t(r,n))break}}catch(e){console.error(`Error processing file: ${r}`),console.error(e)}}}function S(e,t){const r=(0,E.readdirSync)(e,{withFileTypes:!0});for(const n of r){const r=L.default.join(e,n.name);try{if(n.isDirectory()){t(r,n)||z(r,t)}else{if(!0===t(r,n))break}}catch(e){console.error(`Error processing file: ${r}`),console.error(e)}}}function _(e){if(!e)return"";return e.replace(/[-_ ]+/g," ").split(" ").filter(Boolean).map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("")}function M(e){return(e=_(e)).charAt(0).toLowerCase()+e.slice(1)}function Y(e){if(!e)return"";return e.replace(/[-_ ]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").split(" ").filter(Boolean).map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join(" ")}
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{existsSync as t,mkdirSync as n,readFileSync as r,writeFileSync as o}from"fs";import e from"path";import{Config as i}from"load-config-file";import f from"path";function s(t,n=1){let r="";for(;n--;){const n=f.extname(t);if(!n)break;r=n+r,t=f.basename(t,n)}return r}import{parse as c,stringify as a}from"yaml";var u=[];function l(t){Array.isArray(t)||(t=[t]);for(const n of t){-1===u.indexOf(n)&&u.push(n)}}function m(t,n){if(n)if(n.customTags){if(Array.isArray(n.customTags))n.customTags=u.concat(n.customTags);else if("function"==typeof n.customTags){const t=n.customTags;n.customTags=n=>t(u.concat(n))}}else n.customTags=u;else n={customTags:u};return c(t,n)}function p(t,n){if(n)if(n.customTags){if(Array.isArray(n.customTags))n.customTags=u.concat(n.customTags);else if("function"==typeof n.customTags){const t=n.customTags;n.customTags=n=>t(u.concat(n))}}else n.customTags=u;else n={customTags:u};return a(t,n)}function y(t){const n=/^\s*(#[^\r\n]*)?[\r\n]+/;let r;for(;null!==(r=n.exec(t))&&((t=t.substring(r[0].length)).startsWith("\n")||t.startsWith("\r")||t.trimStart().startsWith("#")););return t}function h(t,n="---"){const r=n.length,o=y(t);if(o.startsWith(n)&&("\n"===o[n.length]||"\r"===o[n.length])){let t=o.indexOf("\n"+n,r);if(-1!==t){const e=o.slice(r,t);for(t+=n.length+1;"\n"===o[t]||"\r"===o[t];)t++;const i=o.slice(t);return{data:m(e)||{},content:i}}}return{data:{},content:t}}var g=class{static register(t,n,r){i.register(t,n),"string"==typeof t&&(t=[t]);for(const n of t)this.stringifys[n]=r}static load(n,o){return function(n,{extLevel:o=1,externalFile:f}={}){"."===n[0]&&o++;const c=s(n,o);c&&c.split(".").length>1&&(n=n.slice(0,-c.length));let a=i.loadSync(n);if(!a&&f){if(!e.isAbsolute(f)){const t=e.dirname(n);f=e.join(t,f)}if(t(f)){const t=h(r(f,"utf8")).data;Object.keys(t).length&&(a=t)}}return a}(n,o)}static save(r,i,f){return function(r,i,{extLevel:f=1}={}){"."===r[0]&&f++;let c=s(r,f);(!c||c.split(".").length<=1)&&(r+=".yaml",c=".yaml");const a=g.stringifys[c];if(!a)throw new Error(`${r} unsupported mime type: ${c}`);i=a(i);const u=e.dirname(r);t(u)||n(u,{recursive:!0});return o(r,i,{encoding:"utf8"}),r}(r,i,f)}};g.stringifys={},g.register([".yml",".yaml"],m,p),g.register([".json"],(function(t){return JSON.parse(t)}),(t=>JSON.stringify(t,null,2)));import{globMatch as x}from"@isdk/glob";import d from"path";function w(t,n,r){return r&&(t=d.relative(r,t)),x(t,n)}function b(t,n){return"string"==typeof n&&(n=[n]),-1!==n.indexOf(t)}var v=["**/*.((j|t)s?(x)|m(j|t)s)?(x)","**/*.(md|markdown|txt|?(x)htm?(l)|yaml|yml|xml|json|bat|sh|bash|zsh|ini|css|scss|less|sass|py|rb|php|go|java|c|cpp|h|hpp|hxx|rust|zig)"];function j(t,n=v){if(t)if(Array.isArray(t))t=[...t];else{const r=t.include||[],o=t.exclude||[];0===r.length&&r.push(...n),t=[...r];for(const n of o)t.push(`!${n}`)}else t=[...n];return 0===t.length&&t.push(...n),t}import{readdir as k}from"fs/promises";import{readdirSync as A}from"fs";import $ from"path";async function T(t,n){const r=await k(t,{withFileTypes:!0});for(const o of r){const r=$.join(t,o.name);if(o.isDirectory()){await n(r,o)||await T(r,n)}else{if(!0===await n(r,o))break}}}function z(t,n){const r=A(t,{withFileTypes:!0});for(const o of r){const r=$.join(t,o.name);if(o.isDirectory()){n(r,o)||T(r,n)}else{if(!0===n(r,o))break}}}function F(t){if(!t)return"";return t.replace(/[-_ ]+/g," ").split(" ").filter(Boolean).map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join("")}function O(t){return(t=F(t)).charAt(0).toLowerCase()+t.slice(1)}function B(t){if(!t)return"";return t.replace(/[-_ ]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").split(" ").filter(Boolean).map((t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())).join(" ")}export{g as ConfigFile,v as DefaultAllTextFiles,s as getMultiLevelExtname,w as glob,b as isStringIn,j as normalizeIncludeFiles,h as parseFrontMatter,m as parseYaml,l as registerYamlTag,y as removeLeadingEmptyLines,p as stringifyYaml,O as toCamelCase,B as toCapitalCase,F as toPascalCase,T as traverseFolder,z as traverseFolderSync};
1
+ import{existsSync as t,mkdirSync as n,readFileSync as o,writeFileSync as r}from"fs";import e from"path";import{Config as s}from"load-config-file";import i from"path";function f(t,n=1){let o="";for(;n--;){const n=i.extname(t);if(!n)break;o=n+o,t=i.basename(t,n)}return o}import{parse as c,stringify as a}from"yaml";var l=[];function u(t){Array.isArray(t)||(t=[t]);for(const n of t){-1===l.indexOf(n)&&l.push(n)}}function m(t,n){if(n)if(n.customTags){if(Array.isArray(n.customTags))n.customTags=l.concat(n.customTags);else if("function"==typeof n.customTags){const t=n.customTags;n.customTags=n=>t(l.concat(n))}}else n.customTags=l;else n={customTags:l};return c(t,n)}function p(t,n){if(n)if(n.customTags){if(Array.isArray(n.customTags))n.customTags=l.concat(n.customTags);else if("function"==typeof n.customTags){const t=n.customTags;n.customTags=n=>t(l.concat(n))}}else n.customTags=l;else n={customTags:l};return a(t,n)}function y(t){const n=/^\s*(#[^\r\n]*)?[\r\n]+/;let o;for(;null!==(o=n.exec(t))&&((t=t.substring(o[0].length)).startsWith("\n")||t.startsWith("\r")||t.trimStart().startsWith("#")););return t}function h(t,n="---"){const o=n.length,r=y(t);if(r.startsWith(n)&&("\n"===r[n.length]||"\r"===r[n.length])){let t=r.indexOf("\n"+n,o);if(-1!==t){const e=r.slice(o,t);for(t+=n.length+1;"\n"===r[t]||"\r"===r[t];)t++;const s=r.slice(t);return{data:m(e)||{},content:s}}}return{data:{},content:t}}var g=class{static register(t,n,o){s.register(t,n),"string"==typeof t&&(t=[t]);for(const n of t)this.stringifys[n]=o}static load(n,r){return function(n,{extLevel:r=1,externalFile:i}={}){"."===n[0]&&r++;const c=f(n,r);c&&c.split(".").length>1&&(n=n.slice(0,-c.length));let a=s.loadSync(n);if(!a&&i){if(!e.isAbsolute(i)){const t=e.dirname(n);i=e.join(t,i)}if(t(i)){const t=h(o(i,"utf8")).data;Object.keys(t).length&&(a=t)}}return a}(n,r)}static save(o,s,i){return function(o,s,{extLevel:i=1}={}){"."===o[0]&&i++;let c=f(o,i);(!c||c.split(".").length<=1)&&(o+=".yaml",c=".yaml");const a=g.stringifys[c];if(!a)throw new Error(`${o} unsupported mime type: ${c}`);s=a(s);const l=e.dirname(o);t(l)||n(l,{recursive:!0});return r(o,s,{encoding:"utf8"}),o}(o,s,i)}};g.stringifys={},g.register([".yml",".yaml"],m,p),g.register([".json"],(function(t){return JSON.parse(t)}),(t=>JSON.stringify(t,null,2)));import{globMatch as x}from"@isdk/glob";import d from"path";function w(t,n,o){return o&&(t=d.relative(o,t)),x(t,n)}function b(t,n){return"string"==typeof n&&(n=[n]),-1!==n.indexOf(t)}var v=["**/*.((j|t)s?(x)|m(j|t)s)?(x)","**/*.(md|markdown|txt|?(x)htm?(l)|yaml|yml|xml|json|bat|sh|bash|zsh|ini|css|scss|less|sass|py|rb|php|go|java|c|cpp|h|hpp|hxx|rust|zig)"];function $(t,n=v){if(t)if(Array.isArray(t))t=[...t];else{const o=t.include||[],r=t.exclude||[];0===o.length&&o.push(...n),t=[...o];for(const n of r)t.push(`!${n}`)}else t=[...n];return 0===t.length&&t.push(...n),t}import{readdir as j}from"fs/promises";import{readdirSync as k}from"fs";import A from"path";async function T(t,n){const o=await j(t,{withFileTypes:!0});for(const r of o){const o=A.join(t,r.name);try{if(r.isDirectory()){await n(o,r)||await T(o,n)}else{if(!0===await n(o,r))break}}catch(t){console.error(`Error processing file: ${o}`),console.error(t)}}}function z(t,n){const o=k(t,{withFileTypes:!0});for(const r of o){const o=A.join(t,r.name);try{if(r.isDirectory()){n(o,r)||T(o,n)}else{if(!0===n(o,r))break}}catch(t){console.error(`Error processing file: ${o}`),console.error(t)}}}function E(t){if(!t)return"";return t.replace(/[-_ ]+/g," ").split(" ").filter(Boolean).map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join("")}function F(t){return(t=E(t)).charAt(0).toLowerCase()+t.slice(1)}function O(t){if(!t)return"";return t.replace(/[-_ ]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").split(" ").filter(Boolean).map((t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())).join(" ")}export{g as ConfigFile,v as DefaultAllTextFiles,f as getMultiLevelExtname,w as glob,b as isStringIn,$ as normalizeIncludeFiles,h as parseFrontMatter,m as parseYaml,u as registerYamlTag,y as removeLeadingEmptyLines,p as stringifyYaml,F as toCamelCase,O as toCapitalCase,E as toPascalCase,T as traverseFolder,z as traverseFolderSync};
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: ConfigFile
8
8
 
9
- Defined in: [config-file.ts:46](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/config-file.ts#L46)
9
+ Defined in: [config-file.ts:46](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/config-file.ts#L46)
10
10
 
11
11
  Represents a configuration file utility class that provides methods to load and save configuration files.
12
12
  It supports multiple file formats such as YAML, JSON, etc., by registering corresponding parsers and stringifiers.
@@ -45,7 +45,7 @@ console.log(config); // Output: { key: 'value' }
45
45
 
46
46
  > `static` **stringifys**: `Record`\<`string`, [`StringifyFunc`](../type-aliases/StringifyFunc.md)\> = `{}`
47
47
 
48
- Defined in: [config-file.ts:50](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/config-file.ts#L50)
48
+ Defined in: [config-file.ts:50](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/config-file.ts#L50)
49
49
 
50
50
  A record of registered stringify functions for different file extensions.
51
51
 
@@ -55,7 +55,7 @@ A record of registered stringify functions for different file extensions.
55
55
 
56
56
  > `static` **load**(`filename`, `options`?): `any`
57
57
 
58
- Defined in: [config-file.ts:85](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/config-file.ts#L85)
58
+ Defined in: [config-file.ts:85](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/config-file.ts#L85)
59
59
 
60
60
  Loads a configuration file based on the provided filename and options.
61
61
 
@@ -92,7 +92,7 @@ console.log(config); // Output: { key: 'value' }
92
92
 
93
93
  > `static` **register**(`extname`, `parser`, `stringify`): `void`
94
94
 
95
- Defined in: [config-file.ts:64](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/config-file.ts#L64)
95
+ Defined in: [config-file.ts:64](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/config-file.ts#L64)
96
96
 
97
97
  Registers a parser and stringifier for specific file extensions.
98
98
 
@@ -132,7 +132,7 @@ ConfigFile.register(['.json'], JSON.parse, (obj) => JSON.stringify(obj, null, 2)
132
132
 
133
133
  > `static` **save**(`filename`, `config`, `options`?): `string`
134
134
 
135
- Defined in: [config-file.ts:102](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/config-file.ts#L102)
135
+ Defined in: [config-file.ts:102](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/config-file.ts#L102)
136
136
 
137
137
  Saves a configuration object to a file with the specified filename and options.
138
138
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **getMultiLevelExtname**(`filename`, `level`): `string`
10
10
 
11
- Defined in: [get-multi-level-extname.ts:9](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/get-multi-level-extname.ts#L9)
11
+ Defined in: [get-multi-level-extname.ts:9](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/get-multi-level-extname.ts#L9)
12
12
 
13
13
  Retrieves multi-level file extension
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **glob**(`filepath`, `pattern`, `rootDir`?): `undefined` \| `boolean`
10
10
 
11
- Defined in: [glob.ts:29](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/glob.ts#L29)
11
+ Defined in: [glob.ts:29](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/glob.ts#L29)
12
12
 
13
13
  Matches a file path against a list of glob patterns.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **isStringIn**(`str`, `arr`): `boolean`
10
10
 
11
- Defined in: [is-string-in.ts:17](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/is-string-in.ts#L17)
11
+ Defined in: [is-string-in.ts:17](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/is-string-in.ts#L17)
12
12
 
13
13
  Checks if a given string exists within an array of strings or a single string.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **normalizeIncludeFiles**(`files`?, `defaultFiles`?): `string`[]
10
10
 
11
- Defined in: [include-files.ts:34](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/include-files.ts#L34)
11
+ Defined in: [include-files.ts:34](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/include-files.ts#L34)
12
12
 
13
13
  Normalizes a list of file patterns for glob matching.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **parseFrontMatter**(`value`, `delimiter`): `object`
10
10
 
11
- Defined in: [front-matter.ts:6](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/front-matter.ts#L6)
11
+ Defined in: [front-matter.ts:6](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/front-matter.ts#L6)
12
12
 
13
13
  ## Parameters
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **parseYaml**(`content`, `options`?): `any`
10
10
 
11
- Defined in: [yaml.ts:51](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/yaml.ts#L51)
11
+ Defined in: [yaml.ts:51](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/yaml.ts#L51)
12
12
 
13
13
  Parses a YAML string into a JavaScript object with optional custom tags.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **registerYamlTag**(`tags`): `void`
10
10
 
11
- Defined in: [yaml.ts:23](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/yaml.ts#L23)
11
+ Defined in: [yaml.ts:23](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/yaml.ts#L23)
12
12
 
13
13
  Registers custom YAML tags to be used in parsing and stringifying YAML content.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **removeLeadingEmptyLines**(`text`): `string`
10
10
 
11
- Defined in: [remove-leading-empty-lines.ts:16](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/remove-leading-empty-lines.ts#L16)
11
+ Defined in: [remove-leading-empty-lines.ts:16](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/remove-leading-empty-lines.ts#L16)
12
12
 
13
13
  Removes all leading empty lines or "#" comments line from the given string.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **stringifyYaml**(`content`, `options`?): `string`
10
10
 
11
- Defined in: [yaml.ts:85](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/yaml.ts#L85)
11
+ Defined in: [yaml.ts:85](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/yaml.ts#L85)
12
12
 
13
13
  Converts a JavaScript object into a YAML string with optional custom tags.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **toCamelCase**(`str`): `string`
10
10
 
11
- Defined in: [to-camel-case.ts:17](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/to-camel-case.ts#L17)
11
+ Defined in: [to-camel-case.ts:17](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/to-camel-case.ts#L17)
12
12
 
13
13
  Converts a string to camelCase.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **toCapitalCase**(`str`): `string`
10
10
 
11
- Defined in: [to-capital-case.ts:17](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/to-capital-case.ts#L17)
11
+ Defined in: [to-capital-case.ts:17](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/to-capital-case.ts#L17)
12
12
 
13
13
  Converts a string to capital case, where the first letter of each word is capitalized
14
14
  and the rest are in lowercase. Words are separated by spaces, hyphens, or underscores.
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **toPascalCase**(`str`): `string`
10
10
 
11
- Defined in: [to-pascal-case.ts:16](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/to-pascal-case.ts#L16)
11
+ Defined in: [to-pascal-case.ts:16](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/to-pascal-case.ts#L16)
12
12
 
13
13
  Converts a string to PascalCase.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **traverseFolder**(`directoryPath`, `fileHandler`): `Promise`\<`void`\>
10
10
 
11
- Defined in: [traverse-folder.ts:38](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/traverse-folder.ts#L38)
11
+ Defined in: [traverse-folder.ts:38](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/traverse-folder.ts#L38)
12
12
 
13
13
  Traverses a folder asynchronously and applies a handler to each file or directory.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **traverseFolderSync**(`directoryPath`, `fileHandler`): `void`
10
10
 
11
- Defined in: [traverse-folder.ts:71](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/traverse-folder.ts#L71)
11
+ Defined in: [traverse-folder.ts:76](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/traverse-folder.ts#L76)
12
12
 
13
13
  Traverses a folder synchronously and applies a handler to each file or directory.
14
14
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: IncludeFiles
8
8
 
9
- Defined in: [include-files.ts:6](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/include-files.ts#L6)
9
+ Defined in: [include-files.ts:6](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/include-files.ts#L6)
10
10
 
11
11
  ## Properties
12
12
 
@@ -14,7 +14,7 @@ Defined in: [include-files.ts:6](https://github.com/isdk/util.js/blob/f467c507a8
14
14
 
15
15
  > `optional` **exclude**: `string`[]
16
16
 
17
- Defined in: [include-files.ts:8](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/include-files.ts#L8)
17
+ Defined in: [include-files.ts:8](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/include-files.ts#L8)
18
18
 
19
19
  ***
20
20
 
@@ -22,4 +22,4 @@ Defined in: [include-files.ts:8](https://github.com/isdk/util.js/blob/f467c507a8
22
22
 
23
23
  > `optional` **include**: `string`[]
24
24
 
25
- Defined in: [include-files.ts:7](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/include-files.ts#L7)
25
+ Defined in: [include-files.ts:7](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/include-files.ts#L7)
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: LoadConfigFileOptions
8
8
 
9
- Defined in: [config-file.ts:20](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/config-file.ts#L20)
9
+ Defined in: [config-file.ts:20](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/config-file.ts#L20)
10
10
 
11
11
  ## Properties
12
12
 
@@ -14,7 +14,7 @@ Defined in: [config-file.ts:20](https://github.com/isdk/util.js/blob/f467c507a8c
14
14
 
15
15
  > `optional` **externalFile**: `string`
16
16
 
17
- Defined in: [config-file.ts:22](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/config-file.ts#L22)
17
+ Defined in: [config-file.ts:22](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/config-file.ts#L22)
18
18
 
19
19
  ***
20
20
 
@@ -22,4 +22,4 @@ Defined in: [config-file.ts:22](https://github.com/isdk/util.js/blob/f467c507a8c
22
22
 
23
23
  > `optional` **extLevel**: `number`
24
24
 
25
- Defined in: [config-file.ts:21](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/config-file.ts#L21)
25
+ Defined in: [config-file.ts:21](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/config-file.ts#L21)
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **StringifyFunc** = (`content`) => `string`
10
10
 
11
- Defined in: [config-file.ts:18](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/config-file.ts#L18)
11
+ Defined in: [config-file.ts:18](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/config-file.ts#L18)
12
12
 
13
13
  ## Parameters
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **TraverseFolderHandler** = (`filePath`, `entry`) => `boolean` \| `void` \| `Promise`\<`boolean` \| `void`\>
10
10
 
11
- Defined in: [traverse-folder.ts:11](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/traverse-folder.ts#L11)
11
+ Defined in: [traverse-folder.ts:11](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/traverse-folder.ts#L11)
12
12
 
13
13
  A handler function for asynchronous folder traversal.
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **TraverseFolderSyncHandler** = (`filePath`, `entry`) => `boolean` \| `void`
10
10
 
11
- Defined in: [traverse-folder.ts:18](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/traverse-folder.ts#L18)
11
+ Defined in: [traverse-folder.ts:18](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/traverse-folder.ts#L18)
12
12
 
13
13
  A handler function for synchronous folder traversal.
14
14
 
@@ -8,4 +8,4 @@
8
8
 
9
9
  > `const` **DefaultAllTextFiles**: `string`[]
10
10
 
11
- Defined in: [include-files.ts:1](https://github.com/isdk/util.js/blob/f467c507a8cfd31890519496ac9059c8ad3f8d03/src/include-files.ts#L1)
11
+ Defined in: [include-files.ts:1](https://github.com/isdk/util.js/blob/d57e048e4f751b04d987b4327c0ccab1379da1c3/src/include-files.ts#L1)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@isdk/util",
3
3
  "description": "a set of utility functions",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "author": "Riceball LEE @snowyu",
6
6
  "bugs": "https://github.com/isdk/util.js/issues",
7
7
  "dependencies": {