@oneplatformdev/utils 0.1.1-2 → 0.1.1-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.
- package/eslint.config.mjs +23 -0
- package/package.json +10 -7
- package/src/cn/cn.ts +7 -0
- package/src/cn/index.ts +1 -0
- package/src/composeRefs/composeRefs.ts +12 -0
- package/src/composeRefs/index.ts +1 -0
- package/src/index.ts +3 -0
- package/src/types/PartialOne.ts +1 -0
- package/src/types/index.ts +1 -0
- package/tsconfig.json +10 -0
- package/tsconfig.lib.json +14 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import baseConfig from "../../eslint.config.mjs";
|
|
2
|
+
|
|
3
|
+
export default [
|
|
4
|
+
...baseConfig,
|
|
5
|
+
{
|
|
6
|
+
"files": [
|
|
7
|
+
"**/*.json"
|
|
8
|
+
],
|
|
9
|
+
"rules": {
|
|
10
|
+
"@nx/dependency-checks": [
|
|
11
|
+
"error",
|
|
12
|
+
{
|
|
13
|
+
"ignoredFiles": [
|
|
14
|
+
"{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"languageOptions": {
|
|
20
|
+
"parser": (await import('jsonc-eslint-parser'))
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneplatformdev/utils",
|
|
3
|
-
"version": "0.1.1-
|
|
3
|
+
"version": "0.1.1-4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -9,19 +9,22 @@
|
|
|
9
9
|
"./package.json": "./package.json",
|
|
10
10
|
".": {
|
|
11
11
|
"@oneplatformdev/source": "./src/index.ts",
|
|
12
|
-
"types": "./
|
|
13
|
-
"import": "./
|
|
14
|
-
"default": "./
|
|
12
|
+
"types": "./index.d.ts",
|
|
13
|
+
"import": "./index.js",
|
|
14
|
+
"default": "./index.js"
|
|
15
15
|
},
|
|
16
16
|
"./*": {
|
|
17
17
|
"@oneplatformdev/source": "./src/*.ts",
|
|
18
|
-
"types": "
|
|
19
|
-
"import": "
|
|
20
|
-
"default": "
|
|
18
|
+
"types": "./*.d.ts",
|
|
19
|
+
"import": "./*.js",
|
|
20
|
+
"default": "./*.js"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
25
|
+
"*",
|
|
26
|
+
"src",
|
|
27
|
+
"lib",
|
|
25
28
|
"!**/*.tsbuildinfo"
|
|
26
29
|
],
|
|
27
30
|
"dependencies": {
|
package/src/cn/cn.ts
ADDED
package/src/cn/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, cn } from './cn';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Ref, RefCallback } from "react";
|
|
2
|
+
|
|
3
|
+
export function composeRefs<T>(...refs: Array<Ref<T> | undefined | null>) {
|
|
4
|
+
return (node: T | null) => {
|
|
5
|
+
for (const ref of refs) {
|
|
6
|
+
if (!ref) continue;
|
|
7
|
+
if (typeof ref === "function") (ref as RefCallback<T>)(node);
|
|
8
|
+
else (ref as { current: T | null }).current = node;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export default composeRefs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, composeRefs } from './composeRefs';
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type PartialOne<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './PartialOne'
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"rootDir": "src",
|
|
6
|
+
"outDir": "dist",
|
|
7
|
+
"tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo",
|
|
8
|
+
"emitDeclarationOnly": false,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"types": ["node"]
|
|
11
|
+
},
|
|
12
|
+
"include": ["src/**/*.ts"],
|
|
13
|
+
"references": []
|
|
14
|
+
}
|