@aesthetic/utils
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -15,2 +15,3 @@ /** | ||
import isObject from './isObject'; | ||
import joinQueries from './joinQueries'; | ||
import objectCreate from './objectCreate'; | ||
@@ -21,3 +22,3 @@ import objectLoop from './objectLoop'; | ||
export * from './types'; | ||
export { arrayLoop, arrayReduce, attempt, createState, deepClone, deepMerge, generateHash, hyphenate, isDOM, isObject, objectCreate, objectLoop, objectReduce, toArray, }; | ||
export { arrayLoop, arrayReduce, attempt, createState, deepClone, deepMerge, generateHash, hyphenate, isDOM, isObject, joinQueries, objectCreate, objectLoop, objectReduce, toArray, }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -156,2 +156,22 @@ import hash from 'string-hash'; | ||
function joinQueries(prev, next) { | ||
if (prev && next) { | ||
if (prev.includes(next)) { | ||
return prev; | ||
} | ||
return prev + " and " + next; | ||
} | ||
if (next) { | ||
return next; | ||
} | ||
if (prev) { | ||
return prev; | ||
} | ||
return ''; | ||
} | ||
function objectCreate(keys, callback) { | ||
@@ -183,3 +203,3 @@ var object = {}; | ||
export { arrayLoop, arrayReduce, attempt, createState, deepClone, deepMerge, generateHash, hyphenate, isDOM, isObject, objectCreate, objectLoop, objectReduce, toArray }; | ||
export { arrayLoop, arrayReduce, attempt, createState, deepClone, deepMerge, generateHash, hyphenate, isDOM, isObject, joinQueries, objectCreate, objectLoop, objectReduce, toArray }; | ||
//# sourceMappingURL=index.js.map |
@@ -170,2 +170,22 @@ 'use strict'; | ||
function joinQueries(prev, next) { | ||
if (prev && next) { | ||
if (prev.includes(next)) { | ||
return prev; | ||
} | ||
return prev + " and " + next; | ||
} | ||
if (next) { | ||
return next; | ||
} | ||
if (prev) { | ||
return prev; | ||
} | ||
return ''; | ||
} | ||
function objectCreate(keys, callback) { | ||
@@ -207,2 +227,3 @@ var object = {}; | ||
exports.isObject = isObject; | ||
exports.joinQueries = joinQueries; | ||
exports.objectCreate = objectCreate; | ||
@@ -209,0 +230,0 @@ exports.objectLoop = objectLoop; |
{ | ||
"name": "@aesthetic/utils", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Utility functions for Aesthetic.", | ||
@@ -34,3 +34,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "ea906850a7bd7f911a5d05cc79a811253630f94c" | ||
"gitHead": "7bb66e4727a310474a5412d037e2b1393c57540a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
29364
41
392