@aesthetic/utils
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -69,9 +69,14 @@ import hash from 'string-hash'; | ||
var cache = {}; | ||
function generateHash(value) { | ||
return hash(value).toString(36); | ||
if (!cache[value]) { | ||
cache[value] = hash(value).toString(36); | ||
} | ||
return cache[value]; | ||
} | ||
var CAMEL_CASE_PATTERN = /[A-Z]/g; | ||
var VENDOR_PREFIX_PATTERN = /^(ms|moz|webkit)/; | ||
var cache = {}; | ||
var VENDOR_PREFIX_PATTERN = /^(m[s\u017F]|moz|web[k\u212A]it)/i; | ||
var cache$1 = {}; | ||
@@ -83,3 +88,3 @@ function toLower(match) { | ||
function hyphenate(value) { | ||
if (!cache[value]) { | ||
if (!cache$1[value]) { | ||
var result = value.replace(CAMEL_CASE_PATTERN, toLower); | ||
@@ -91,10 +96,15 @@ | ||
cache[value] = result; | ||
cache$1[value] = result; | ||
} | ||
return cache[value]; | ||
return cache$1[value]; | ||
} | ||
var cache$2 = null; | ||
function isSSR() { | ||
return typeof window === 'undefined' || typeof document === 'undefined'; | ||
if (cache$2 === null) { | ||
cache$2 = typeof window === 'undefined' || typeof document === 'undefined'; | ||
} | ||
return cache$2; | ||
} | ||
@@ -101,0 +111,0 @@ |
@@ -75,9 +75,14 @@ 'use strict'; | ||
var cache = {}; | ||
function generateHash(value) { | ||
return hash(value).toString(36); | ||
if (!cache[value]) { | ||
cache[value] = hash(value).toString(36); | ||
} | ||
return cache[value]; | ||
} | ||
var CAMEL_CASE_PATTERN = /[A-Z]/g; | ||
var VENDOR_PREFIX_PATTERN = /^(ms|moz|webkit)/; | ||
var cache = {}; | ||
var VENDOR_PREFIX_PATTERN = /^(m[s\u017F]|moz|web[k\u212A]it)/i; | ||
var cache$1 = {}; | ||
@@ -89,3 +94,3 @@ function toLower(match) { | ||
function hyphenate(value) { | ||
if (!cache[value]) { | ||
if (!cache$1[value]) { | ||
var result = value.replace(CAMEL_CASE_PATTERN, toLower); | ||
@@ -97,10 +102,15 @@ | ||
cache[value] = result; | ||
cache$1[value] = result; | ||
} | ||
return cache[value]; | ||
return cache$1[value]; | ||
} | ||
var cache$2 = null; | ||
function isSSR() { | ||
return typeof window === 'undefined' || typeof document === 'undefined'; | ||
if (cache$2 === null) { | ||
cache$2 = typeof window === 'undefined' || typeof document === 'undefined'; | ||
} | ||
return cache$2; | ||
} | ||
@@ -107,0 +117,0 @@ |
{ | ||
"name": "@aesthetic/utils", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Utility functions for Aesthetic.", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "709ef9a4847dbdb8566fd756ce49f2cc33507393" | ||
"gitHead": "8d188387319470948e7725874b2fe1bc8d4dc302" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
13631
244