jiek 2.3.2 → 2.3.4

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.
Files changed (81) hide show
  1. package/dist/.internal/.chunks/{filterSupport.4rM7f6jB.cjs → getWD.Bdo2NGCR.cjs} +30 -30
  2. package/dist/.internal/.chunks/{filterSupport.BXWpLBpT.js → getWD.DGvwAHMY.js} +29 -29
  3. package/dist/.internal/.chunks/{loadConfig.OOKddvHF.cjs → loadConfig.8xhNFEJe.cjs} +30 -12
  4. package/dist/.internal/.chunks/{loadConfig.CFfzkm_p.js → loadConfig.BjzxLOdC.js} +26 -9
  5. package/dist/.internal/bin/common.cjs +92 -97
  6. package/dist/.internal/bin/common.d.cts +2 -0
  7. package/dist/.internal/bin/common.d.ts +2 -0
  8. package/dist/.internal/bin/common.js +93 -98
  9. package/dist/.internal/bin/parseArgv.cjs +2 -2
  10. package/dist/.internal/bin/parseArgv.js +2 -2
  11. package/dist/.internal/commands/utils/createAreaManagement.cjs +108 -0
  12. package/dist/.internal/commands/utils/createAreaManagement.d.cts +18 -0
  13. package/dist/.internal/commands/utils/createAreaManagement.d.ts +18 -0
  14. package/dist/.internal/commands/utils/createAreaManagement.js +106 -0
  15. package/dist/.internal/polyfill.cjs +13 -0
  16. package/dist/.internal/polyfill.d.cts +1 -0
  17. package/dist/.internal/polyfill.d.ts +1 -0
  18. package/dist/.internal/polyfill.js +11 -0
  19. package/dist/.internal/rollup/base.d.cts +27 -4
  20. package/dist/.internal/rollup/base.d.ts +27 -4
  21. package/dist/.internal/utils/filterSupport.cjs +1 -1
  22. package/dist/.internal/utils/filterSupport.js +2 -2
  23. package/dist/.internal/utils/loadConfig.cjs +3 -3
  24. package/dist/.internal/utils/loadConfig.d.cts +1 -0
  25. package/dist/.internal/utils/loadConfig.d.ts +1 -0
  26. package/dist/.internal/utils/loadConfig.js +4 -4
  27. package/dist/.internal/utils/pascalCase.cjs +5 -0
  28. package/dist/.internal/utils/pascalCase.d.cts +3 -0
  29. package/dist/.internal/utils/pascalCase.d.ts +3 -0
  30. package/dist/.internal/utils/pascalCase.js +3 -0
  31. package/dist/.internal/utils/reveal.cjs +9 -0
  32. package/dist/.internal/utils/reveal.d.cts +3 -0
  33. package/dist/.internal/utils/reveal.d.ts +3 -0
  34. package/dist/.internal/utils/reveal.js +7 -0
  35. package/dist/bin/index.cjs +101 -43
  36. package/dist/index.d.cts +7 -0
  37. package/dist/index.d.ts +7 -0
  38. package/dist/rollup/index.cjs +91 -31
  39. package/dist/rollup/index.js +90 -30
  40. package/package.json +6 -2
  41. package/src/bin/build.cts +0 -5
  42. package/src/bin/common.ts +0 -3
  43. package/src/bin/index.cts +0 -7
  44. package/src/bin/parseArgv.ts +0 -26
  45. package/src/bridge.ts +0 -46
  46. package/src/commands/base.ts +0 -18
  47. package/src/commands/build/analyzer.ts +0 -122
  48. package/src/commands/build/client/analyzer.tsx +0 -121
  49. package/src/commands/build/client/index.ts +0 -26
  50. package/src/commands/build.ts +0 -544
  51. package/src/commands/descriptions.ts +0 -17
  52. package/src/commands/meta.ts +0 -5
  53. package/src/commands/publish.ts +0 -628
  54. package/src/commands/utils/optionParser.ts +0 -4
  55. package/src/index.ts +0 -12
  56. package/src/inner.ts +0 -11
  57. package/src/rollup/base.ts +0 -151
  58. package/src/rollup/bundle-analyzer.ts +0 -62
  59. package/src/rollup/index.ts +0 -892
  60. package/src/rollup/plugins/create-require.ts +0 -23
  61. package/src/rollup/plugins/progress.ts +0 -26
  62. package/src/rollup/plugins/replace.ts +0 -96
  63. package/src/rollup/plugins/skip.ts +0 -21
  64. package/src/rollup/plugins/with-external.ts +0 -23
  65. package/src/rollup/utils/commonOptions.ts +0 -9
  66. package/src/rollup/utils/externalResolver.ts +0 -47
  67. package/src/rollup/utils/globalResolver.ts +0 -13
  68. package/src/rollup/utils/withMinify.ts +0 -18
  69. package/src/rollup-plugin-utils.ts +0 -32
  70. package/src/server.ts +0 -30
  71. package/src/utils/checkDependency.ts +0 -26
  72. package/src/utils/filterSupport.ts +0 -90
  73. package/src/utils/getInternalModuleName.ts +0 -5
  74. package/src/utils/getRoot.ts +0 -14
  75. package/src/utils/getWD.ts +0 -31
  76. package/src/utils/intersection.ts +0 -1
  77. package/src/utils/loadConfig.ts +0 -108
  78. package/src/utils/recursiveListFiles.ts +0 -13
  79. package/src/utils/resolveExports.ts +0 -165
  80. package/src/utils/ts.ts +0 -94
  81. package/src/utils/tsRegister.ts +0 -22
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var commander = require('commander');
4
3
  var process = require('node:process');
4
+ var commander = require('commander');
5
5
 
6
6
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
7
 
@@ -12,7 +12,7 @@ const env = {};
12
12
  let isPassThrough = false;
13
13
  const newArgv = argv.filter((arg) => {
14
14
  if (isPassThrough) {
15
- return true;
15
+ return false;
16
16
  }
17
17
  if (arg === "--") {
18
18
  isPassThrough = true;
@@ -1,12 +1,12 @@
1
- import { program } from 'commander';
2
1
  import process from 'node:process';
2
+ import { program } from 'commander';
3
3
 
4
4
  const { argv } = process;
5
5
  const env = {};
6
6
  let isPassThrough = false;
7
7
  const newArgv = argv.filter((arg) => {
8
8
  if (isPassThrough) {
9
- return true;
9
+ return false;
10
10
  }
11
11
  if (arg === "--") {
12
12
  isPassThrough = true;
@@ -0,0 +1,108 @@
1
+ 'use strict';
2
+
3
+ const createAreaManagement = (options) => {
4
+ const { outputLines } = options;
5
+ let i = 0;
6
+ const areaSizeList = [];
7
+ function create({
8
+ maxSize: inputMaxSize = options.maxSize ?? 3,
9
+ header,
10
+ footer
11
+ } = {}) {
12
+ const current = i++;
13
+ const hasHeader = header !== void 0;
14
+ const hasFooter = footer !== void 0;
15
+ areaSizeList.push(hasHeader ? 1 : 0);
16
+ const waitLogLines = [];
17
+ let isExited = false;
18
+ const noLogLines = Promise.withResolvers();
19
+ const update = () => {
20
+ if (waitLogLines.length === 0) {
21
+ if (isExited) noLogLines.resolve();
22
+ return;
23
+ }
24
+ const maxSize = inputMaxSize + (hasHeader ? 1 : 0) + (hasFooter ? 1 : 0);
25
+ const offset = areaSizeList.reduce((acc, size, index) => {
26
+ if (index < current) {
27
+ return acc + size;
28
+ }
29
+ return acc;
30
+ }, 0);
31
+ const contentLogLines = waitLogLines.splice(0, maxSize);
32
+ const currentLogLines = [
33
+ ...hasHeader ? [header] : [],
34
+ ...contentLogLines,
35
+ ...hasFooter ? [footer] : []
36
+ ];
37
+ const curLen = currentLogLines.length;
38
+ if (hasFooter && curLen > 0) {
39
+ const prevAreaSize = areaSizeList[current];
40
+ areaSizeList[current] -= outputLines.splice(offset + prevAreaSize - 1, 1).length;
41
+ }
42
+ for (let i2 = 0; i2 < curLen; i2++) {
43
+ const isHeader = hasHeader && i2 === 0;
44
+ const isFooter = hasFooter && i2 === curLen - 1;
45
+ const line = currentLogLines.shift();
46
+ const areaSize = areaSizeList[current];
47
+ let insertIndex = i2;
48
+ if (areaSize < maxSize) {
49
+ insertIndex = areaSize - (hasFooter ? 1 : 0);
50
+ if (!isHeader) {
51
+ areaSizeList[current]++;
52
+ }
53
+ }
54
+ if (areaSize === maxSize) {
55
+ outputLines.splice(
56
+ offset + (hasHeader ? 1 : 0),
57
+ 1
58
+ );
59
+ insertIndex = maxSize - 1;
60
+ if (isFooter) {
61
+ insertIndex = insertIndex - 1;
62
+ }
63
+ }
64
+ if (isHeader) {
65
+ outputLines[offset] = line;
66
+ } else {
67
+ insertIndex += hasHeader ? 1 : 0;
68
+ outputLines.splice(
69
+ offset + insertIndex,
70
+ 0,
71
+ line
72
+ );
73
+ }
74
+ }
75
+ options.onAreaUpdate?.();
76
+ };
77
+ const timer = setInterval(update, 10);
78
+ return {
79
+ exit: async () => {
80
+ if (waitLogLines.length !== 0) {
81
+ isExited = true;
82
+ await noLogLines.promise;
83
+ }
84
+ clearTimeout(timer);
85
+ },
86
+ info: (message) => {
87
+ waitLogLines.push(...message.split("\n").filter((s) => s.trim() !== ""));
88
+ },
89
+ setHeader: (newHeader) => {
90
+ if (header == null) {
91
+ throw new Error('You can only set header when header is already, use create({ header: "header" })');
92
+ }
93
+ header = newHeader;
94
+ update();
95
+ },
96
+ setFooter: (newFooter) => {
97
+ if (footer == null) {
98
+ throw new Error('You can only set footer when footer is already, use create({ footer: "footer" })');
99
+ }
100
+ footer = newFooter;
101
+ update();
102
+ }
103
+ };
104
+ }
105
+ return { create };
106
+ };
107
+
108
+ exports.createAreaManagement = createAreaManagement;
@@ -0,0 +1,18 @@
1
+ declare const createAreaManagement: (options: {
2
+ outputLines: string[];
3
+ onAreaUpdate?: () => void;
4
+ maxSize?: number;
5
+ }) => {
6
+ create: ({ maxSize: inputMaxSize, header, footer }?: {
7
+ maxSize?: number;
8
+ header?: string;
9
+ footer?: string;
10
+ }) => {
11
+ exit: () => Promise<void>;
12
+ info: (message: string) => void;
13
+ setHeader: (newHeader: string) => void;
14
+ setFooter: (newFooter: string) => void;
15
+ };
16
+ };
17
+
18
+ export { createAreaManagement };
@@ -0,0 +1,18 @@
1
+ declare const createAreaManagement: (options: {
2
+ outputLines: string[];
3
+ onAreaUpdate?: () => void;
4
+ maxSize?: number;
5
+ }) => {
6
+ create: ({ maxSize: inputMaxSize, header, footer }?: {
7
+ maxSize?: number;
8
+ header?: string;
9
+ footer?: string;
10
+ }) => {
11
+ exit: () => Promise<void>;
12
+ info: (message: string) => void;
13
+ setHeader: (newHeader: string) => void;
14
+ setFooter: (newFooter: string) => void;
15
+ };
16
+ };
17
+
18
+ export { createAreaManagement };
@@ -0,0 +1,106 @@
1
+ const createAreaManagement = (options) => {
2
+ const { outputLines } = options;
3
+ let i = 0;
4
+ const areaSizeList = [];
5
+ function create({
6
+ maxSize: inputMaxSize = options.maxSize ?? 3,
7
+ header,
8
+ footer
9
+ } = {}) {
10
+ const current = i++;
11
+ const hasHeader = header !== void 0;
12
+ const hasFooter = footer !== void 0;
13
+ areaSizeList.push(hasHeader ? 1 : 0);
14
+ const waitLogLines = [];
15
+ let isExited = false;
16
+ const noLogLines = Promise.withResolvers();
17
+ const update = () => {
18
+ if (waitLogLines.length === 0) {
19
+ if (isExited) noLogLines.resolve();
20
+ return;
21
+ }
22
+ const maxSize = inputMaxSize + (hasHeader ? 1 : 0) + (hasFooter ? 1 : 0);
23
+ const offset = areaSizeList.reduce((acc, size, index) => {
24
+ if (index < current) {
25
+ return acc + size;
26
+ }
27
+ return acc;
28
+ }, 0);
29
+ const contentLogLines = waitLogLines.splice(0, maxSize);
30
+ const currentLogLines = [
31
+ ...hasHeader ? [header] : [],
32
+ ...contentLogLines,
33
+ ...hasFooter ? [footer] : []
34
+ ];
35
+ const curLen = currentLogLines.length;
36
+ if (hasFooter && curLen > 0) {
37
+ const prevAreaSize = areaSizeList[current];
38
+ areaSizeList[current] -= outputLines.splice(offset + prevAreaSize - 1, 1).length;
39
+ }
40
+ for (let i2 = 0; i2 < curLen; i2++) {
41
+ const isHeader = hasHeader && i2 === 0;
42
+ const isFooter = hasFooter && i2 === curLen - 1;
43
+ const line = currentLogLines.shift();
44
+ const areaSize = areaSizeList[current];
45
+ let insertIndex = i2;
46
+ if (areaSize < maxSize) {
47
+ insertIndex = areaSize - (hasFooter ? 1 : 0);
48
+ if (!isHeader) {
49
+ areaSizeList[current]++;
50
+ }
51
+ }
52
+ if (areaSize === maxSize) {
53
+ outputLines.splice(
54
+ offset + (hasHeader ? 1 : 0),
55
+ 1
56
+ );
57
+ insertIndex = maxSize - 1;
58
+ if (isFooter) {
59
+ insertIndex = insertIndex - 1;
60
+ }
61
+ }
62
+ if (isHeader) {
63
+ outputLines[offset] = line;
64
+ } else {
65
+ insertIndex += hasHeader ? 1 : 0;
66
+ outputLines.splice(
67
+ offset + insertIndex,
68
+ 0,
69
+ line
70
+ );
71
+ }
72
+ }
73
+ options.onAreaUpdate?.();
74
+ };
75
+ const timer = setInterval(update, 10);
76
+ return {
77
+ exit: async () => {
78
+ if (waitLogLines.length !== 0) {
79
+ isExited = true;
80
+ await noLogLines.promise;
81
+ }
82
+ clearTimeout(timer);
83
+ },
84
+ info: (message) => {
85
+ waitLogLines.push(...message.split("\n").filter((s) => s.trim() !== ""));
86
+ },
87
+ setHeader: (newHeader) => {
88
+ if (header == null) {
89
+ throw new Error('You can only set header when header is already, use create({ header: "header" })');
90
+ }
91
+ header = newHeader;
92
+ update();
93
+ },
94
+ setFooter: (newFooter) => {
95
+ if (footer == null) {
96
+ throw new Error('You can only set footer when footer is already, use create({ footer: "footer" })');
97
+ }
98
+ footer = newFooter;
99
+ update();
100
+ }
101
+ };
102
+ }
103
+ return { create };
104
+ };
105
+
106
+ export { createAreaManagement };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ if (typeof Promise.withResolvers === "undefined") {
4
+ Promise.withResolvers = () => {
5
+ let resolve;
6
+ let reject;
7
+ const promise = new Promise((res, rej) => {
8
+ resolve = res;
9
+ reject = rej;
10
+ });
11
+ return { promise, resolve, reject };
12
+ };
13
+ }
@@ -0,0 +1 @@
1
+ export { }
@@ -0,0 +1 @@
1
+ export { }
@@ -0,0 +1,11 @@
1
+ if (typeof Promise.withResolvers === "undefined") {
2
+ Promise.withResolvers = () => {
3
+ let resolve;
4
+ let reject;
5
+ const promise = new Promise((res, rej) => {
6
+ resolve = res;
7
+ reject = rej;
8
+ });
9
+ return { promise, resolve, reject };
10
+ };
11
+ }
@@ -2,16 +2,38 @@ import * as _rollup_plugin_terser from '@rollup/plugin-terser';
2
2
  import * as rollup_plugin_swc3 from 'rollup-plugin-swc3';
3
3
  import * as rollup_plugin_esbuild from 'rollup-plugin-esbuild';
4
4
  import { OutputOptions, InputPluginOption } from 'rollup';
5
+ import { SgNode, Lang } from '@ast-grep/napi';
6
+ import { FilterOptions } from 'jiek/rollup-plugin-utils';
5
7
 
6
- interface ReplacementFuncCtx {
8
+ type Mode = 'string' | 'ast-grep';
9
+ type ReplacementFuncCtx = {
7
10
  type: 'transform' | 'renderChunk';
8
11
  id: string;
9
12
  code: string;
13
+ mode: Mode;
14
+ } & ({
15
+ mode?: 'string';
10
16
  start: number;
11
17
  end: number;
12
- }
13
- type ReplacementFunc = (ctx: ReplacementFuncCtx) => string;
14
- type Replacements = Record<string, string | ReplacementFunc>;
18
+ } | {
19
+ mode?: 'ast-grep';
20
+ $: ((name: string) => string | undefined) & ((template: {
21
+ raw: readonly string[];
22
+ }) => string | undefined);
23
+ node: SgNode;
24
+ lang: Lang;
25
+ });
26
+ type Falsy = false | null | undefined;
27
+ type ReplacementFunc = (ctx: ReplacementFuncCtx) => string | Falsy;
28
+ type Replacements = Record<string, string | Falsy | ReplacementFunc>;
29
+ type ReplaceOptions = FilterOptions & {
30
+ /**
31
+ * @default 'string'
32
+ */
33
+ mode?: Mode;
34
+ sourcemap?: boolean;
35
+ values?: Replacements;
36
+ };
15
37
 
16
38
  type Mapping2ROO<K extends keyof OutputOptions> = OutputOptions[K] | {
17
39
  js?: OutputOptions[K];
@@ -137,6 +159,7 @@ interface TemplateOptions {
137
159
  * ```
138
160
  */
139
161
  replacements?: Replacements;
162
+ replacementsOptions?: Pick<ReplaceOptions, 'mode' | 'include' | 'exclude'>;
140
163
  }
141
164
 
142
165
  export { BUILDER_TYPES, BUILDER_TYPE_PACKAGE_NAME_MAP, type ConfigGenerateContext, type Mapping2ROO, type OutputControl, type TemplateOptions };
@@ -2,16 +2,38 @@ import * as _rollup_plugin_terser from '@rollup/plugin-terser';
2
2
  import * as rollup_plugin_swc3 from 'rollup-plugin-swc3';
3
3
  import * as rollup_plugin_esbuild from 'rollup-plugin-esbuild';
4
4
  import { OutputOptions, InputPluginOption } from 'rollup';
5
+ import { SgNode, Lang } from '@ast-grep/napi';
6
+ import { FilterOptions } from 'jiek/rollup-plugin-utils';
5
7
 
6
- interface ReplacementFuncCtx {
8
+ type Mode = 'string' | 'ast-grep';
9
+ type ReplacementFuncCtx = {
7
10
  type: 'transform' | 'renderChunk';
8
11
  id: string;
9
12
  code: string;
13
+ mode: Mode;
14
+ } & ({
15
+ mode?: 'string';
10
16
  start: number;
11
17
  end: number;
12
- }
13
- type ReplacementFunc = (ctx: ReplacementFuncCtx) => string;
14
- type Replacements = Record<string, string | ReplacementFunc>;
18
+ } | {
19
+ mode?: 'ast-grep';
20
+ $: ((name: string) => string | undefined) & ((template: {
21
+ raw: readonly string[];
22
+ }) => string | undefined);
23
+ node: SgNode;
24
+ lang: Lang;
25
+ });
26
+ type Falsy = false | null | undefined;
27
+ type ReplacementFunc = (ctx: ReplacementFuncCtx) => string | Falsy;
28
+ type Replacements = Record<string, string | Falsy | ReplacementFunc>;
29
+ type ReplaceOptions = FilterOptions & {
30
+ /**
31
+ * @default 'string'
32
+ */
33
+ mode?: Mode;
34
+ sourcemap?: boolean;
35
+ values?: Replacements;
36
+ };
15
37
 
16
38
  type Mapping2ROO<K extends keyof OutputOptions> = OutputOptions[K] | {
17
39
  js?: OutputOptions[K];
@@ -137,6 +159,7 @@ interface TemplateOptions {
137
159
  * ```
138
160
  */
139
161
  replacements?: Replacements;
162
+ replacementsOptions?: Pick<ReplaceOptions, 'mode' | 'include' | 'exclude'>;
140
163
  }
141
164
 
142
165
  export { BUILDER_TYPES, BUILDER_TYPE_PACKAGE_NAME_MAP, type ConfigGenerateContext, type Mapping2ROO, type OutputControl, type TemplateOptions };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var filterSupport = require('../.chunks/filterSupport.4rM7f6jB.cjs');
3
+ var filterSupport = require('../.chunks/getWD.Bdo2NGCR.cjs');
4
4
  require('node:fs');
5
5
  require('node:path');
6
6
  require('node:process');
@@ -1,8 +1,8 @@
1
- export { f as filterPackagesGraph, a as getSelectedProjectsGraph, t as type } from '../.chunks/filterSupport.BXWpLBpT.js';
1
+ export { f as filterPackagesGraph, a as getSelectedProjectsGraph, t as type } from '../.chunks/getWD.DGvwAHMY.js';
2
2
  import 'node:fs';
3
3
  import 'node:path';
4
4
  import 'node:process';
5
5
  import 'commander';
6
6
  import 'js-yaml';
7
- import 'node:module';
8
7
  import '@jiek/utils/getWorkspaceDir';
8
+ import 'node:module';
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- require('../.chunks/filterSupport.4rM7f6jB.cjs');
3
+ require('../.chunks/getWD.Bdo2NGCR.cjs');
4
4
  require('node:fs');
5
5
  require('node:path');
6
+ require('node:process');
6
7
  require('commander');
7
8
  require('js-yaml');
8
- var loadConfig = require('../.chunks/loadConfig.OOKddvHF.cjs');
9
- require('node:process');
9
+ var loadConfig = require('../.chunks/loadConfig.8xhNFEJe.cjs');
10
10
  require('@jiek/utils/getWorkspaceDir');
11
11
 
12
12
 
@@ -3,6 +3,7 @@ import { Config } from 'jiek';
3
3
  interface LoadConfigOptions {
4
4
  dir?: string;
5
5
  root?: string;
6
+ configPath?: string;
6
7
  }
7
8
  declare function loadConfig(options?: LoadConfigOptions): Config;
8
9
  declare function loadConfig(dir?: string): Config;
@@ -3,6 +3,7 @@ import { Config } from 'jiek';
3
3
  interface LoadConfigOptions {
4
4
  dir?: string;
5
5
  root?: string;
6
+ configPath?: string;
6
7
  }
7
8
  declare function loadConfig(options?: LoadConfigOptions): Config;
8
9
  declare function loadConfig(dir?: string): Config;
@@ -1,9 +1,9 @@
1
- import '../.chunks/filterSupport.BXWpLBpT.js';
1
+ import '../.chunks/getWD.DGvwAHMY.js';
2
2
  import 'node:fs';
3
3
  import 'node:path';
4
+ import 'node:process';
4
5
  import 'commander';
5
6
  import 'js-yaml';
6
- export { l as loadConfig } from '../.chunks/loadConfig.CFfzkm_p.js';
7
- import 'node:module';
8
- import 'node:process';
7
+ export { l as loadConfig } from '../.chunks/loadConfig.BjzxLOdC.js';
9
8
  import '@jiek/utils/getWorkspaceDir';
9
+ import 'node:module';
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const pascalCase = (str) => str.replace(/[@|/-](\w)/g, (_, $1) => $1.toUpperCase()).replace(/(?:^|-)(\w)/g, (_, $1) => $1.toUpperCase());
4
+
5
+ exports.pascalCase = pascalCase;
@@ -0,0 +1,3 @@
1
+ declare const pascalCase: (str: string) => string;
2
+
3
+ export { pascalCase };
@@ -0,0 +1,3 @@
1
+ declare const pascalCase: (str: string) => string;
2
+
3
+ export { pascalCase };
@@ -0,0 +1,3 @@
1
+ const pascalCase = (str) => str.replace(/[@|/-](\w)/g, (_, $1) => $1.toUpperCase()).replace(/(?:^|-)(\w)/g, (_, $1) => $1.toUpperCase());
2
+
3
+ export { pascalCase };
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ const reveal = (obj, keys) => keys.reduce((acc, key) => {
4
+ if (typeof acc === "string") throw new Error("key not found in exports");
5
+ if (!(key in acc)) throw new Error(`key ${key} not found in exports`);
6
+ return acc[key];
7
+ }, obj);
8
+
9
+ exports.reveal = reveal;
@@ -0,0 +1,3 @@
1
+ declare const reveal: (obj: string | Record<string, unknown>, keys: string[]) => string | Record<string, unknown>;
2
+
3
+ export { reveal };
@@ -0,0 +1,3 @@
1
+ declare const reveal: (obj: string | Record<string, unknown>, keys: string[]) => string | Record<string, unknown>;
2
+
3
+ export { reveal };
@@ -0,0 +1,7 @@
1
+ const reveal = (obj, keys) => keys.reduce((acc, key) => {
2
+ if (typeof acc === "string") throw new Error("key not found in exports");
3
+ if (!(key in acc)) throw new Error(`key ${key} not found in exports`);
4
+ return acc[key];
5
+ }, obj);
6
+
7
+ export { reveal };