Comparing version 0.4.0-alpha.10 to 0.4.0-alpha.11
@@ -1,1 +0,1 @@ | ||
export declare const toHash: ((str: string, hash?: number) => number) | ((str: any) => any); | ||
export declare const toHash: (str: any) => any; |
@@ -5,7 +5,8 @@ import { stringHash } from '@saulx/hash'; | ||
let i = 0; | ||
const hash = (str) => stringHash(str) >>> 0; | ||
export const toHash = typeof window === 'object' | ||
? stringHash | ||
? hash | ||
: (str) => { | ||
// if it's ssr shorten it | ||
const h = stringHash(str); | ||
const h = hash(str); | ||
if (!(h in cache)) { | ||
@@ -12,0 +13,0 @@ i++; |
{ | ||
"name": "inlines", | ||
"description": "When you just want to use the style prop in React", | ||
"version": "0.4.0-alpha.10", | ||
"version": "0.4.0-alpha.11", | ||
"main": "dist/src/index.js", | ||
@@ -6,0 +6,0 @@ "types": "dist/src/index.d.ts", |
@@ -5,9 +5,9 @@ import { stringHash } from '@saulx/hash' | ||
let i = 0 | ||
const hash = (str) => stringHash(str) >>> 0 | ||
export const toHash = | ||
typeof window === 'object' | ||
? stringHash | ||
? hash | ||
: (str) => { | ||
// if it's ssr shorten it | ||
const h = stringHash(str) | ||
const h = hash(str) | ||
if (!(h in cache)) { | ||
@@ -14,0 +14,0 @@ i++ |
34865
902