@mxfb/cli 0.0.67 → 0.2.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/make-calendar/index.js +4 -4
- package/make-calendar/index.js.map +4 -4
- package/{cli → mfcli}/assets/list.txt +1 -3
- package/mfcli/assets/version.txt +1 -0
- package/mfcli/index.js +5 -0
- package/mfcli/index.js.map +7 -0
- package/mxfb-projects-sync/index.js +3 -2
- package/mxfb-projects-sync/index.js.map +4 -4
- package/package.json +15 -18
- package/term-glossary/index.js +0 -3
- package/term-glossary/index.js.map +2 -2
- package/tumblr-crawler/index.js +1181 -2
- package/tumblr-crawler/index.js.map +4 -4
- package/cli/assets/version.txt +0 -1
- package/cli/index.js +0 -5
- package/cli/index.js.map +0 -7
- package/make-template/assets/html/icons/about.txt +0 -6
- package/make-template/assets/html/icons/android-chrome-192x192.png +0 -0
- package/make-template/assets/html/icons/android-chrome-512x512.png +0 -0
- package/make-template/assets/html/icons/apple-touch-icon.png +0 -0
- package/make-template/assets/html/icons/favicon-16x16.png +0 -0
- package/make-template/assets/html/icons/favicon-32x32.png +0 -0
- package/make-template/assets/html/icons/favicon.ico +0 -0
- package/make-template/assets/html/icons/site.webmanifest +0 -1
- package/make-template/assets/html/index.html +0 -20
- package/make-template/assets/react/gitignore +0 -259
- package/make-template/assets/react/package.json +0 -41
- package/make-template/assets/react/public/icons/about.txt +0 -6
- package/make-template/assets/react/public/icons/android-chrome-192x192.png +0 -0
- package/make-template/assets/react/public/icons/android-chrome-512x512.png +0 -0
- package/make-template/assets/react/public/icons/apple-touch-icon.png +0 -0
- package/make-template/assets/react/public/icons/favicon-16x16.png +0 -0
- package/make-template/assets/react/public/icons/favicon-32x32.png +0 -0
- package/make-template/assets/react/public/icons/favicon.ico +0 -0
- package/make-template/assets/react/public/icons/site.webmanifest +0 -1
- package/make-template/assets/react/public/index.html +0 -19
- package/make-template/assets/react/scripts/build/index.ts +0 -44
- package/make-template/assets/react/scripts/tsconfig.json +0 -21
- package/make-template/assets/react/src/components/App/index.tsx +0 -7
- package/make-template/assets/react/src/components/App/style.module.scss +0 -3
- package/make-template/assets/react/src/index.d.ts +0 -9
- package/make-template/assets/react/src/index.tsx +0 -5
- package/make-template/assets/react/src/tsconfig.json +0 -25
- package/make-template/assets/react/src/utils/some-util/index.ts +0 -1
- package/make-template/index.js +0 -4
- package/make-template/index.js.map +0 -7
- package/tree/index.js +0 -3
- package/tree/index.js.map +0 -7
package/cli/assets/version.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.0.67
|
package/cli/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import c from"node:process";import{promises as l}from"node:fs";import u from"node:url";import r from"node:path";import{spawn as h}from"node:child_process";import{program as t}from"commander";var g=u.fileURLToPath(import.meta.url),e=r.dirname(g);t.name("@mxfb/cli").description("The home of @mxfb/cli's project");t.command("list").description("list all the available commands").action(w);t.command("version").description("print current version of the package").action(x);var b=await m();b.forEach(n=>{t.command(n,{hidden:!0}).allowUnknownOption(!0).action(async(...i)=>{let[o,a,s,...p]=c.argv;if(s===void 0)return t.help();if(!(await m()).includes(s))return t.help();let d=r.join(e,"../",s,"index.js");h(d,p,{stdio:"inherit"}).on("error",f=>console.error(`Failed to start subprogram '${s}':`,f))})});t.parse(c.argv);async function m(){let n=r.join(e,"assets/list.txt");return(await l.readFile(n,{encoding:"utf-8"})).split(`
|
|
3
|
-
`).map(o=>o.trim())}async function w(){let i=(await m()).map(o=>{let a=Object.assign(new Array(24).fill(" "),o.split("")).join("");return o==="cli"?`${a} # npx @mxfb/cli help`:`${a} # npx @mxfb/cli ${o} help`}).join(`
|
|
4
|
-
`);console.log(i)}async function x(){let n=r.join(e,"assets/version.txt"),i=await l.readFile(n,{encoding:"utf-8"});console.log(i)}
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
package/cli/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/cli/index.ts"],
|
|
4
|
-
"sourcesContent": ["import process from 'node:process'\nimport { promises as fs } from 'node:fs'\nimport url from 'node:url'\nimport path from 'node:path'\nimport { spawn } from 'node:child_process'\nimport { program } from 'commander'\n\nconst __filename = url.fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\nprogram\n .name('@mxfb/cli')\n .description('The home of @mxfb/cli\\'s project')\n \nprogram\n .command('list')\n .description('list all the available commands')\n .action(printCommands)\n\nprogram\n .command('version')\n .description('print current version of the package')\n .action(printVersion)\n\nconst subCommands = await listCommands()\nsubCommands.forEach(subCommand => {\n program\n .command(subCommand, { hidden: true })\n .allowUnknownOption(true)\n .action(async (...args) => {\n const [_nodePath, _thisPath, targetCommand, ...forwardedArgs] = process.argv\n if (targetCommand === undefined) return program.help()\n const commandsList = await listCommands()\n if (!commandsList.includes(targetCommand)) return program.help()\n const subprogramPath = path.join(__dirname, '../', targetCommand, 'index.js')\n const subprocess = spawn(subprogramPath, forwardedArgs, { stdio: 'inherit' })\n subprocess.on('error', err => console.error(`Failed to start subprogram '${targetCommand}':`, err))\n })\n})\n\nprogram.parse(process.argv)\n\nasync function listCommands () {\n const listFilePath = path.join(__dirname, 'assets/list.txt')\n const list = await fs.readFile(listFilePath, { encoding: 'utf-8' })\n return list.split('\\n').map(e => e.trim())\n}\n\nasync function printCommands () {\n const list = await listCommands()\n const output = list\n .map(c => {\n const twentyFourCharName = Object.assign(\n new Array(24).fill(' ') as string[],\n c.split('') as string[]\n ).join('')\n if (c === 'cli') return `${twentyFourCharName} # npx @mxfb/cli help`\n return `${twentyFourCharName} # npx @mxfb/cli ${c} help`\n })\n .join('\\n')\n console.log(output)\n return;\n}\n\nasync function printVersion () {\n const versionFilePath = path.join(__dirname, 'assets/version.txt')\n const version = await fs.readFile(versionFilePath, { encoding: 'utf-8' })\n console.log(version)\n return;\n}\n"],
|
|
5
|
-
"mapp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ADO,MAAMX,EAAa,GAE7B,IAAIY,GAAK,CACR,IAAMC,EAAqB,OAAO,OAChC,IAAI,MAAM,EAAE,EAAE,KAAK,GAAG,EACtBD,EAAE,MAAM,EAAE,CACZ,EAAE,KAAK,EAAE,EACT,OAAIA,IAAM,MAAc,GAAGC,CAAkB,wBACtC,GAAGA,CAAkB,oBAAoBD,CAAC,OACnD,CAAC,EACA,KAAK;AAAA,CAAI,EACZ,QAAQ,IAAID,CAAM,CAEpB,CAEA,eAAeb,GAAgB,CAC7B,IAAMgB,EAAkBtB,EAAK,KAAKI,EAAW,oBAAoB,EAC3DmB,EAAU,MAAMzB,EAAG,SAASwB,EAAiB,CAAE,SAAU,OAAQ,CAAC,EACxE,QAAQ,IAAIC,CAAO,CAErB",
|
|
6
|
-
"names": ["process", "fs", "url", "path", "spawn", "program", "__filename", "__dirname", "printCommands", "printVersion", "subCommands", "listCommands", "subCommand", "args", "_nodePath", "_thisPath", "targetCommand", "forwardedArgs", "subprogramPath", "err", "listFilePath", "e", "output", "c", "twentyFourCharName", "versionFilePath", "version"]
|
|
7
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
This favicon was generated using the following font:
|
|
2
|
-
|
|
3
|
-
- Font Title: Reddit Mono
|
|
4
|
-
- Font Author: Copyright (c) 2020-2023, Reddit, Inc. (https://github.com/reddit/redditsans)
|
|
5
|
-
- Font Source: https://fonts.gstatic.com/s/redditmono/v1/oPWc_kRmmu4oQ88oo13o48DHbsqn28eR20vUwCYacnnYz7yQYA.ttf
|
|
6
|
-
- Font License: SIL Open Font License, 1.1 (http://scripts.sil.org/OFL))
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self';">
|
|
7
|
-
<meta name="author" content="[AUTHOR]">
|
|
8
|
-
<meta name="description" content="[DESCRIPTION]">
|
|
9
|
-
<meta name="keywords" content="[KEYWORDS]">
|
|
10
|
-
<title>[TITLE]</title>
|
|
11
|
-
<link rel="apple-touch-icon" sizes="180x180" href="./icons/apple-touch-icon.png">
|
|
12
|
-
<link rel="icon" type="image/png" sizes="32x32" href="./icons/favicon-32x32.png">
|
|
13
|
-
<link rel="icon" type="image/png" sizes="16x16" href="./icons/favicon-16x16.png">
|
|
14
|
-
<link rel="manifest" href="./icons/site.webmanifest">
|
|
15
|
-
<link rel="stylesheet" href="./styles/index.css">
|
|
16
|
-
<script type="module" src="./scripts/index.js"></script>
|
|
17
|
-
</head>
|
|
18
|
-
<body>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
dist
|
|
2
|
-
|
|
3
|
-
# Created by https://www.toptal.com/developers/gitignore/api/react,nextjs,node,windows,osx,linux
|
|
4
|
-
# Edit at https://www.toptal.com/developers/gitignore?templates=react,nextjs,node,windows,osx,linux
|
|
5
|
-
|
|
6
|
-
### Linux ###
|
|
7
|
-
*~
|
|
8
|
-
|
|
9
|
-
# temporary files which can be created if a process still has a handle open of a deleted file
|
|
10
|
-
.fuse_hidden*
|
|
11
|
-
|
|
12
|
-
# KDE directory preferences
|
|
13
|
-
.directory
|
|
14
|
-
|
|
15
|
-
# Linux trash folder which might appear on any partition or disk
|
|
16
|
-
.Trash-*
|
|
17
|
-
|
|
18
|
-
# .nfs files are created when an open file is removed but is still being accessed
|
|
19
|
-
.nfs*
|
|
20
|
-
|
|
21
|
-
### NextJS ###
|
|
22
|
-
# dependencies
|
|
23
|
-
/node_modules
|
|
24
|
-
/.pnp
|
|
25
|
-
.pnp.js
|
|
26
|
-
|
|
27
|
-
# testing
|
|
28
|
-
/coverage
|
|
29
|
-
|
|
30
|
-
# next.js
|
|
31
|
-
/.next/
|
|
32
|
-
/out/
|
|
33
|
-
|
|
34
|
-
# production
|
|
35
|
-
/build
|
|
36
|
-
|
|
37
|
-
# misc
|
|
38
|
-
.DS_Store
|
|
39
|
-
*.pem
|
|
40
|
-
|
|
41
|
-
# debug
|
|
42
|
-
npm-debug.log*
|
|
43
|
-
yarn-debug.log*
|
|
44
|
-
yarn-error.log*
|
|
45
|
-
.pnpm-debug.log*
|
|
46
|
-
|
|
47
|
-
# local env files
|
|
48
|
-
.env*.local
|
|
49
|
-
|
|
50
|
-
# vercel
|
|
51
|
-
.vercel
|
|
52
|
-
|
|
53
|
-
# typescript
|
|
54
|
-
*.tsbuildinfo
|
|
55
|
-
next-env.d.ts
|
|
56
|
-
|
|
57
|
-
### Node ###
|
|
58
|
-
# Logs
|
|
59
|
-
logs
|
|
60
|
-
*.log
|
|
61
|
-
lerna-debug.log*
|
|
62
|
-
|
|
63
|
-
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
64
|
-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
65
|
-
|
|
66
|
-
# Runtime data
|
|
67
|
-
pids
|
|
68
|
-
*.pid
|
|
69
|
-
*.seed
|
|
70
|
-
*.pid.lock
|
|
71
|
-
|
|
72
|
-
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
73
|
-
lib-cov
|
|
74
|
-
|
|
75
|
-
# Coverage directory used by tools like istanbul
|
|
76
|
-
coverage
|
|
77
|
-
*.lcov
|
|
78
|
-
|
|
79
|
-
# nyc test coverage
|
|
80
|
-
.nyc_output
|
|
81
|
-
|
|
82
|
-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
83
|
-
.grunt
|
|
84
|
-
|
|
85
|
-
# Bower dependency directory (https://bower.io/)
|
|
86
|
-
bower_components
|
|
87
|
-
|
|
88
|
-
# node-waf configuration
|
|
89
|
-
.lock-wscript
|
|
90
|
-
|
|
91
|
-
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
92
|
-
build/Release
|
|
93
|
-
|
|
94
|
-
# Dependency directories
|
|
95
|
-
node_modules/
|
|
96
|
-
jspm_packages/
|
|
97
|
-
|
|
98
|
-
# Snowpack dependency directory (https://snowpack.dev/)
|
|
99
|
-
web_modules/
|
|
100
|
-
|
|
101
|
-
# TypeScript cache
|
|
102
|
-
|
|
103
|
-
# Optional npm cache directory
|
|
104
|
-
.npm
|
|
105
|
-
|
|
106
|
-
# Optional eslint cache
|
|
107
|
-
.eslintcache
|
|
108
|
-
|
|
109
|
-
# Optional stylelint cache
|
|
110
|
-
.stylelintcache
|
|
111
|
-
|
|
112
|
-
# Microbundle cache
|
|
113
|
-
.rpt2_cache/
|
|
114
|
-
.rts2_cache_cjs/
|
|
115
|
-
.rts2_cache_es/
|
|
116
|
-
.rts2_cache_umd/
|
|
117
|
-
|
|
118
|
-
# Optional REPL history
|
|
119
|
-
.node_repl_history
|
|
120
|
-
|
|
121
|
-
# Output of 'npm pack'
|
|
122
|
-
*.tgz
|
|
123
|
-
|
|
124
|
-
# Yarn Integrity file
|
|
125
|
-
.yarn-integrity
|
|
126
|
-
|
|
127
|
-
# dotenv environment variable files
|
|
128
|
-
.env
|
|
129
|
-
.env.development.local
|
|
130
|
-
.env.test.local
|
|
131
|
-
.env.production.local
|
|
132
|
-
.env.local
|
|
133
|
-
|
|
134
|
-
# parcel-bundler cache (https://parceljs.org/)
|
|
135
|
-
.cache
|
|
136
|
-
.parcel-cache
|
|
137
|
-
|
|
138
|
-
# Next.js build output
|
|
139
|
-
.next
|
|
140
|
-
out
|
|
141
|
-
|
|
142
|
-
# Nuxt.js build / generate output
|
|
143
|
-
.nuxt
|
|
144
|
-
dist
|
|
145
|
-
|
|
146
|
-
# Gatsby files
|
|
147
|
-
.cache/
|
|
148
|
-
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
149
|
-
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
150
|
-
# public
|
|
151
|
-
|
|
152
|
-
# vuepress build output
|
|
153
|
-
.vuepress/dist
|
|
154
|
-
|
|
155
|
-
# vuepress v2.x temp and cache directory
|
|
156
|
-
.temp
|
|
157
|
-
|
|
158
|
-
# Docusaurus cache and generated files
|
|
159
|
-
.docusaurus
|
|
160
|
-
|
|
161
|
-
# Serverless directories
|
|
162
|
-
.serverless/
|
|
163
|
-
|
|
164
|
-
# FuseBox cache
|
|
165
|
-
.fusebox/
|
|
166
|
-
|
|
167
|
-
# DynamoDB Local files
|
|
168
|
-
.dynamodb/
|
|
169
|
-
|
|
170
|
-
# TernJS port file
|
|
171
|
-
.tern-port
|
|
172
|
-
|
|
173
|
-
# Stores VSCode versions used for testing VSCode extensions
|
|
174
|
-
.vscode-test
|
|
175
|
-
|
|
176
|
-
# yarn v2
|
|
177
|
-
.yarn/cache
|
|
178
|
-
.yarn/unplugged
|
|
179
|
-
.yarn/build-state.yml
|
|
180
|
-
.yarn/install-state.gz
|
|
181
|
-
.pnp.*
|
|
182
|
-
|
|
183
|
-
### Node Patch ###
|
|
184
|
-
# Serverless Webpack directories
|
|
185
|
-
.webpack/
|
|
186
|
-
|
|
187
|
-
# Optional stylelint cache
|
|
188
|
-
|
|
189
|
-
# SvelteKit build / generate output
|
|
190
|
-
.svelte-kit
|
|
191
|
-
|
|
192
|
-
### OSX ###
|
|
193
|
-
# General
|
|
194
|
-
.AppleDouble
|
|
195
|
-
.LSOverride
|
|
196
|
-
|
|
197
|
-
# Icon must end with two \r
|
|
198
|
-
Icon
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
# Thumbnails
|
|
202
|
-
._*
|
|
203
|
-
|
|
204
|
-
# Files that might appear in the root of a volume
|
|
205
|
-
.DocumentRevisions-V100
|
|
206
|
-
.fseventsd
|
|
207
|
-
.Spotlight-V100
|
|
208
|
-
.TemporaryItems
|
|
209
|
-
.Trashes
|
|
210
|
-
.VolumeIcon.icns
|
|
211
|
-
.com.apple.timemachine.donotpresent
|
|
212
|
-
|
|
213
|
-
# Directories potentially created on remote AFP share
|
|
214
|
-
.AppleDB
|
|
215
|
-
.AppleDesktop
|
|
216
|
-
Network Trash Folder
|
|
217
|
-
Temporary Items
|
|
218
|
-
.apdisk
|
|
219
|
-
|
|
220
|
-
### react ###
|
|
221
|
-
.DS_*
|
|
222
|
-
**/*.backup.*
|
|
223
|
-
**/*.back.*
|
|
224
|
-
|
|
225
|
-
node_modules
|
|
226
|
-
|
|
227
|
-
*.sublime*
|
|
228
|
-
|
|
229
|
-
psd
|
|
230
|
-
thumb
|
|
231
|
-
sketch
|
|
232
|
-
|
|
233
|
-
### Windows ###
|
|
234
|
-
# Windows thumbnail cache files
|
|
235
|
-
Thumbs.db
|
|
236
|
-
Thumbs.db:encryptable
|
|
237
|
-
ehthumbs.db
|
|
238
|
-
ehthumbs_vista.db
|
|
239
|
-
|
|
240
|
-
# Dump file
|
|
241
|
-
*.stackdump
|
|
242
|
-
|
|
243
|
-
# Folder config file
|
|
244
|
-
[Dd]esktop.ini
|
|
245
|
-
|
|
246
|
-
# Recycle Bin used on file shares
|
|
247
|
-
$RECYCLE.BIN/
|
|
248
|
-
|
|
249
|
-
# Windows Installer files
|
|
250
|
-
*.cab
|
|
251
|
-
*.msi
|
|
252
|
-
*.msix
|
|
253
|
-
*.msm
|
|
254
|
-
*.msp
|
|
255
|
-
|
|
256
|
-
# Windows shortcuts
|
|
257
|
-
*.lnk
|
|
258
|
-
|
|
259
|
-
# End of https://www.toptal.com/developers/gitignore/api/react,nextjs,node,windows,osx,linux
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "-",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build:scripts": "npx tsc -p scripts/tsconfig.json",
|
|
9
|
-
"build:public": "cp -r public/* dist",
|
|
10
|
-
"build:src": "npm run build:scripts && node .scripts/build/index.js",
|
|
11
|
-
"build:src:preact": "PREACT=true npm run build:src",
|
|
12
|
-
"watch:public": "npx chokidar-cli 'public/**/*' -c 'npm run build:public'",
|
|
13
|
-
"watch:src": "WATCH=true npm run build:src",
|
|
14
|
-
"watch:src:preact": "PREACT=true npm run watch:src",
|
|
15
|
-
"make:dist": "mkdir -p dist",
|
|
16
|
-
"serve:dist": "npm run make:dist && npx http-server dist --port ${PORT} --cors -c-1",
|
|
17
|
-
"start": "npx concurrently -n 'watch:src ,watch:public,serve:dist ' 'npm run watch:src' 'npm run watch:public' 'PORT=${PORT_DIST:-3000} npm run serve:dist'",
|
|
18
|
-
"start:preact": "PREACT=true npm start"
|
|
19
|
-
},
|
|
20
|
-
"author": "",
|
|
21
|
-
"license": "ISC",
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/node": "^20.11.30",
|
|
24
|
-
"@types/react": "^18.2.72",
|
|
25
|
-
"@types/react-dom": "^18.2.22",
|
|
26
|
-
"concurrently": "^8.2.2",
|
|
27
|
-
"http-server": "^14.1.1",
|
|
28
|
-
"typescript": "^5.4.3",
|
|
29
|
-
"esbuild": "^0.20.2",
|
|
30
|
-
"esbuild-plugin-inline-image": "^0.0.9",
|
|
31
|
-
"esbuild-sass-plugin": "^3.2.0",
|
|
32
|
-
"postcss": "^8.4.38",
|
|
33
|
-
"postcss-modules": "^6.0.0",
|
|
34
|
-
"sass": "^1.74.1"
|
|
35
|
-
},
|
|
36
|
-
"dependencies": {
|
|
37
|
-
"preact": "^10.20.1",
|
|
38
|
-
"react": "^18.2.0",
|
|
39
|
-
"react-dom": "^18.2.0"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
This favicon was generated using the following font:
|
|
2
|
-
|
|
3
|
-
- Font Title: Reddit Mono
|
|
4
|
-
- Font Author: Copyright (c) 2020-2023, Reddit, Inc. (https://github.com/reddit/redditsans)
|
|
5
|
-
- Font Source: https://fonts.gstatic.com/s/redditmono/v1/oPWc_kRmmu4oQ88oo13o48DHbsqn28eR20vUwCYacnnYz7yQYA.ttf
|
|
6
|
-
- Font License: SIL Open Font License, 1.1 (http://scripts.sil.org/OFL))
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<meta name="description" content="PAGE DESCRIPTION">
|
|
7
|
-
<meta author="AUTHOR">
|
|
8
|
-
<title>TITLE</title>
|
|
9
|
-
<link rel="apple-touch-icon" sizes="180x180" href="./icons/apple-touch-icon.png">
|
|
10
|
-
<link rel="icon" type="image/png" sizes="32x32" href="./icons/favicon-32x32.png">
|
|
11
|
-
<link rel="icon" type="image/png" sizes="16x16" href="./icons/favicon-16x16.png">
|
|
12
|
-
<link rel="manifest" href="./icons/site.webmanifest">
|
|
13
|
-
<script type="module" src="http://localhost:3001/index.js"></script>
|
|
14
|
-
<link rel="stylesheet" href="http://localhost:3001/index.css">
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
<div class="root"></div>
|
|
18
|
-
</body>
|
|
19
|
-
</html>
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import esbuild, { BuildOptions } from 'esbuild'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import { sassPlugin, postcssModules } from 'esbuild-sass-plugin'
|
|
4
|
-
import inlineImageModule from 'esbuild-plugin-inline-image'
|
|
5
|
-
|
|
6
|
-
const PREACT = process.env.PREACT === 'true'
|
|
7
|
-
const WATCH = process.env.WATCH === 'true'
|
|
8
|
-
|
|
9
|
-
console.log(`scripts/build/index.ts PREACT=${PREACT} WATCH=${WATCH}`)
|
|
10
|
-
|
|
11
|
-
const options: BuildOptions = {
|
|
12
|
-
format: 'esm',
|
|
13
|
-
entryPoints: [path.join(process.cwd(), 'src/index.tsx')],
|
|
14
|
-
bundle: true,
|
|
15
|
-
outfile: path.join(process.cwd(), 'dist/index.js'),
|
|
16
|
-
minify: true,
|
|
17
|
-
platform: 'browser',
|
|
18
|
-
sourcemap: true,
|
|
19
|
-
target: ['esnext'],
|
|
20
|
-
tsconfig: path.join(process.cwd(), 'src/tsconfig.json'),
|
|
21
|
-
logLevel: 'info',
|
|
22
|
-
jsxFactory: PREACT ? 'h' : 'React.createElement',
|
|
23
|
-
jsxFragment: PREACT ? 'FRAGMENT' : 'React.Fragment',
|
|
24
|
-
plugins: [
|
|
25
|
-
inlineImageModule({ limit: -1 }),
|
|
26
|
-
sassPlugin({ filter: /\.module\.scss$/, type: 'css', transform: postcssModules({}) }),
|
|
27
|
-
sassPlugin({ filter: /.scss$/, type: 'css' })
|
|
28
|
-
],
|
|
29
|
-
alias: PREACT ? {
|
|
30
|
-
'react': 'preact/compat',
|
|
31
|
-
'react-dom/test-utils': 'preact/test-utils',
|
|
32
|
-
'react-dom': 'preact/compat',
|
|
33
|
-
'react/jsx-runtime': 'preact/jsx-runtime'
|
|
34
|
-
} : {}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (WATCH) {
|
|
38
|
-
const ctx = await esbuild.context(options)
|
|
39
|
-
await ctx.watch()
|
|
40
|
-
console.log('watching...')
|
|
41
|
-
} else {
|
|
42
|
-
await esbuild.build(options)
|
|
43
|
-
console.log('built.')
|
|
44
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"strict": true,
|
|
4
|
-
"lib": ["ESNext"],
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"target": "ESNext",
|
|
7
|
-
"baseUrl": ".",
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"outDir": "../.scripts",
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"moduleResolution": "Node",
|
|
13
|
-
"rootDir": ".",
|
|
14
|
-
"noUncheckedIndexedAccess": true,
|
|
15
|
-
},
|
|
16
|
-
"include": ["**/*"],
|
|
17
|
-
"exclude": [
|
|
18
|
-
"../node_modules",
|
|
19
|
-
"../.scripts"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"baseUrl": ".",
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"noUncheckedIndexedAccess": true,
|
|
10
|
-
"strict": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"module": "esnext",
|
|
13
|
-
"moduleResolution": "node",
|
|
14
|
-
"resolveJsonModule": true,
|
|
15
|
-
"isolatedModules": true,
|
|
16
|
-
"noEmit": true,
|
|
17
|
-
"jsx": "react-jsx",
|
|
18
|
-
"paths": {
|
|
19
|
-
"~/components/*": ["./components/*"],
|
|
20
|
-
"~/utils/*": ["./utils/*"]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"include": ["./"],
|
|
24
|
-
"files": ["./index.d.ts"]
|
|
25
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
package/make-template/index.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import n from"node:process";import{promises as a,existsSync as u}from"node:fs";import j from"node:url";import t from"node:path";import{spawn as w}from"node:child_process";import{program as i}from"commander";import y from"prompts";import P from"@mxfb/tools/utils/node/read-write-file/index.js";var k=j.fileURLToPath(import.meta.url),d=t.dirname(k),c=n.cwd();i.name("@mxfb/make-template").description("Generate in cwd a project template");i.command("html").description("make simple html project structure").action(x);i.command("react").description("make react + typescript project structure").action(S);i.parse(n.argv);async function x(){let e=t.join(d,"assets/html");if(!u(e))return console.error(`Could not find the template to copy at ${e}`),n.exit(1);let o=t.join(c,"html-template");await a.cp(e,o,{recursive:!0})}async function S(){let e=t.join(d,"assets/react");if(!u(e))return console.error(`Could not find the template to copy at ${e}`),n.exit(1);let o=t.join(c,"react-template");await a.cp(e,o,{recursive:!0});let{projectName:p}=await y({name:"projectName",message:"Project name ? (for package.json name field)",type:"text"}),g=t.join(o,"package.json");await P(g,r=>{let s=typeof r=="string"?r:r.toString(),f=JSON.parse(s);delete f.name;let h={name:p,...f};return`${JSON.stringify(h,null,2)}
|
|
3
|
-
`},{encoding:"utf-8"});let l=w(`cd ${o} && npm i`,{stdio:"inherit",shell:!0});await new Promise((r,s)=>{l.on("exit",()=>r(!0)),l.on("error",()=>s(!1))});let m=t.join(c,p);await a.rename(o,m),await a.rename(t.join(m,"gitignore"),t.join(m,".gitignore"))}
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/make-template/index.ts"],
|
|
4
|
-
"sourcesContent": ["import process from 'node:process'\nimport { promises as fs, existsSync } from 'node:fs'\nimport url from 'node:url'\nimport path from 'node:path'\nimport { spawn } from 'node:child_process'\nimport { program } from 'commander'\nimport prompts from 'prompts'\nimport readWriteFile from '@mxfb/tools/utils/node/read-write-file/index.js'\n\nconst __filename = url.fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\nconst CWD = process.cwd()\n\nprogram\n .name('@mxfb/make-template')\n .description('Generate in cwd a project template')\n \nprogram\n .command('html')\n .description('make simple html project structure')\n .action(makeHtml)\n\nprogram\n .command('react')\n .description('make react + typescript project structure')\n .action(makeReact)\n\nprogram.parse(process.argv)\n\nasync function makeHtml () {\n const htmlTemplatePath = path.join(__dirname, 'assets/html')\n if (!existsSync(htmlTemplatePath)) {\n console.error(`Could not find the template to copy at ${htmlTemplatePath}`)\n return process.exit(1)\n }\n const targetPath = path.join(CWD, 'html-template')\n await fs.cp(htmlTemplatePath, targetPath, { recursive: true })\n}\n\nasync function makeReact () {\n const htmlTemplatePath = path.join(__dirname, 'assets/react')\n if (!existsSync(htmlTemplatePath)) {\n console.error(`Could not find the template to copy at ${htmlTemplatePath}`)\n return process.exit(1)\n }\n const defaultTargetPath = path.join(CWD, 'react-template')\n \n // Copy\n await fs.cp(htmlTemplatePath, defaultTargetPath, { recursive: true })\n const { projectName } = await prompts({\n name: 'projectName',\n message: 'Project name ? (for package.json name field)',\n type: 'text'\n })\n \n // Custom name\n const packageJsonPath = path.join(defaultTargetPath, 'package.json')\n await readWriteFile(packageJsonPath, rawContent => {\n const content = typeof rawContent === 'string'\n ? rawContent\n : rawContent.toString()\n const contentObj = JSON.parse(content) as Record<string, string>\n delete contentObj.name\n const newContentObj = {\n name: projectName,\n ...contentObj\n }\n return `${JSON.stringify(newContentObj, null, 2)}\\n`\n }, { encoding: 'utf-8' })\n \n // Install deps\n const npmISubprocess = spawn(`cd ${defaultTargetPath} && npm i`, { stdio: 'inherit', shell: true })\n await new Promise((resolve, reject) => {\n npmISubprocess.on('exit', () => resolve(true))\n npmISubprocess.on('error', () => reject(false))\n })\n\n // Rename project\n const targetPath = path.join(CWD, projectName)\n await fs.rename(defaultTargetPath, targetPath)\n\n // Rename gitignore\n await fs.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KAAM,cACN,QAAS,+CACT,KAAM,MACR,CAAC,EAGKW,EAAkBd,EAAK,KAAKY,EAAmB,cAAc,EACnE,MAAMR,EAAcU,EAAiBC,GAAc,CACjD,IAAMC,EAAU,OAAOD,GAAe,SAClCA,EACAA,EAAW,SAAS,EAClBE,EAAa,KAAK,MAAMD,CAAO,EACrC,OAAOC,EAAW,KAClB,IAAMC,EAAgB,CACpB,KAAML,EACN,GAAGI,CACL,EACA,MAAO,GAAG,KAAK,UAAUC,EAAe,KAAM,CAAC,CAAC;AAAA,CAClD,EAAG,CAAE,SAAU,OAAQ,CAAC,EAGxB,IAAMC,EAAiBlB,EAAM,MAAMW,CAAiB,YAAa,CAAE,MAAO,UAAW,MAAO,EAAK,CAAC,EAClG,MAAM,IAAI,QAAQ,CAACQ,EAASC,IAAW,CACrCF,EAAe,GAAG,OAAQ,IAAMC,EAAQ,EAAI,CAAC,EAC7CD,EAAe,GAAG,QAAS,IAAME,EAAO,EAAK,CAAC,CAChD,CAAC,EAGD,IAAMV,EAAaX,EAAK,KAAKO,EAAKM,CAAW,EAC7C,MAAMhB,EAAG,OAAOe,EAAmBD,CAAU,EAG7C,MAAMd,EAAG,OACPG,EAAK,KAAKW,EAAY,WAAW,EACjCX,EAAK,KAAKW,EAAY,YAAY,CACpC,CACF",
|
|
6
|
-
"names": ["process", "fs", "existsSync", "url", "path", "spawn", "program", "prompts", "readWriteFile", "__filename", "__dirname", "CWD", "makeHtml", "makeReact", "htmlTemplatePath", "targetPath", "defaultTargetPath", "projectName", "packageJsonPath", "rawContent", "content", "contentObj", "newContentObj", "npmISubprocess", "resolve", "reject"]
|
|
7
|
-
}
|
package/tree/index.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{program as b}from"commander";import w from"@mxfb/tools/utils/node/list-subpaths/index.js";import f from"@mxfb/tools/utils/node/is-in-directory/index.js";var h=process.cwd();b.name("@mxfb/tree").description("List subpaths from the current working directory").argument("[depth]","Depth (optional, defaults to 0)").option("-f, --files [bool]","Include files",i,!0).option("-H, --hidden [bool]","Include hidden files",i,!0).option("-d, --directories [bool]","Include directories",i,!0).option("-s, --symlinks [bool]","Include symlinks",i,!0).option("-F, --follow [bool]","Follow symlinks",i,!1).option("-u, --unique [bool]","Ensures followed symlinks contents don't create duplicates",i,!1).option("-e, --exclude [pattern]","Regexp patterns to exclude from the result").option("-i, --include [pattern]","Regexp patterns to include in the result").action(async(n,e)=>{let r=n!==void 0?parseInt(n):0;if(Number.isNaN(r))return console.error("Depth should be a number"),process.exit(1);let s=(await w(h,{maxDepth:r,files:e.files,hidden:e.hidden,directories:e.directories,symlinks:e.symlinks,followSimlinks:e.follow,dedupeSimlinksContents:e.unique,exclude:m(e.exclude),include:m(e.include),returnRelative:!0})).reduce((u,l)=>{let a=x(l),c={value:l,level:a,children:[]};u.filter(t=>t.level===a-1&&f(l,t.value)).forEach(t=>t.children.push(c));let p=u.filter(t=>t.level===a+1&&f(t.value,l));return c.children.push(...p),[...u,c]},[]);console.log(h),g(s)});b.parse(process.argv);function i(n){let e=`${n}`.trim().toLowerCase();if(e==="true")return!0;if(e==="false")return!1}function m(n){if(typeof n!="string")return;let e=/^\/(.+)\/([a-z]*)$/,r=n.match(e);if(r===null)return;let[,o,s]=r;return new RegExp(o,s)}function x(n){return n.split("/").length-1}function g(n,e=0,r=[]){n.filter(o=>o.level===e).forEach((o,s,u)=>{let l=s===u.length-1,a=l?"\u2514\u2500\u2500":"\u251C\u2500\u2500",{value:c,level:d,children:p}=o,t=c.split("/").slice(d).join("/"),v=new Array(d).fill(null).map((y,k)=>r[k]===!0?" ":"\u2502 ").join("");console.log(`${v}${a} ${t}`),g(p,d+1,[...r,l])})}
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
package/tree/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/tree/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { program } from 'commander'\nimport listSubpaths from '@mxfb/tools/utils/node/list-subpaths/index.js'\nimport isInDirectory from '@mxfb/tools/utils/node/is-in-directory/index.js'\n\nconst CWD = process.cwd()\n\ntype SubpathData = {\n value: string\n level: number\n children: SubpathData[]\n}\n\nprogram\n .name('@mxfb/tree')\n .description('List subpaths from the current working directory')\n .argument('[depth]', 'Depth (optional, defaults to 0)')\n .option('-f, --files [bool]', 'Include files', parseBoolean, true)\n .option('-H, --hidden [bool]', 'Include hidden files', parseBoolean, true)\n .option('-d, --directories [bool]', 'Include directories', parseBoolean, true)\n .option('-s, --symlinks [bool]', 'Include symlinks', parseBoolean, true)\n .option('-F, --follow [bool]', 'Follow symlinks', parseBoolean, false)\n .option('-u, --unique [bool]', 'Ensures followed symlinks contents don\\'t create duplicates', parseBoolean, false)\n .option('-e, --exclude [pattern]', 'Regexp patterns to exclude from the result')\n .option('-i, --include [pattern]', 'Regexp patterns to include in the result')\n .action(async (_depth, options) => {\n const depth = _depth !== undefined ? parseInt(_depth) : 0\n if (Number.isNaN(depth)) {\n console.error('Depth should be a number')\n return process.exit(1)\n }\n const subpaths = await listSubpaths(CWD, {\n maxDepth: depth,\n files: options.files,\n hidden: options.hidden,\n directories: options.directories,\n symlinks: options.symlinks,\n followSimlinks: options.follow,\n dedupeSimlinksContents: options.unique,\n exclude: makeRegexp(options.exclude),\n include: makeRegexp(options.include),\n returnRelative: true\n })\n const subpathsData = subpaths.reduce<SubpathData[]>((reduced, subpath) => {\n const level = getLevel(subpath)\n const thisSubpathData = {\n value: subpath,\n level,\n children: [] as SubpathData[]\n }\n // Parents\n const parents = reduced.filter(subpathData => subpathData.level === level - 1 && isInDirectory(subpath, subpathData.value))\n parents.forEach(parent => parent.children.push(thisSubpathData))\n // Children\n const children = reduced.filter(subpathData => subpathData.level === level + 1 && isInDirectory(subpathData.value, subpath))\n thisSubpathData.children.push(...children)\n return [...reduced, thisSubpathData]\n }, [])\n console.log(CWD)\n printSubpathData(subpathsData)\n })\n\nprogram.parse(process.argv)\n\nfunction parseBoolean (val: unknown) {\n const strVal = `${val}`.trim().toLowerCase()\n if (strVal === 'true') return true\n if (strVal === 'false') return false\n return undefined\n}\n\nfunction makeRegexp (strRegexp: unknown) {\n if (typeof strRegexp !== 'string') return undefined\n const validRegexpRegexp = /^\\/(.+)\\/([a-z]*)$/\n const inputMatches = strRegexp.match(validRegexpRegexp)\n if (inputMatches === null) return undefined\n const [, pattern, flags] = inputMatches\n return new RegExp(pattern!, flags!)\n}\n\nfunction getLevel (path: string) {\n const chunks = path.split('/')\n return chunks.length - 1\n}\n\nfunction printSubpathData (\n subpathsData: SubpathData[],\n level: number = 0,\n parentsAreLastMap: boolean[] = []) {\n subpathsData\n .filter(subpathData => subpathData.level === level)\n .forEach((subpathsData, pos, filtered) => {\n const isLast = pos === filtered.length - 1\n const indentChar = isLast ? '\u2514\u2500\u2500' : '\u251C\u2500\u2500'\n const { value, level, children } = subpathsData\n const toPrint = value.split('/').slice(level).join('/')\n const indentChars = new Array(level).fill(null).map((e, pos) => {\n if (parentsAreLastMap[pos] === true) return ' '\n else return '\u2502 '\n }).join('')\n console.log(`${indentChars}${indentChar} ${toPrint}`)\n printSubpathData(children, level + 1, [...parentsAreLastMap, isLast])\n })\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,WAAAA,MAAe,YACxB,OAAOC,MAAkB,gDACzB,OAAOC,MAAmB,kDAE1B,IAAMC,EAAM,QAAQ,IAAI,EAQxBH,EACG,KAAK,YAAY,EACjB,YAAY,kDAAkD,EAC9D,SAAS,UAAW,iCAAiC,EACrD,OAAO,qBAAsB,gBAAiBI,EAAc,EAAI,EAChE,OAAO,sBAAuB,uBAAwBA,EAAc,EAAI,EACxE,OAAO,2BAA4B,sBAAuBA,EAAc,EAAI,EAC5E,OAAO,wBAAyB,mBAAoBA,EAAc,EAAI,EACtE,OAAO,sBAAuB,kBAAmBA,EAAc,EAAK,EACpE,OAAO,sBAAuB,6DAA+D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AEA,SAASX,EAAYY,EAAoB,CACvC,GAAI,OAAOA,GAAc,SAAU,OACnC,IAAMC,EAAoB,qBACpBC,EAAeF,EAAU,MAAMC,CAAiB,EACtD,GAAIC,IAAiB,KAAM,OAC3B,GAAM,CAAC,CAAEC,EAASC,CAAK,EAAIF,EAC3B,OAAO,IAAI,OAAOC,EAAUC,CAAM,CACpC,CAEA,SAASZ,EAAUa,EAAc,CAE/B,OADeA,EAAK,MAAM,GAAG,EACf,OAAS,CACzB,CAEA,SAASR,EACPV,EACAI,EAAgB,EAChBe,EAA+B,CAAC,EAAG,CACnCnB,EACG,OAAOO,GAAeA,EAAY,QAAUH,CAAK,EACjD,QAAQ,CAACJ,EAAcoB,EAAKC,IAAa,CACxC,IAAMC,EAASF,IAAQC,EAAS,OAAS,EACnCE,EAAaD,EAAS,qBAAQ,qBAC9B,CAAE,MAAAE,EAAO,MAAApB,EAAO,SAAAK,CAAS,EAAIT,EAC7ByB,EAAUD,EAAM,MAAM,GAAG,EAAE,MAAMpB,CAAK,EAAE,KAAK,GAAG,EAChDsB,EAAc,IAAI,MAAMtB,CAAK,EAAE,KAAK,IAAI,EAAE,IAAI,CAACuB,EAAGP,IAClDD,EAAkBC,CAAG,IAAM,GAAa,OAChC,WACb,EAAE,KAAK,EAAE,EACV,QAAQ,IAAI,GAAGM,CAAW,GAAGH,CAAU,IAAIE,CAAO,EAAE,EACpDf,EAAiBD,EAAUL,EAAQ,EAAG,CAAC,GAAGe,EAAmBG,CAAM,CAAC,CACtE,CAAC,CACL",
|
|
6
|
-
"names": ["program", "listSubpaths", "isInDirectory", "CWD", "parseBoolean", "_depth", "options", "depth", "subpathsData", "makeRegexp", "reduced", "subpath", "level", "getLevel", "thisSubpathData", "subpathData", "parent", "children", "printSubpathData", "val", "strVal", "strRegexp", "validRegexpRegexp", "inputMatches", "pattern", "flags", "path", "parentsAreLastMap", "pos", "filtered", "isLast", "indentChar", "value", "toPrint", "indentChars", "e"]
|
|
7
|
-
}
|