@aesthetic/utils
Advanced tools
Comparing version 0.4.4 to 0.4.5
@@ -43,2 +43,17 @@ import hash from 'string-hash'; | ||
function createState(defaultValue) { | ||
var value = defaultValue; | ||
return { | ||
get: function get() { | ||
return value; | ||
}, | ||
reset: function reset() { | ||
value = undefined; | ||
}, | ||
set: function set(nextValue) { | ||
value = nextValue; | ||
} | ||
}; | ||
} | ||
function objectLoop(object, callback) { | ||
@@ -165,2 +180,2 @@ var keys = Object.keys(object); | ||
export { arrayLoop, arrayReduce, attempt, deepClone, deepMerge, generateHash, hyphenate, isObject, isSSR, objectCreate, objectLoop, objectReduce, toArray }; | ||
export { arrayLoop, arrayReduce, attempt, createState, deepClone, deepMerge, generateHash, hyphenate, isObject, isSSR, objectCreate, objectLoop, objectReduce, toArray }; |
@@ -8,2 +8,3 @@ /** | ||
import attempt from './attempt'; | ||
import createState from './createState'; | ||
import deepClone from './deepClone'; | ||
@@ -20,3 +21,3 @@ import deepMerge from './deepMerge'; | ||
export * from './types'; | ||
export { arrayLoop, arrayReduce, attempt, deepClone, deepMerge, generateHash, hyphenate, isObject, isSSR, objectCreate, objectLoop, objectReduce, toArray, }; | ||
export { arrayLoop, arrayReduce, attempt, createState, deepClone, deepMerge, generateHash, hyphenate, isObject, isSSR, objectCreate, objectLoop, objectReduce, toArray, }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -51,2 +51,17 @@ 'use strict'; | ||
function createState(defaultValue) { | ||
var value = defaultValue; | ||
return { | ||
get: function get() { | ||
return value; | ||
}, | ||
reset: function reset() { | ||
value = undefined; | ||
}, | ||
set: function set(nextValue) { | ||
value = nextValue; | ||
} | ||
}; | ||
} | ||
function objectLoop(object, callback) { | ||
@@ -176,2 +191,3 @@ var keys = Object.keys(object); | ||
exports.attempt = attempt; | ||
exports.createState = createState; | ||
exports.deepClone = deepClone; | ||
@@ -178,0 +194,0 @@ exports.deepMerge = deepMerge; |
{ | ||
"name": "@aesthetic/utils", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"description": "Utility functions for Aesthetic.", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "9bae5a0e88a3727367cd289b5174cb2ecb42a91f" | ||
"gitHead": "ae0de0b1a4e87ec62e8c519ac5aea0261317994e" | ||
} |
Sorry, the diff of this file is not supported yet
37
17263
350