@design-edito/tools 0.0.32 → 0.0.33
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +2 -0
- package/package.json +1 -1
- package/utils/agnostic/is-in-enum/index.d.ts +1 -1
- package/utils/agnostic/is-in-enum/index.js +1 -1
- package/utils/agnostic/record-format/index.d.ts +11 -6
- package/utils/agnostic/record-format/index.js +1 -1
- package/utils/agnostic/string-normalize-indent/index.d.ts +1 -0
- package/utils/agnostic/string-normalize-indent/index.js +3 -0
package/index.js
CHANGED
@@ -34,6 +34,7 @@ import * as selectorToElement from './utils/agnostic/selector-to-element/index.j
|
|
34
34
|
import * as silentLog from './utils/agnostic/silent-log/index.js'
|
35
35
|
import * as strToNodes from './utils/agnostic/str-to-nodes/index.js'
|
36
36
|
import * as stringMatches from './utils/agnostic/string-matches/index.js'
|
37
|
+
import * as stringNormalizeIndent from './utils/agnostic/string-normalize-indent/index.js'
|
37
38
|
import * as throttleDebounce from './utils/agnostic/throttle-debounce/index.js'
|
38
39
|
import * as toAlphanum from './utils/agnostic/to-alphanum/index.js'
|
39
40
|
import * as transition from './utils/agnostic/transition/index.js'
|
@@ -81,6 +82,7 @@ export { selectorToElement }
|
|
81
82
|
export { silentLog }
|
82
83
|
export { strToNodes }
|
83
84
|
export { stringMatches }
|
85
|
+
export { stringNormalizeIndent }
|
84
86
|
export { throttleDebounce }
|
85
87
|
export { toAlphanum }
|
86
88
|
export { transition }
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export default function isInEnum<E extends
|
1
|
+
export default function isInEnum<E extends Record<string, string | number>>(enumObj: E, value: string | number): value is E[keyof E];
|
@@ -1 +1 @@
|
|
1
|
-
function
|
1
|
+
function l(s,n){let t=Object.keys(s),c=Object.values(s).filter(e=>typeof e=="number");return t.filter(e=>!c.includes(parseInt(e,10))).map(e=>s[e]).includes(n)}export{l as default};
|
@@ -1,6 +1,11 @@
|
|
1
|
-
type
|
2
|
-
type
|
3
|
-
export
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
export type FormatKey<Input extends {} = any> = keyof Input | string;
|
2
|
+
export type InputValue<Input extends {}, Key extends FormatKey<Input>> = Input extends Record<Key, infer V> ? V : undefined;
|
3
|
+
export type FormatterFunc<I, O> = (val: I) => O | Promise<O>;
|
4
|
+
export type Format<Input extends {} = any> = {
|
5
|
+
[Key in FormatKey<Input>]: FormatterFunc<InputValue<Input, Key>, any>;
|
6
|
+
};
|
7
|
+
export type UnwrapPromise<PromiseOrNot> = PromiseOrNot extends Promise<infer Resolved> ? Resolved : PromiseOrNot;
|
8
|
+
export type Formatted<F extends Format<{}>> = {
|
9
|
+
[Key in keyof F]: UnwrapPromise<ReturnType<F[Key]>>;
|
10
|
+
};
|
11
|
+
export default function recordFormat<I extends {}, F extends Format<I>>(input: I, format: F): Promise<Formatted<F>>;
|
@@ -1 +1 @@
|
|
1
|
-
async function
|
1
|
+
async function a(o,n){let t={};for(let e in n){let r=n[e];typeof r=="function"?t[e]=await r(o[e]):t[e]=r}return t}export{a as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function stringNormalizeIndent(input: string, indentLevel?: number): string;
|