@corefunc/corefunc
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -6,3 +6,3 @@ import arrayClone from "./arrayClone"; | ||
const from = arrayClone(assignFrom); | ||
for (let index = 0; index < from.length; index += 1) { | ||
for (let index = 0; index < from.length; index++) { | ||
assignedArray[index] = from[index]; | ||
@@ -9,0 +9,0 @@ } |
@@ -26,3 +26,3 @@ /** | ||
const compacted = []; | ||
for (let index = 0; index < unique.length; index += 1) { | ||
for (let index = 0; index < unique.length; index++) { | ||
if (index in unique) { | ||
@@ -29,0 +29,0 @@ compacted.push(unique[index]); |
export default function arraySortBubble(array: number[]): number[] { | ||
const swap = (list, a, b) => ([list[a], list[b]] = [list[b], list[a]]); | ||
for (let i = array.length; i > 0; i -= 1) { | ||
for (let j = 0; j < i - 1; j += 1) { | ||
for (let j = 0; j < i - 1; j++) { | ||
if (array[j] > array[j + 1]) { | ||
@@ -6,0 +6,0 @@ swap(array, j, j + 1); |
@@ -5,3 +5,3 @@ export default function arraySortSelection(array: number[]): number[] { | ||
let min = index; | ||
for (let j = index + 1; j < array.length; j += 1) { | ||
for (let j = index + 1; j < array.length; j++) { | ||
if (array[j] < array[min]) { | ||
@@ -8,0 +8,0 @@ min = j; |
export default function generateToken(size: number = 16) { | ||
const random = new Array(size); | ||
for (let index = 0; index < size; index += 1) { | ||
for (let index = 0; index < size; index++) { | ||
random[index] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random() * 62)]; | ||
@@ -5,0 +5,0 @@ } |
@@ -17,3 +17,3 @@ export default function objectDeCycle(object: object, _path: string): object { | ||
) { | ||
for (index = 0; index < objects.length; index += 1) { | ||
for (index = 0; index < objects.length; index++) { | ||
if (objects[index] === value) { | ||
@@ -27,3 +27,3 @@ return { "&circularReference": paths[index] }; | ||
newIterable = []; | ||
for (index = 0; index < (value as any[]).length; index += 1) { | ||
for (index = 0; index < (value as any[]).length; index++) { | ||
newIterable[index] = objectDeCycle(value[index], `${path}[" + index + "]`); | ||
@@ -30,0 +30,0 @@ } |
@@ -23,3 +23,3 @@ import fnCloneDeep from "lodash-es/cloneDeep"; | ||
let haystack = fnCloneDeep(object); | ||
for (let index = 0, length = parts.length; index < length; index += 1) { | ||
for (let index = 0, length = parts.length; index < length; index++) { | ||
const part = parts[index]; | ||
@@ -26,0 +26,0 @@ if (!fnHasIn(haystack, part)) { |
@@ -24,3 +24,3 @@ import fnCloneDeep from "lodash-es/cloneDeep"; | ||
let haystack = fnCloneDeep(object); | ||
for (let index = 0, length = parts.length; index < length; index += 1) { | ||
for (let index = 0, length = parts.length; index < length; index++) { | ||
const part = parts[index]; | ||
@@ -27,0 +27,0 @@ if (!fnHasIn(haystack, part)) { |
@@ -40,3 +40,3 @@ { | ||
}, | ||
"version": "0.0.1" | ||
"version": "0.0.2" | ||
} |
@@ -10,3 +10,3 @@ /** | ||
let text = ""; | ||
for (index; index < size; index += 1) { | ||
for (index; index < size; index++) { | ||
text += possible.charAt(Math.floor(Math.random() * possible.length)); | ||
@@ -13,0 +13,0 @@ } |
@@ -9,3 +9,3 @@ import stringSimilarity from "./stringSimilarity"; | ||
let bestMatchIndex = 0; | ||
for (let i = 0; i < haystack.length; i += 1) { | ||
for (let i = 0; i < haystack.length; i++) { | ||
const currentTargetString = haystack[i]; | ||
@@ -12,0 +12,0 @@ const currentRating = stringSimilarity(needle, currentTargetString); |
@@ -20,3 +20,3 @@ export default function stringSimilarity(stringFirst: string, stringSecond: string): number { | ||
const firstBigRams = new Map(); | ||
for (let i = 0; i < stringFirst.length - 1; i += 1) { | ||
for (let i = 0; i < stringFirst.length - 1; i++) { | ||
const bigRam = stringFirst.substring(i, i + 2); | ||
@@ -27,3 +27,3 @@ const count = firstBigRams.has(bigRam) ? firstBigRams.get(bigRam) + 1 : 1; | ||
let intersectionSize = 0; | ||
for (let i = 0; i < stringSecond.length - 1; i += 1) { | ||
for (let i = 0; i < stringSecond.length - 1; i++) { | ||
const bigRam = stringSecond.substring(i, i + 2); | ||
@@ -33,3 +33,3 @@ const count = firstBigRams.has(bigRam) ? firstBigRams.get(bigRam) : 0; | ||
firstBigRams.set(bigRam, count - 1); | ||
intersectionSize += 1; | ||
intersectionSize++; | ||
} | ||
@@ -36,0 +36,0 @@ } |
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
68265
161
2302