Files
NapCatQQ/.pnpm-store/v3/files/bc/a6506c6f16d8be8754487ec56bf4c5d5623c0fd9ea6f31de4445542e047aa3bb8bb621605a9853f99bc0e26be1e07c6eb311f7730e771644e1fa64429ad1d8
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

21 lines
576 B
Plaintext

import toNumber from './toNumber.js';
/**
* Creates a function that performs a relational operation on two values.
*
* @private
* @param {Function} operator The function to perform the operation.
* @returns {Function} Returns the new relational operation function.
*/
function createRelationalOperation(operator) {
return function(value, other) {
if (!(typeof value == 'string' && typeof other == 'string')) {
value = toNumber(value);
other = toNumber(other);
}
return operator(value, other);
};
}
export default createRelationalOperation;