@mxfb/tools 0.0.16
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/components/Comp/index.d.ts +1 -0
- package/components/Comp/index.js +1 -0
- package/index.js +10 -0
- package/package.json +33 -0
- package/utils/agnostic/find-duplicates-in-array/index.d.ts +1 -0
- package/utils/agnostic/find-duplicates-in-array/index.js +1 -0
- package/utils/node/is-in-directory/index.d.ts +1 -0
- package/utils/node/is-in-directory/index.js +1 -0
- package/utils/node/list-subdirectories-indexes/index.d.ts +1 -0
- package/utils/node/list-subdirectories-indexes/index.js +1 -0
- package/utils/node/read-write-file/index.d.ts +12 -0
- package/utils/node/read-write-file/index.js +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Comp(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fragment as u,jsx as f}from"react/jsx-runtime";function o(){return f(u,{children:"Coucou !"})}export{o as default};
|
package/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Comp from './components/Comp/index.js'
|
|
2
|
+
import * as findDuplicatesInArray from './utils/agnostic/find-duplicates-in-array/index.js'
|
|
3
|
+
import * as isInDirectory from './utils/node/is-in-directory/index.js'
|
|
4
|
+
import * as listSubdirectoriesIndexes from './utils/node/list-subdirectories-indexes/index.js'
|
|
5
|
+
import * as readWriteFile from './utils/node/read-write-file/index.js'
|
|
6
|
+
export { Comp }
|
|
7
|
+
export { findDuplicatesInArray }
|
|
8
|
+
export { isInDirectory }
|
|
9
|
+
export { listSubdirectoriesIndexes }
|
|
10
|
+
export { readWriteFile }
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mxfb/tools",
|
|
3
|
+
"version": "0.0.16",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "Maxime Fabas",
|
|
6
|
+
"license": "ISC",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/maximefabas/mxfb-tools"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "index.js",
|
|
13
|
+
"module": "index.js",
|
|
14
|
+
"dependencies": {},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"react": "^18.2.0",
|
|
17
|
+
"react-dom": "^18.2.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/d3": "^7.4.3",
|
|
21
|
+
"@types/node": "^20.11.30",
|
|
22
|
+
"@types/prompts": "^2.4.9",
|
|
23
|
+
"@types/react": "^18.2.72",
|
|
24
|
+
"@types/react-dom": "^18.2.22",
|
|
25
|
+
"@types/semver": "^7.5.8",
|
|
26
|
+
"camelcase": "^8.0.0",
|
|
27
|
+
"esbuild": "^0.20.2",
|
|
28
|
+
"prompts": "^2.4.2",
|
|
29
|
+
"semver": "^7.6.0",
|
|
30
|
+
"simple-git": "^3.23.0",
|
|
31
|
+
"typescript": "^5.4.3"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function findDuplicatesInArray<T>(arr: T[], stopAtFirst?: boolean): T[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function o(a,r=!1){let n=new Set,t=new Set;for(let e of a){if(n.has(e)&&r)return[e];n.has(e)&&t.add(e),n.add(e)}return Array.from(t)}export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isInDirectory(childPath: string, parentPath: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"node:path";function n(r,i){let t=e.relative(i,r);return t!==""&&!t.startsWith("..")}export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function listSubdirectoriesIndexes(root: string, extensions?: string[]): Promise<string[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{promises as t,existsSync as d}from"node:fs";import n from"node:path";async function l(r,i){if(!d(r))return[];if(!(await t.stat(r)).isDirectory())return[];let c=(await t.readdir(r)).map(e=>n.join(r,e));return(await Promise.all(c.map(async e=>{try{if(!d(e))return!1;if(!(await t.stat(e)).isDirectory())return;let s=(await t.readdir(e)).find(o=>{let a=n.extname(o).toLowerCase(),f=n.basename(o,a),m=i!==void 0?i.includes(a):!0;return!!(f==="index"&&m)});return s===void 0?!1:n.join(e,s)}catch{return}}))).filter(e=>e!==void 0)}export{l as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import { promises as fs } from 'node:fs';
|
|
5
|
+
type Path = Parameters<typeof fs.writeFile>[0];
|
|
6
|
+
type ReadFileData = Awaited<ReturnType<typeof fs.readFile>>;
|
|
7
|
+
type WriteFileData = Parameters<typeof fs.writeFile>[1];
|
|
8
|
+
type ReadOptions = Parameters<typeof fs.readFile>[1];
|
|
9
|
+
type WriteOptions = Parameters<typeof fs.writeFile>[2];
|
|
10
|
+
export type EditorFunc = (curr: ReadFileData) => WriteFileData;
|
|
11
|
+
export default function readWriteFile(path: Path, editor: EditorFunc, ...options: [ReadOptions?, WriteOptions?]): Promise<string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | import("stream").Stream>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{promises as r}from"node:fs";async function d(e,s,...t){let[i,o]=t,p=await r.readFile(e,i),a=s(p),n=t.length===2?o:i;return await r.writeFile(e,a,n),a}export{d as default};
|