@owservable/folders 1.6.3 → 1.7.0

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/README.md CHANGED
@@ -2,15 +2,140 @@
2
2
 
3
3
  # @owservable/folders
4
4
 
5
- ## TypeDoc Documentation
5
+ A TypeScript utility library for file system operations, providing functions to work with folders and files recursively.
6
6
 
7
- See the <a href="https://owservable.github.io/folders/docs/" target="_blank">TypeDoc documentation</a>.
7
+ ## 🚀 Features
8
8
 
9
- ## Test Coverage
9
+ - Recursively add files from folders
10
+ - List subfolders by name with filtering
11
+ - Get files from specific subfolders
12
+ - Written in TypeScript with full type support
13
+ - Lodash integration for efficient data manipulation
10
14
 
11
- See the <a href="https://owservable.github.io/folders/coverage/" target="_blank">Test coverage</a>.
15
+ ## 📦 Installation
12
16
 
13
- - functions
14
- - addFilesFromFolder
15
- - listSubfoldersByName
16
- - listSubfoldersFilesByFolderName
17
+ ```bash
18
+ npm install @owservable/folders
19
+ ```
20
+
21
+ or
22
+
23
+ ```bash
24
+ yarn add @owservable/folders
25
+ ```
26
+
27
+ or
28
+
29
+ ```bash
30
+ pnpm add @owservable/folders
31
+ ```
32
+
33
+ ## 🔧 Usage
34
+
35
+ ### Basic Import
36
+
37
+ ```typescript
38
+ import {
39
+ addFilesFromFolder,
40
+ listSubfoldersByName,
41
+ listSubfoldersFilesByFolderName
42
+ } from '@owservable/folders';
43
+ ```
44
+
45
+ ### Adding Files from Folder Recursively
46
+
47
+ ```typescript
48
+ import { addFilesFromFolder } from '@owservable/folders';
49
+
50
+ // Initialize empty array to collect files
51
+ const files: string[] = [];
52
+
53
+ // Add all files from a folder recursively
54
+ const allFiles = addFilesFromFolder(files, '/path/to/folder');
55
+
56
+ console.log(allFiles); // Array of all file paths
57
+ ```
58
+
59
+ ### Listing Subfolders by Name
60
+
61
+ ```typescript
62
+ import { listSubfoldersByName } from '@owservable/folders';
63
+
64
+ // Get all subfolders with specific name
65
+ const subfolders = listSubfoldersByName('/path/to/parent', 'targetFolderName');
66
+
67
+ console.log(subfolders); // Array of matching subfolder paths
68
+ ```
69
+
70
+ ### Getting Files from Specific Subfolders
71
+
72
+ ```typescript
73
+ import { listSubfoldersFilesByFolderName } from '@owservable/folders';
74
+
75
+ // Get all files from subfolders with specific name
76
+ const files = listSubfoldersFilesByFolderName('/path/to/parent', 'targetFolderName');
77
+
78
+ console.log(files); // Array of file paths from matching subfolders
79
+ ```
80
+
81
+ ## 📚 API Documentation
82
+
83
+ ### `addFilesFromFolder(files: string[], folder: string): string[]`
84
+
85
+ Recursively adds all files from a folder and its subfolders to the provided array.
86
+
87
+ **Parameters:**
88
+ - `files`: Array to store file paths
89
+ - `folder`: Path to the folder to scan
90
+
91
+ **Returns:** Array of file paths
92
+
93
+ ### `listSubfoldersByName(folder: string, name: string): string[]`
94
+
95
+ Lists all subfolders with a specific name within a given folder.
96
+
97
+ **Parameters:**
98
+ - `folder`: Path to the parent folder
99
+ - `name`: Name of subfolders to find
100
+
101
+ **Returns:** Array of matching subfolder paths
102
+
103
+ ### `listSubfoldersFilesByFolderName(folder: string, name: string): string[]`
104
+
105
+ Gets all files from subfolders that match a specific name.
106
+
107
+ **Parameters:**
108
+ - `folder`: Path to the parent folder
109
+ - `name`: Name of subfolders to search in
110
+
111
+ **Returns:** Array of file paths from matching subfolders
112
+
113
+ ## 🏗️ Requirements
114
+
115
+ - Node.js >= 20
116
+ - TypeScript support
117
+
118
+ ## 🧪 Testing
119
+
120
+ ```bash
121
+ npm test
122
+ ```
123
+
124
+ ## 📖 Documentation
125
+
126
+ - **TypeDoc Documentation**: [https://owservable.github.io/folders/docs/](https://owservable.github.io/folders/docs/)
127
+ - **Test Coverage**: [https://owservable.github.io/folders/coverage/](https://owservable.github.io/folders/coverage/)
128
+
129
+ ## 🔗 Related Projects
130
+
131
+ - [@owservable/actions](https://github.com/owservable/actions) - Action pattern implementation
132
+ - [@owservable/fastify-auto-routes](https://github.com/owservable/fastify-auto-routes) - Fastify auto routing
133
+ - [owservable](https://github.com/owservable/owservable) - Main reactive backend library
134
+
135
+ ## 📄 License
136
+
137
+ Licensed under [The Unlicense](./LICENSE).
138
+
139
+ ## 🤝 Contributing
140
+
141
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -1,2 +1,2 @@
1
- declare const addFilesFromFolder: (files: string[], folder: string) => string[];
1
+ declare const addFilesFromFolder: Function;
2
2
  export default addFilesFromFolder;
@@ -1,19 +1,36 @@
1
1
  'use strict';
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  const fs = require("fs");
4
13
  const path = require("path");
5
- const lodash_1 = require("lodash");
6
- const addFilesFromFolder = (files, folder) => {
7
- const subfolderNames = fs.readdirSync(folder);
8
- const subFiles = (0, lodash_1.filter)(subfolderNames, (name) => !fs.lstatSync(path.join(folder, name)).isDirectory());
9
- (0, lodash_1.each)(subFiles, (file) => {
10
- files.push(path.join(folder, file));
11
- });
12
- const subFolders = (0, lodash_1.filter)(subfolderNames, (name) => fs.lstatSync(path.join(folder, name)).isDirectory());
13
- (0, lodash_1.each)(subFolders, (subFolder) => {
14
- files = addFilesFromFolder(files, path.join(folder, subFolder));
14
+ const addFilesFromFolder = (files, folder) => __awaiter(void 0, void 0, void 0, function* () {
15
+ const subfolderNames = yield fs.promises.readdir(folder);
16
+ const itemStats = yield Promise.all(subfolderNames.map((name) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const fullPath = path.join(folder, name);
18
+ const stat = yield fs.promises.lstat(fullPath);
19
+ return {
20
+ name,
21
+ fullPath,
22
+ isDirectory: stat.isDirectory()
23
+ };
24
+ })));
25
+ const subFiles = itemStats.filter((item) => !item.isDirectory);
26
+ const subFolders = itemStats.filter((item) => item.isDirectory);
27
+ subFiles.forEach((file) => {
28
+ files.push(file.fullPath);
15
29
  });
30
+ yield Promise.all(subFolders.map((subFolder) => __awaiter(void 0, void 0, void 0, function* () {
31
+ return yield addFilesFromFolder(files, subFolder.fullPath);
32
+ })));
16
33
  return files;
17
- };
34
+ });
18
35
  exports.default = addFilesFromFolder;
19
36
  //# sourceMappingURL=add.files.from.folder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add.files.from.folder.js","sourceRoot":"","sources":["../../src/functions/add.files.from.folder.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,yBAAyB;AACzB,6BAA6B;AAE7B,mCAAoC;AAEpC,MAAM,kBAAkB,GAAG,CAAC,KAAe,EAAE,MAAc,EAAY,EAAE;IACxE,MAAM,cAAc,GAAa,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAExD,MAAM,QAAQ,GAAa,IAAA,eAAM,EAAC,cAAc,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1H,IAAA,aAAI,EAAC,QAAQ,EAAE,CAAC,IAAY,EAAQ,EAAE;QACrC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAa,IAAA,eAAM,EAAC,cAAc,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,I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QAAQ,CAAC,OAAO,CAAC,CAAC,IAAc,EAAQ,EAAE;QACzC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAGH,MAAM,OAAO,CAAC,GAAG,CAChB,UAAU,CAAC,GAAG,CAAC,CAAO,SAAmB,EAAqB,EAAE;QAC/D,OAAO,MAAM,kBAAkB,CAAC,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC5D,CAAC,CAAA,CAAC,CACF,CAAC;IAEF,OAAO,KAAK,CAAC;AACd,CAAC,CAAA,CAAC;AACF,kBAAe,kBAAkB,CAAC"}
@@ -1,2 +1,2 @@
1
- declare const listSubfoldersByName: (root: string, name: string) => string[];
1
+ declare const listSubfoldersByName: Function;
2
2
  export default listSubfoldersByName;
@@ -1,20 +1,39 @@
1
1
  'use strict';
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  const fs = require("fs");
4
13
  const path = require("path");
5
- const lodash_1 = require("lodash");
6
- const listSubfoldersByName = (root, name) => {
14
+ const listSubfoldersByName = (root, folderName) => __awaiter(void 0, void 0, void 0, function* () {
7
15
  let folders = [];
8
- const subfolderNames = fs.readdirSync(root);
9
- const subfolders = (0, lodash_1.filter)(subfolderNames, (subfolderName) => fs.lstatSync(path.join(root, subfolderName)).isDirectory());
10
- (0, lodash_1.each)(subfolders, (subfolder) => {
11
- const fullPath = path.join(root, subfolder);
12
- if (name === subfolder)
13
- folders.push(fullPath);
14
- else
15
- folders = (0, lodash_1.concat)(folders, listSubfoldersByName(fullPath, name));
16
- });
16
+ const subfolderNames = yield fs.promises.readdir(root);
17
+ const itemStats = yield Promise.all(subfolderNames.map((subfolderName) => __awaiter(void 0, void 0, void 0, function* () {
18
+ const fullPath = path.join(root, subfolderName);
19
+ const stat = yield fs.promises.lstat(fullPath);
20
+ return {
21
+ name: subfolderName,
22
+ fullPath,
23
+ isDirectory: stat.isDirectory()
24
+ };
25
+ })));
26
+ const subfolders = itemStats.filter((item) => item.isDirectory);
27
+ const results = yield Promise.all(subfolders.map((subfolder) => __awaiter(void 0, void 0, void 0, function* () {
28
+ if (folderName === subfolder.name) {
29
+ return [subfolder.fullPath];
30
+ }
31
+ else {
32
+ return yield listSubfoldersByName(subfolder.fullPath, folderName);
33
+ }
34
+ })));
35
+ folders = results.flat();
17
36
  return folders;
18
- };
37
+ });
19
38
  exports.default = listSubfoldersByName;
20
39
  //# sourceMappingURL=list.subfolders.by.name.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.subfolders.by.name.js","sourceRoot":"","sources":["../../src/functions/list.subfolders.by.name.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,yBAAyB;AACzB,6BAA6B;AAE7B,mCAA4C;AAE5C,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,IAAY,EAAY,EAAE;IACrE,IAAI,OAAO,GAAa,EAAE,CAAC;IAE3B,MAAM,cAAc,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,IAAA,eAAM,EAAC,cAAc,EAAE,CAAC,aAAqB,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAEjI,IAAA,aAAI,EAAC,UAAU,EAAE,CAAC,SAAS,EA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M,OAAO,GAAe,MAAM,OAAO,CAAC,GAAG,CAC5C,UAAU,CAAC,GAAG,CAAC,CAAO,SAAmB,EAAqB,EAAE;QAC/D,IAAI,UAAU,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC;aAAM,CAAC;YACP,OAAO,MAAM,oBAAoB,CAAC,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACnE,CAAC;IACF,CAAC,CAAA,CAAC,CACF,CAAC;IAGF,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAEzB,OAAO,OAAO,CAAC;AAChB,CAAC,CAAA,CAAC;AACF,kBAAe,oBAAoB,CAAC"}
@@ -1,2 +1,2 @@
1
- declare const listSubfoldersFilesByFolderName: (root: string, name: string) => string[];
1
+ declare const listSubfoldersFilesByFolderName: Function;
2
2
  export default listSubfoldersFilesByFolderName;
@@ -1,15 +1,26 @@
1
1
  'use strict';
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const lodash_1 = require("lodash");
4
12
  const add_files_from_folder_1 = require("./add.files.from.folder");
5
13
  const list_subfolders_by_name_1 = require("./list.subfolders.by.name");
6
- const listSubfoldersFilesByFolderName = (root, name) => {
14
+ const listSubfoldersFilesByFolderName = (root, name) => __awaiter(void 0, void 0, void 0, function* () {
7
15
  let files = [];
8
- const folders = (0, list_subfolders_by_name_1.default)(root, name);
9
- (0, lodash_1.each)(folders, (folder) => {
10
- files = (0, add_files_from_folder_1.default)(files, folder);
11
- });
16
+ const folders = yield (0, list_subfolders_by_name_1.default)(root, name);
17
+ const results = yield Promise.all(folders.map((folder) => __awaiter(void 0, void 0, void 0, function* () {
18
+ const folderFiles = [];
19
+ yield (0, add_files_from_folder_1.default)(folderFiles, folder);
20
+ return folderFiles;
21
+ })));
22
+ files = results.flat();
12
23
  return files;
13
- };
24
+ });
14
25
  exports.default = listSubfoldersFilesByFolderName;
15
26
  //# sourceMappingURL=list.subfolders.files.by.folder.name.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.subfolders.files.by.folder.name.js","sourceRoot":"","sources":["../../src/functions/list.subfolders.files.by.folder.name.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,mCAA4B;AAE5B,mEAAyD;AACzD,uEAA6D;AAE7D,MAAM,+BAA+B,GAAG,CAAC,IAAY,EAAE,IAAY,EAAY,EAAE;IAChF,IAAI,KAAK,GAAa,EAAE,CAAC;IACzB,MAAM,OAAO,GAAa,IAAA,iCAAoB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3D,IAAA,aAAI,EAAC,OAAO,EAAE,CAAC,MAAc,EAAE,EAAE;QAChC,KAAK,GAAG,IAAA,+BAAkB,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AACF,kBAAe,+BAA+B,CAAC"}
1
+ {"version":3,"file":"list.subfolders.files.by.folder.name.js","sourceRoot":"","sources":["../../src/functions/list.subfolders.files.by.folder.name.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;AAEb,mEAAyD;AACzD,uEAA6D;AAE7D,MAAM,+BAA+B,GAAa,CAAO,IAAY,EAAE,IAAY,EAAqB,EAAE;IACzG,IAAI,KAAK,GAAa,EAAE,CAAC;IACzB,MAAM,OAAO,GAAa,MAAM,IAAA,iCAAoB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAGjE,MAAM,OAAO,GAAe,MAAM,OAAO,CAAC,GAAG,CAC5C,OAAO,CAAC,GAAG,CAAC,CAAO,MAAc,EAAqB,EAAE;QACvD,MAAM,WAAW,GAAa,EAAE,CAAC;QACjC,MAAM,IAAA,+BAAkB,EAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAO,WAAW,CAAC;IACpB,CAAC,CAAA,CAAC,CACF,CAAC;IAGF,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAEvB,OAAO,KAAK,CAAC;AACd,CAAC,CAAA,CAAC;AACF,kBAAe,+BAA+B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface ItemStat {
2
+ name: string;
3
+ fullPath: string;
4
+ isDirectory: boolean;
5
+ }
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=item.stat.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.stat.interface.js","sourceRoot":"","sources":["../../src/types/item.stat.interface.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owservable/folders",
3
- "version": "1.6.3",
3
+ "version": "1.7.0",
4
4
  "description": "get files and folders",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -17,18 +17,18 @@
17
17
  "url": "git+https://github.com/owservable/folders.git"
18
18
  },
19
19
  "scripts": {
20
- "all": "pnpm i & pnpm dedupe & pnpm audit --fix & tsc & pnpm clean & pnpm build & pnpm test & pnpm test_qube & pnpm docs & skeletest & strictr",
20
+ "all": "pnpm i & pnpm dedupe & pnpm audit --fix & pnpm clean & pnpm format & pnpm build & pnpm test & pnpm test_qube & pnpm docs & skeletest & strictr",
21
21
  "build": "del /S /Q lib\\* && tsc",
22
22
  "build:watch": "tsc --watch",
23
23
  "lint": "tslint -p tsconfig.json",
24
24
  "clean": "tslint --config tslint-imports.json --fix --project .",
25
- "format": "prettier --write \"src/**/*.ts\"",
25
+ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
26
26
  "sync": "git pull & git fetch origin & git merge origin/main & pnpm i & git branch",
27
27
  "docs": "typedoc --readme none --out docs src/owservable.folders.ts",
28
- "test": "nyc --all --reporter=lcov --reporter=html mocha -r ts-node/register test/**/*.spec.ts --code-coverage",
28
+ "test": "jest --coverage --config jest.config.js",
29
29
  "coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls",
30
30
  "sonar": "sonarjs -e .sonarlint/**,node_modules/**,coverage/**,.nyc_output/**",
31
- "test_qube": "nyc --reporter=lcov mocha -R @danmasta/mocha-sonar -r ts-node/register test/**/*.spec.ts",
31
+ "test_qube": "jest --testResultsProcessor=jest-sonar-reporter",
32
32
  "up": "pnpm up -i",
33
33
  "latest": "pnpm up -i -L",
34
34
  "l": "pnpm i & pnpm latest",
@@ -41,23 +41,19 @@
41
41
  "lodash": "^4.17.20"
42
42
  },
43
43
  "devDependencies": {
44
- "@danmasta/mocha-sonar": "^1.1.0",
45
- "@types/chai": "^4.3.19",
46
- "@types/mocha": "^10.0.10",
47
- "chai": "4.4.0",
44
+ "@types/jest": "^30.0.0",
48
45
  "coveralls": "^3.0.9",
49
- "mocha": "^11.7.1",
50
- "nyc": "^17.1.0",
46
+ "jest": "^30.0.4",
47
+ "jest-sonar-reporter": "^2.0.0",
51
48
  "prettier": "^3.6.2",
52
49
  "skeletest": "^0.6.0",
53
50
  "sonarjs": "^1.0.0",
54
51
  "source-map-support": "^0.5.21",
55
52
  "strictr": "^0.3.0",
56
- "ts-node": "^10.9.2",
53
+ "ts-jest": "^29.1.2",
57
54
  "tslint": "^6.1.3",
58
55
  "tslint-config-prettier": "^1.18.0",
59
56
  "tslint-etc": "^1.13.7",
60
- "tslint-no-unused-expression-chai": "^0.1.4",
61
57
  "typedoc": "^0.28.7",
62
58
  "typescript": "^5.8.3"
63
59
  },
@@ -67,8 +63,6 @@
67
63
  },
68
64
  "updateConfig": {
69
65
  "ignoreDependencies": [
70
- "chai",
71
- "@types/chai",
72
66
  "sonarjs",
73
67
  "tslint"
74
68
  ]