Comparing version 0.22.2-dev.0 to 0.22.2-dev.1
@@ -30,3 +30,3 @@ var t=require("./check") | ||
exports.doThrowAsync=async(e,r)=>await(0,t.isFunctionThrowAsync)(e)||o("DoThrowAsync",r) | ||
exports.doNotThrowAsync=async(e,r)=>await(0,t.isFunctionThrowAsync)(e)&&o("DoThrowAsync",r) | ||
exports.doNotThrowAsync=async(e,r)=>await(0,t.isFunctionThrowAsync)(e)&&o("DoNotThrowAsync",r) | ||
const x=(t,o)=>`\nactual: ${(0,e.describe)(t)}\nexpect: ${(0,e.describe)(o)}` | ||
@@ -33,0 +33,0 @@ exports.strictEqual=(e,r,i)=>(0,t.isStrictEqual)(e,r)||o("StrictEqual",i,x(e,r)) |
@@ -8,10 +8,10 @@ import { tryRequire } from "../../env/tryRequire"; | ||
const resultList = []; | ||
for (let i = 0, iMax = Math.min(count, to - from + 1); i < iMax; i++) { | ||
let next = RANDOM_INT(from, to - i); | ||
let j = 0; | ||
for (;j < resultList.length && !(resultList[j] > next); ) { | ||
for (let index = 0, indexMax = Math.min(count, to - from + 1); index < indexMax; index++) { | ||
let next = RANDOM_INT(from, to - index); | ||
let insertIndex = 0; | ||
for (;insertIndex < resultList.length && !(resultList[insertIndex] > next); ) { | ||
next++; | ||
j++; | ||
insertIndex++; | ||
} | ||
resultList.splice(j, 0, next); | ||
resultList.splice(insertIndex, 0, next); | ||
} | ||
@@ -18,0 +18,0 @@ return resultList; |
@@ -6,4 +6,4 @@ const getSample = (func, size) => { | ||
}; | ||
const getSampleRange = (from, to) => getSample(i => i + from, to - from + 1); | ||
const getSampleRate = divide => getSample(i => i / divide, 1 + divide); | ||
const getSampleRange = (from, to) => getSample(index => index + from, to - from + 1); | ||
const getSampleRate = divide => getSample(index => index / divide, 1 + divide); | ||
export { getSample, getSampleRange, getSampleRate }; |
@@ -23,3 +23,3 @@ import { isString, isBoolean, isNumber, isInteger, isObjectAlike, isBasicObject, isObjectKey, isObjectContain, isBasicArray, isArrayLength, isBasicFunction, isPromiseAlike, isOneOf, isFunctionThrow, isFunctionThrowAsync, isStrictEqual, isStringifyEqual } from "./check"; | ||
const doThrowAsync = async (func, message) => await isFunctionThrowAsync(func) || throwError("DoThrowAsync", message); | ||
const doNotThrowAsync = async (func, message) => await isFunctionThrowAsync(func) && throwError("DoThrowAsync", message); | ||
const doNotThrowAsync = async (func, message) => await isFunctionThrowAsync(func) && throwError("DoNotThrowAsync", message); | ||
const describeEqual = (actual, expect) => `\nactual: ${describe(actual)}\nexpect: ${describe(expect)}`; | ||
@@ -26,0 +26,0 @@ const strictEqual = (actual, expect, message) => isStrictEqual(actual, expect) || throwError("StrictEqual", message, describeEqual(actual, expect)); |
@@ -1,1 +0,1 @@ | ||
{"name":"dr-js","version":"0.22.2-dev.0","description":"A collection of strange functions","author":"dr-js","license":"MIT","repository":"github:dr-js/dr-js","bin":"bin/index.js","browser":"library/Dr.browser.js","engines":{"node":">=10.15","npm":">=6"},"sideEffects":false} | ||
{"name":"dr-js","version":"0.22.2-dev.1","description":"A collection of strange functions","author":"dr-js","license":"MIT","repository":"github:dr-js/dr-js","bin":"bin/index.js","browser":"library/Dr.browser.js","engines":{"node":">=10.15","npm":">=6"},"sideEffects":false} |
Sorry, the diff of this file is too big to display
430987