@grantpearceuk/hooks 0.1.1 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  import { Dispatch } from "react";
2
- declare type DarkMode = [enabled: boolean, setDarkMode: Dispatch<unknown>];
2
+ type DarkMode = [enabled: boolean, setDarkMode: Dispatch<unknown>];
3
3
  export default function useDarkMode(): DarkMode;
4
4
  export {};
@@ -1,2 +1,2 @@
1
- export declare type Dependencies = [unknown] | [];
1
+ export type Dependencies = [unknown] | [];
2
2
  export default function useDeepCompareEffect(callback: () => void, dependencies?: Dependencies): void;
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -1,3 +1,3 @@
1
- declare type GenerateID = () => (suffix: string) => string;
1
+ type GenerateID = () => (suffix: string) => string;
2
2
  declare const useGenerateHtmlId: GenerateID;
3
3
  export default useGenerateHtmlId;
@@ -4,6 +4,6 @@ var react_1 = require("react");
4
4
  var counter = 0;
5
5
  var useGenerateHtmlId = function () {
6
6
  var id = (0, react_1.useMemo)(function () { return ++counter; }, []);
7
- return function (suffix) { return "id" + id + "_" + suffix; };
7
+ return function (suffix) { return "id".concat(id, "_").concat(suffix); };
8
8
  };
9
9
  exports.default = useGenerateHtmlId;
@@ -1,5 +1,5 @@
1
1
  import { Dispatch } from "react";
2
- declare type StorageObject = [value: any, setValue: Dispatch<unknown>, remove: () => void];
2
+ type StorageObject = [value: any, setValue: Dispatch<unknown>, remove: () => void];
3
3
  export declare function useLocalStorage(key: string, defaultValue?: any): StorageObject;
4
4
  export declare function useSessionStorage(key: string, defaultValue?: any): StorageObject;
5
5
  export {};
@@ -1,4 +1,4 @@
1
1
  import { Dispatch } from "react";
2
- declare type DarkMode = [enabled: boolean, setDarkMode: Dispatch<unknown>];
2
+ type DarkMode = [enabled: boolean, setDarkMode: Dispatch<unknown>];
3
3
  export default function useDarkMode(): DarkMode;
4
4
  export {};
@@ -1,2 +1,2 @@
1
- export declare type Dependencies = [unknown] | [];
1
+ export type Dependencies = [unknown] | [];
2
2
  export default function useDeepCompareEffect(callback: () => void, dependencies?: Dependencies): void;
@@ -24,7 +24,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
24
24
  function verb(n) { return function (v) { return step([n, v]); }; }
25
25
  function step(op) {
26
26
  if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
28
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
29
  if (y = 0, t) op = [op[0] & 2, t.value];
30
30
  switch (op[0]) {
@@ -1,3 +1,3 @@
1
- declare type GenerateID = () => (suffix: string) => string;
1
+ type GenerateID = () => (suffix: string) => string;
2
2
  declare const useGenerateHtmlId: GenerateID;
3
3
  export default useGenerateHtmlId;
@@ -2,6 +2,6 @@ import { useMemo } from "react";
2
2
  var counter = 0;
3
3
  var useGenerateHtmlId = function () {
4
4
  var id = useMemo(function () { return ++counter; }, []);
5
- return function (suffix) { return "id" + id + "_" + suffix; };
5
+ return function (suffix) { return "id".concat(id, "_").concat(suffix); };
6
6
  };
7
7
  export default useGenerateHtmlId;
@@ -1,5 +1,5 @@
1
1
  import { Dispatch } from "react";
2
- declare type StorageObject = [value: any, setValue: Dispatch<unknown>, remove: () => void];
2
+ type StorageObject = [value: any, setValue: Dispatch<unknown>, remove: () => void];
3
3
  export declare function useLocalStorage(key: string, defaultValue?: any): StorageObject;
4
4
  export declare function useSessionStorage(key: string, defaultValue?: any): StorageObject;
5
5
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grantpearceuk/hooks",
3
- "version": "0.1.1",
3
+ "version": "1.0.1",
4
4
  "main": "./lib/cjs/index.js",
5
5
  "module": "./lib/esm/index.js",
6
6
  "types": "./lib/esm/index.d.ts",
@@ -12,38 +12,31 @@
12
12
  "build:cjs": "tsc --module commonjs --outDir lib/cjs",
13
13
  "publish-public": "npm publish --access public"
14
14
  },
15
+ "files": [
16
+ "/lib"
17
+ ],
15
18
  "dependencies": {
16
- "@material-ui/core": "^4.12.3",
17
- "@testing-library/jest-dom": "^5.14.1",
18
- "@testing-library/react": "^11.2.7",
19
- "@testing-library/user-event": "^12.8.3",
20
- "copy-to-clipboard": "^3.3.1",
19
+ "copy-to-clipboard": "^3.3.3",
21
20
  "js-cookie": "^3.0.1",
22
21
  "lodash": "^4.17.21",
23
- "react-scripts": "4.0.3",
24
- "standard-version": "^9.5.0",
25
- "web-vitals": "^1.1.2"
22
+ "react": "^18.2.0",
23
+ "react-dom": "^18.2.0",
24
+ "react-scripts": "^5.0.1",
25
+ "standard-version": "^9.5.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@testing-library/react-hooks": "^7.0.2",
29
- "@types/jest": "^27.0.1",
30
- "@types/js-cookie": "^3.0.0",
31
- "@types/lodash": "^4.14.175",
32
- "@types/react": "^17.0.21",
33
- "@types/react-dom": "^17.0.9",
34
- "@typescript-eslint/eslint-plugin": "^4.33.0",
35
- "@typescript-eslint/parser": "^4.33.0",
36
- "eslint": "^7.32.0",
37
- "eslint-config-prettier": "^8.3.0",
38
- "eslint-plugin-prettier": "^4.0.0",
39
- "prettier": "^2.4.1",
40
- "typescript": "^4.4.3"
41
- },
42
- "peerDependencies": {
43
- "react": "^17.0.2",
44
- "react-dom": "^17.0.2"
45
- },
46
- "files": [
47
- "/lib"
48
- ]
28
+ "@types/jest": "^29.4.0",
29
+ "@types/js-cookie": "^3.0.2",
30
+ "@types/lodash": "^4.14.191",
31
+ "@types/node": "^18.13.0",
32
+ "@types/react": "^18.0.28",
33
+ "@types/react-dom": "^18.0.11",
34
+ "@typescript-eslint/eslint-plugin": "^5.52.0",
35
+ "@typescript-eslint/parser": "^5.52.0",
36
+ "eslint": "^8.34.0",
37
+ "eslint-config-prettier": "^8.6.0",
38
+ "eslint-plugin-prettier": "^4.2.1",
39
+ "prettier": "^2.8.4",
40
+ "typescript": "^4.9.5"
41
+ }
49
42
  }