@abpreact/store
Advanced tools
+1
-1
| { | ||
| "name": "@abpreact/store", | ||
| "version": "0.0.2", | ||
| "version": "0.0.3", | ||
| "main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/index.mjs", |
| import * as React from 'react'; | ||
| /** | ||
| * Return a slugified copy of a string. | ||
| * | ||
| * @param {string} str The string to be slugified | ||
| * @return {string} The slugified string. | ||
| */ | ||
| declare function toSlug(str: string): string; | ||
| /** | ||
| * On the server, React emits a warning when calling `useLayoutEffect`. | ||
| * This is because neither `useLayoutEffect` nor `useEffect` run on the server. | ||
| * We use this safe version which suppresses the warning by replacing it with a noop on the server. | ||
| * | ||
| * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect | ||
| */ | ||
| declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect; | ||
| declare function usePrevious<T>(value: T): T; | ||
| export { toSlug, useIsomorphicLayoutEffect, usePrevious }; |
| "use strict"; | ||
| var __create = Object.create; | ||
| var __defProp = Object.defineProperty; | ||
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
| var __getOwnPropNames = Object.getOwnPropertyNames; | ||
| var __getProtoOf = Object.getPrototypeOf; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
| var __export = (target, all) => { | ||
| for (var name in all) | ||
| __defProp(target, name, { get: all[name], enumerable: true }); | ||
| }; | ||
| var __copyProps = (to, from, except, desc) => { | ||
| if (from && typeof from === "object" || typeof from === "function") { | ||
| for (let key of __getOwnPropNames(from)) | ||
| if (!__hasOwnProp.call(to, key) && key !== except) | ||
| __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
| } | ||
| return to; | ||
| }; | ||
| var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
| isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
| mod | ||
| )); | ||
| var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
| // src/index.tsx | ||
| var src_exports = {}; | ||
| __export(src_exports, { | ||
| toSlug: () => toSlug, | ||
| useIsomorphicLayoutEffect: () => useIsomorphicLayoutEffect, | ||
| usePrevious: () => usePrevious | ||
| }); | ||
| module.exports = __toCommonJS(src_exports); | ||
| // src/toSlug.ts | ||
| function toSlug(str) { | ||
| let s = str; | ||
| if (!s) { | ||
| return ""; | ||
| } | ||
| s = s.toLowerCase().trim(); | ||
| s = s.replace(/ & /g, " and "); | ||
| s = s.replace(/[ ]+/g, "-"); | ||
| s = s.replace(/[-]+/g, "-"); | ||
| s = s.replace(/[^a-z0-9-]+/g, ""); | ||
| return s; | ||
| } | ||
| // src/useIsomorphicLayoutEffect.tsx | ||
| var React = __toESM(require("react")); | ||
| var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : () => { | ||
| }; | ||
| // src/usePrevious.tsx | ||
| var React2 = __toESM(require("react")); | ||
| function usePrevious(value) { | ||
| const ref = React2.useRef(value); | ||
| React2.useEffect(() => { | ||
| ref.current = value; | ||
| }, [value]); | ||
| return ref.current; | ||
| } | ||
| // Annotate the CommonJS export names for ESM import in node: | ||
| 0 && (module.exports = { | ||
| toSlug, | ||
| useIsomorphicLayoutEffect, | ||
| usePrevious | ||
| }); |
| // src/toSlug.ts | ||
| function toSlug(str) { | ||
| let s = str; | ||
| if (!s) { | ||
| return ""; | ||
| } | ||
| s = s.toLowerCase().trim(); | ||
| s = s.replace(/ & /g, " and "); | ||
| s = s.replace(/[ ]+/g, "-"); | ||
| s = s.replace(/[-]+/g, "-"); | ||
| s = s.replace(/[^a-z0-9-]+/g, ""); | ||
| return s; | ||
| } | ||
| // src/useIsomorphicLayoutEffect.tsx | ||
| import * as React from "react"; | ||
| var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : () => { | ||
| }; | ||
| // src/usePrevious.tsx | ||
| import * as React2 from "react"; | ||
| function usePrevious(value) { | ||
| const ref = React2.useRef(value); | ||
| React2.useEffect(() => { | ||
| ref.current = value; | ||
| }, [value]); | ||
| return ref.current; | ||
| } | ||
| export { | ||
| toSlug, | ||
| useIsomorphicLayoutEffect, | ||
| usePrevious | ||
| }; |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
825
-81.37%1
-75%0
-100%1
Infinity%