@baggie/functions
Advanced tools
Comparing version 1.3.5 to 1.4.0
@@ -6,7 +6,7 @@ "use strict"; | ||
test("Insert single value", () => { | ||
expect(intersperse_1.intersperse([1, 2], 3)).toStrictEqual([1, 3, 2]); | ||
expect(intersperse_1.intersperse(["a", "c"], "bbb")).toStrictEqual(["a", "bbb", "c"]); | ||
expect((0, intersperse_1.intersperse)([1, 2], 3)).toStrictEqual([1, 3, 2]); | ||
expect((0, intersperse_1.intersperse)(["a", "c"], "bbb")).toStrictEqual(["a", "bbb", "c"]); | ||
}); | ||
test("Insert multiple values", () => { | ||
expect(intersperse_1.intersperse([10, 15], 11, 12, 13, 14)).toStrictEqual([ | ||
expect((0, intersperse_1.intersperse)([10, 15], 11, 12, 13, 14)).toStrictEqual([ | ||
10, | ||
@@ -19,3 +19,3 @@ 11, | ||
]); | ||
expect(intersperse_1.intersperse([10, 15], ...["11", 12, "13", 14])).toStrictEqual([ | ||
expect((0, intersperse_1.intersperse)([10, 15], ...["11", 12, "13", 14])).toStrictEqual([ | ||
10, | ||
@@ -30,6 +30,6 @@ "11", | ||
test("Insert value with function", () => { | ||
expect(intersperse_1.intersperse([10, 12], ({ previous, next }) => previous + (next - previous) / 2)).toStrictEqual([10, 11, 12]); | ||
expect(intersperse_1.intersperse([1, 2, 3, 4], ({ previous, next }) => previous + (next - previous) / 2)).toStrictEqual([1, 1.5, 2, 2.5, 3, 3.5, 4]); | ||
expect(intersperse_1.intersperse([1, 2, 3, 4], ({ previous, next }) => previous + (next - previous) / 2, "hello")).toStrictEqual([1, 1.5, "hello", 2, 2.5, "hello", 3, 3.5, "hello", 4]); | ||
expect((0, intersperse_1.intersperse)([10, 12], ({ previous, next }) => previous + (next - previous) / 2)).toStrictEqual([10, 11, 12]); | ||
expect((0, intersperse_1.intersperse)([1, 2, 3, 4], ({ previous, next }) => previous + (next - previous) / 2)).toStrictEqual([1, 1.5, 2, 2.5, 3, 3.5, 4]); | ||
expect((0, intersperse_1.intersperse)([1, 2, 3, 4], ({ previous, next }) => previous + (next - previous) / 2, "hello")).toStrictEqual([1, 1.5, "hello", 2, 2.5, "hello", 3, 3.5, "hello", 4]); | ||
}); | ||
}); |
@@ -13,3 +13,3 @@ "use strict"; | ||
*/ | ||
const deleteCookie = (name, attributes = {}) => setCookie_1.setCookie(name, "", Object.assign(Object.assign({}, attributes), { expires: -1 })); | ||
const deleteCookie = (name, attributes = {}) => (0, setCookie_1.setCookie)(name, "", Object.assign(Object.assign({}, attributes), { expires: -1 })); | ||
exports.deleteCookie = deleteCookie; |
@@ -35,4 +35,4 @@ "use strict"; | ||
try { | ||
const decodedName = decodeCookiePart_helper_1.decodeCookieParts(cookieName); | ||
cookieValue = decodeCookiePart_helper_1.decodeCookieParts(cookieValue); | ||
const decodedName = (0, decodeCookiePart_helper_1.decodeCookieParts)(cookieName); | ||
cookieValue = (0, decodeCookiePart_helper_1.decodeCookieParts)(cookieValue); | ||
if (!dontParseCookie) { | ||
@@ -39,0 +39,0 @@ // Try parsing cookie |
@@ -45,4 +45,4 @@ "use strict"; | ||
// Encode name and value | ||
cookieName = encodeCookieName_helper_1.encodeCookieName(cookieName); | ||
cookieValue = encodeCookieValue_helper_1.encodeCookieValue(cookieValue); | ||
cookieName = (0, encodeCookieName_helper_1.encodeCookieName)(cookieName); | ||
cookieValue = (0, encodeCookieValue_helper_1.encodeCookieValue)(cookieValue); | ||
// Convert attributes to a string | ||
@@ -49,0 +49,0 @@ let attributesString = ""; |
@@ -93,3 +93,3 @@ "use strict"; | ||
collection instanceof Document))) { | ||
exports.forEach(Object.keys(collection), (key) => { | ||
(0, exports.forEach)(Object.keys(collection), (key) => { | ||
// We only want to deal with properties that exist on the object itself, | ||
@@ -96,0 +96,0 @@ // not some prototyped stuff. |
@@ -8,3 +8,3 @@ "use strict"; | ||
let result = ""; | ||
forEach_1.forEach(data, (value, key) => { | ||
(0, forEach_1.forEach)(data, (value, key) => { | ||
result += Array.isArray(value) | ||
@@ -27,3 +27,3 @@ ? value[0] | ||
let result = ""; | ||
forEach_1.forEach(data, (value, key) => { | ||
(0, forEach_1.forEach)(data, (value, key) => { | ||
result += key + value; | ||
@@ -37,3 +37,3 @@ }); | ||
let result = ""; | ||
forEach_1.forEach(data, (value, key) => { | ||
(0, forEach_1.forEach)(data, (value, key) => { | ||
result += key + value.id; | ||
@@ -49,3 +49,3 @@ }); | ||
data.set(["g", "h"], ["h", "i"]); | ||
forEach_1.forEach(data, (value, key) => { | ||
(0, forEach_1.forEach)(data, (value, key) => { | ||
result += key[1] + value[0]; | ||
@@ -61,3 +61,3 @@ }); | ||
data.add(["g", "h"]); | ||
forEach_1.forEach(data, (value, key) => { | ||
(0, forEach_1.forEach)(data, (value, key) => { | ||
result += key + value[0]; | ||
@@ -74,3 +74,3 @@ }); | ||
data.add("c"); | ||
forEach_1.forEach(data, (value, key) => { | ||
(0, forEach_1.forEach)(data, (value, key) => { | ||
result += key + value; | ||
@@ -83,3 +83,3 @@ }); | ||
let result = ""; | ||
forEach_1.forEach(data, (value, key) => { | ||
(0, forEach_1.forEach)(data, (value, key) => { | ||
result += key + value; | ||
@@ -86,0 +86,0 @@ }); |
{ | ||
"name": "@baggie/functions", | ||
"version": "1.3.5", | ||
"version": "1.4.0", | ||
"description": "A library of tools for JavaScript and TypeScript. Handle cookies and timers that can be paused and resumed, etc.", | ||
@@ -27,3 +27,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@baggie/detection": "^1.3.5" | ||
"@baggie/detection": "^1.4.0" | ||
}, | ||
@@ -30,0 +30,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29857
Updated@baggie/detection@^1.4.0