dogu-utils 0.0.5 → 0.0.6

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { useState, useCallback, createContext, useContext } from 'react';
1
+ import { useState, useCallback, useContext, createContext } from 'react';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
 
4
4
  var useOpenCloseState = function useOpenCloseState(initialState) {
@@ -38,4 +38,3 @@ var createSafeContext = function createSafeContext(defaultValue) {
38
38
  };
39
39
 
40
40
  export { createSafeContext, useOpenCloseState };
41
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ export * from "./react";
2
+ export * from "./types";
@@ -0,0 +1 @@
1
+ export declare const useOpenCloseState: (initialState?: boolean) => readonly [boolean, () => void, () => void];
@@ -0,0 +1,2 @@
1
+ export * from "./hooks/useOpenCloseState";
2
+ export * from "./utils/createSafeContext";
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from "react";
2
+ type ProviderProps<Value> = {
3
+ children: ReactNode;
4
+ value: Value;
5
+ };
6
+ export declare const createSafeContext: <Value>(defaultValue?: Value) => readonly [({ children, value }: ProviderProps<Value>) => import("react/jsx-runtime").JSX.Element, () => Value & ({} | undefined)];
7
+ export {};
@@ -0,0 +1 @@
1
+ export type EmptyObject = Record<PropertyKey, never>;
@@ -0,0 +1 @@
1
+ export * from "./EmptyObject";
@@ -0,0 +1,8 @@
1
+ type Callback<T> = (...params: unknown[]) => T;
2
+ export declare class EarlyReturn<T> {
3
+ returnValue: T | undefined;
4
+ case(condition: boolean, func: Callback<T>): EarlyReturn<T>;
5
+ default(func: Callback<T>): T;
6
+ private isAlreadyReturned;
7
+ }
8
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./EarlyReturn";
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
package/package.json CHANGED
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "name": "dogu-utils",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "main": "./dist/index.js",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
8
  "types": "./dist/index.d.ts",
9
9
  "type": "module",
10
+ "scripts": {
11
+ "publish": "pnpm run build && npm publish --access=public",
12
+ "build": "rollup -c",
13
+ "watch": "rollup -cw",
14
+ "test": "vitest"
15
+ },
10
16
  "devDependencies": {
11
17
  "@babel/core": "^7.24.4",
12
18
  "@babel/preset-env": "^7.24.4",
@@ -20,10 +26,5 @@
20
26
  },
21
27
  "peerDependencies": {
22
28
  "react": "^18.2.0"
23
- },
24
- "scripts": {
25
- "build": "rollup -c",
26
- "watch": "rollup -cw",
27
- "test": "vitest"
28
29
  }
29
- }
30
+ }