@isdk/util 0.1.1 → 0.1.3
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.d.mts +344 -11
- package/dist/index.d.ts +344 -11
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/classes/ConfigFile.md +9 -9
- package/docs/functions/getMultiLevelExtname.md +1 -1
- package/docs/functions/glob.md +1 -1
- package/docs/functions/isStringIn.md +1 -1
- package/docs/functions/normalizeIncludeFiles.md +1 -1
- package/docs/functions/parseFrontMatter.md +1 -1
- package/docs/functions/parseYaml.md +1 -1
- package/docs/functions/registerYamlTag.md +1 -1
- package/docs/functions/removeLeadingEmptyLines.md +1 -1
- package/docs/functions/stringifyYaml.md +1 -1
- package/docs/functions/toCamelCase.md +37 -0
- package/docs/functions/toCapitalCase.md +38 -0
- package/docs/functions/toPascalCase.md +37 -0
- package/docs/functions/traverseFolder.md +1 -1
- package/docs/functions/traverseFolderSync.md +1 -1
- package/docs/globals.md +5 -0
- package/docs/interfaces/IncludeFiles.md +3 -3
- package/docs/interfaces/LoadConfigFileOptions.md +25 -0
- package/docs/type-aliases/StringifyFunc.md +21 -0
- package/docs/type-aliases/TraverseFolderHandler.md +1 -1
- package/docs/type-aliases/TraverseFolderSyncHandler.md +1 -1
- package/docs/variables/DefaultAllTextFiles.md +1 -1
- package/package.json +1 -1
- package/dist/chunk-3TCMKKX2.mjs +0 -1
- package/dist/chunk-46TT3NZV.mjs +0 -1
- package/dist/chunk-7APJBRA7.mjs +0 -1
- package/dist/chunk-7AQU3PBW.mjs +0 -1
- package/dist/chunk-D3BCI5SM.mjs +0 -1
- package/dist/chunk-FXF2KJLF.mjs +0 -1
- package/dist/chunk-GGOKSJK4.mjs +0 -1
- package/dist/chunk-JTTOXXPG.mjs +0 -1
- package/dist/chunk-LOMQZH4U.mjs +0 -292
- package/dist/chunk-OTEAFARC.mjs +0 -1
- package/dist/chunk-UJZVJIGI.mjs +0 -1
- package/dist/config-file.d.mts +0 -75
- package/dist/config-file.d.ts +0 -75
- package/dist/config-file.js +0 -1
- package/dist/config-file.mjs +0 -1
- package/dist/config-file.test.d.mts +0 -2
- package/dist/config-file.test.d.ts +0 -2
- package/dist/config-file.test.js +0 -292
- package/dist/config-file.test.mjs +0 -1
- package/dist/front-matter.d.mts +0 -6
- package/dist/front-matter.d.ts +0 -6
- package/dist/front-matter.js +0 -1
- package/dist/front-matter.mjs +0 -1
- package/dist/front-matter.test.d.mts +0 -2
- package/dist/front-matter.test.d.ts +0 -2
- package/dist/front-matter.test.js +0 -1
- package/dist/front-matter.test.mjs +0 -1
- package/dist/get-multi-level-extname.d.mts +0 -9
- package/dist/get-multi-level-extname.d.ts +0 -9
- package/dist/get-multi-level-extname.js +0 -1
- package/dist/get-multi-level-extname.mjs +0 -1
- package/dist/glob.d.mts +0 -28
- package/dist/glob.d.ts +0 -28
- package/dist/glob.js +0 -1
- package/dist/glob.mjs +0 -1
- package/dist/glob.test.d.mts +0 -2
- package/dist/glob.test.d.ts +0 -2
- package/dist/glob.test.js +0 -292
- package/dist/glob.test.mjs +0 -1
- package/dist/include-files.d.mts +0 -31
- package/dist/include-files.d.ts +0 -31
- package/dist/include-files.js +0 -1
- package/dist/include-files.mjs +0 -1
- package/dist/include-files.test.d.mts +0 -2
- package/dist/include-files.test.d.ts +0 -2
- package/dist/include-files.test.js +0 -292
- package/dist/include-files.test.mjs +0 -1
- package/dist/is-string-in.d.mts +0 -19
- package/dist/is-string-in.d.ts +0 -19
- package/dist/is-string-in.js +0 -1
- package/dist/is-string-in.mjs +0 -1
- package/dist/magic-string.es-TUA2PMWY.mjs +0 -1
- package/dist/remove-leading-empty-lines.d.mts +0 -18
- package/dist/remove-leading-empty-lines.d.ts +0 -18
- package/dist/remove-leading-empty-lines.js +0 -1
- package/dist/remove-leading-empty-lines.mjs +0 -1
- package/dist/remove-leading-empty-lines.test.d.mts +0 -2
- package/dist/remove-leading-empty-lines.test.d.ts +0 -2
- package/dist/remove-leading-empty-lines.test.js +0 -1
- package/dist/remove-leading-empty-lines.test.mjs +0 -1
- package/dist/traverse-folder.d.mts +0 -56
- package/dist/traverse-folder.d.ts +0 -56
- package/dist/traverse-folder.js +0 -1
- package/dist/traverse-folder.mjs +0 -1
- package/dist/traverse-folder.test.d.mts +0 -2
- package/dist/traverse-folder.test.d.ts +0 -2
- package/dist/traverse-folder.test.js +0 -292
- package/dist/traverse-folder.test.mjs +0 -1
- package/dist/yaml.d.mts +0 -59
- package/dist/yaml.d.ts +0 -59
- package/dist/yaml.js +0 -1
- package/dist/yaml.mjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{traverseFolder as t,traverseFolderSync as e}from"./chunk-46TT3NZV.mjs";import{vi as r}from"./chunk-LOMQZH4U.mjs";import{init_esm_shims as s}from"./chunk-UJZVJIGI.mjs";s();import{Dirent as o,readdirSync as i}from"fs";import{readdir as c}from"fs/promises";import n from"path";var a=o;r.mock("fs/promises",(()=>({readdir:r.fn()}))),r.mock("fs",(()=>({readdirSync:r.fn(),Dirent:class{constructor(t){this.isFile=()=>!0,this.name=t}}}))),describe("traverseFolder",(()=>{it("should traverse all files and directories asynchronously",(async()=>{const e=[new a("file1.txt"),new a("file2.txt"),new a("subdir")];c.mockResolvedValue(e);const s=r.fn().mockImplementation((()=>!1));await t("/mock/path",s),expect(s).toHaveBeenCalledTimes(3),expect(s).toHaveBeenCalledWith(n.join("/mock/path","file1.txt"),e[0]),expect(s).toHaveBeenCalledWith(n.join("/mock/path","file2.txt"),e[1]),expect(s).toHaveBeenCalledWith(n.join("/mock/path","subdir"),e[2])})),it("should stop traversal when handler returns true",(async()=>{const e=[new a("file1.txt"),new a("file2.txt"),new a("file3.txt")];c.mockResolvedValue(e);const s=r.fn().mockImplementation((t=>t.endsWith("file2.txt")));await t("/mock/path",s),expect(s).toHaveBeenCalledTimes(2)}))})),describe("traverseFolderSync",(()=>{it("should traverse all files and directories synchronously",(()=>{const t=[new a("file1.txt"),new a("file2.txt"),new a("subdir")];i.mockReturnValue(t);const s=r.fn().mockImplementation((()=>!1));e("/mock/path",s),expect(s).toHaveBeenCalledTimes(3),expect(s).toHaveBeenCalledWith(n.join("/mock/path","file1.txt"),t[0]),expect(s).toHaveBeenCalledWith(n.join("/mock/path","file2.txt"),t[1]),expect(s).toHaveBeenCalledWith(n.join("/mock/path","subdir"),t[2])})),it("should stop traversal when handler returns true",(()=>{const t=[new a("file1.txt"),new a("file2.txt"),new a("file3.txt")];i.mockReturnValue(t);const s=r.fn().mockImplementation((t=>t.endsWith("file2.txt")));e("/mock/path",s),expect(s).toHaveBeenCalledTimes(2)}))}));
|
package/dist/yaml.d.mts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ParseOptions, DocumentOptions, SchemaOptions, ToJSOptions, CreateNodeOptions, ToStringOptions } from 'yaml';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Registers custom YAML tags to be used in parsing and stringifying YAML content.
|
|
5
|
-
*
|
|
6
|
-
* @param tags - A single tag or an array of tags to register.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { registerYamlTag } from './yaml';
|
|
11
|
-
*
|
|
12
|
-
* const customTag = {
|
|
13
|
-
* tag: '!custom',
|
|
14
|
-
* resolve: (value) => `resolved-${value}`,
|
|
15
|
-
* };
|
|
16
|
-
* registerYamlTag(customTag);
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
declare function registerYamlTag(tags: any): void;
|
|
20
|
-
/**
|
|
21
|
-
* Parses a YAML string into a JavaScript object with optional custom tags.
|
|
22
|
-
*
|
|
23
|
-
* @param content - The YAML string to parse.
|
|
24
|
-
* @param options - Optional parsing options, including custom tags.
|
|
25
|
-
* @returns The parsed JavaScript object.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```typescript
|
|
29
|
-
* import { parseYaml } from './yaml';
|
|
30
|
-
*
|
|
31
|
-
* const yamlContent = `
|
|
32
|
-
* example: !custom value
|
|
33
|
-
* `;
|
|
34
|
-
* const result = parseYaml(yamlContent);
|
|
35
|
-
* console.log(result); // { example: 'resolved-value' }
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
declare function parseYaml(content: string, options?: ParseOptions & DocumentOptions & SchemaOptions & ToJSOptions): any;
|
|
39
|
-
/**
|
|
40
|
-
* Converts a JavaScript object into a YAML string with optional custom tags.
|
|
41
|
-
*
|
|
42
|
-
* @param content - The JavaScript object to convert to YAML.
|
|
43
|
-
* @param options - Optional stringification options, including custom tags.
|
|
44
|
-
* @returns The YAML string representation of the input object.
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* import { stringifyYaml } from './yaml';
|
|
49
|
-
*
|
|
50
|
-
* const data = {
|
|
51
|
-
* example: 'value',
|
|
52
|
-
* };
|
|
53
|
-
* const yamlString = stringifyYaml(data);
|
|
54
|
-
* console.log(yamlString); // "example: value\n"
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
declare function stringifyYaml(content: any, options?: DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptions & ToStringOptions): string;
|
|
58
|
-
|
|
59
|
-
export { parseYaml, registerYamlTag, stringifyYaml };
|
package/dist/yaml.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ParseOptions, DocumentOptions, SchemaOptions, ToJSOptions, CreateNodeOptions, ToStringOptions } from 'yaml';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Registers custom YAML tags to be used in parsing and stringifying YAML content.
|
|
5
|
-
*
|
|
6
|
-
* @param tags - A single tag or an array of tags to register.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { registerYamlTag } from './yaml';
|
|
11
|
-
*
|
|
12
|
-
* const customTag = {
|
|
13
|
-
* tag: '!custom',
|
|
14
|
-
* resolve: (value) => `resolved-${value}`,
|
|
15
|
-
* };
|
|
16
|
-
* registerYamlTag(customTag);
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
declare function registerYamlTag(tags: any): void;
|
|
20
|
-
/**
|
|
21
|
-
* Parses a YAML string into a JavaScript object with optional custom tags.
|
|
22
|
-
*
|
|
23
|
-
* @param content - The YAML string to parse.
|
|
24
|
-
* @param options - Optional parsing options, including custom tags.
|
|
25
|
-
* @returns The parsed JavaScript object.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```typescript
|
|
29
|
-
* import { parseYaml } from './yaml';
|
|
30
|
-
*
|
|
31
|
-
* const yamlContent = `
|
|
32
|
-
* example: !custom value
|
|
33
|
-
* `;
|
|
34
|
-
* const result = parseYaml(yamlContent);
|
|
35
|
-
* console.log(result); // { example: 'resolved-value' }
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
declare function parseYaml(content: string, options?: ParseOptions & DocumentOptions & SchemaOptions & ToJSOptions): any;
|
|
39
|
-
/**
|
|
40
|
-
* Converts a JavaScript object into a YAML string with optional custom tags.
|
|
41
|
-
*
|
|
42
|
-
* @param content - The JavaScript object to convert to YAML.
|
|
43
|
-
* @param options - Optional stringification options, including custom tags.
|
|
44
|
-
* @returns The YAML string representation of the input object.
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* import { stringifyYaml } from './yaml';
|
|
49
|
-
*
|
|
50
|
-
* const data = {
|
|
51
|
-
* example: 'value',
|
|
52
|
-
* };
|
|
53
|
-
* const yamlString = stringifyYaml(data);
|
|
54
|
-
* console.log(yamlString); // "example: value\n"
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
declare function stringifyYaml(content: any, options?: DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptions & ToStringOptions): string;
|
|
58
|
-
|
|
59
|
-
export { parseYaml, registerYamlTag, stringifyYaml };
|
package/dist/yaml.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,n={};((e,r)=>{for(var f in r)t(e,f,{get:r[f],enumerable:!0})})(n,{parseYaml:()=>a,registerYamlTag:()=>u,stringifyYaml:()=>c}),module.exports=(e=n,((e,n,i,s)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of f(n))o.call(e,u)||u===i||t(e,u,{get:()=>n[u],enumerable:!(s=r(n,u))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var i=require("yaml"),s=[];function u(e){Array.isArray(e)||(e=[e]);for(const t of e){-1===s.indexOf(t)&&s.push(t)}}function a(e,t){if(t)if(t.customTags){if(Array.isArray(t.customTags))t.customTags=s.concat(t.customTags);else if("function"==typeof t.customTags){const e=t.customTags;t.customTags=t=>e(s.concat(t))}}else t.customTags=s;else t={customTags:s};return(0,i.parse)(e,t)}function c(e,t){if(t)if(t.customTags){if(Array.isArray(t.customTags))t.customTags=s.concat(t.customTags);else if("function"==typeof t.customTags){const e=t.customTags;t.customTags=t=>e(s.concat(t))}}else t.customTags=s;else t={customTags:s};return(0,i.stringify)(e,t)}
|
package/dist/yaml.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseYaml as m,registerYamlTag as o,stringifyYaml as r}from"./chunk-OTEAFARC.mjs";import"./chunk-UJZVJIGI.mjs";export{m as parseYaml,o as registerYamlTag,r as stringifyYaml};
|