Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- novas/novacore-zephyr/groq-code-cli/node_modules/es-set-tostringtag/test/index.js +85 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/.github/FUNDING.yml +12 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/helpers/isPrimitive.js +6 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/test/es2015.js +140 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/test/es5.js +98 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/test/es6.js +140 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/test/index.js +20 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/shuffle.d.mts +22 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/shuffle.d.ts +22 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/shuffle.js +28 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/shuffle.mjs +24 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/size.d.mts +39 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/size.d.ts +39 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/size.js +17 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/size.mjs +13 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/slice.d.mts +18 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/slice.d.ts +18 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/slice.js +43 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/slice.mjs +39 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/some.d.mts +31 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/some.d.ts +31 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/some.js +86 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/some.mjs +82 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortBy.d.mts +73 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortBy.d.ts +73 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortBy.js +20 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortBy.mjs +16 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndex.d.mts +30 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndex.d.ts +30 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndex.js +34 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndex.mjs +30 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.d.mts +25 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.d.ts +25 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.js +62 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.mjs +58 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexOf.d.mts +34 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexOf.d.ts +34 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexOf.js +19 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexOf.mjs +15 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndex.d.mts +16 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndex.d.ts +16 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndex.js +35 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndex.mjs +31 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexBy.d.mts +20 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexBy.d.ts +20 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexBy.js +11 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexBy.mjs +7 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexOf.d.mts +35 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexOf.d.ts +35 -0
- novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexOf.js +19 -0
novas/novacore-zephyr/groq-code-cli/node_modules/es-set-tostringtag/test/index.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var test = require('tape');
|
| 4 |
+
var hasToStringTag = require('has-tostringtag/shams')();
|
| 5 |
+
var hasOwn = require('hasown');
|
| 6 |
+
|
| 7 |
+
var setToStringTag = require('../');
|
| 8 |
+
|
| 9 |
+
test('setToStringTag', function (t) {
|
| 10 |
+
t.equal(typeof setToStringTag, 'function', 'is a function');
|
| 11 |
+
|
| 12 |
+
/** @type {{ [Symbol.toStringTag]?: typeof sentinel }} */
|
| 13 |
+
var obj = {};
|
| 14 |
+
var sentinel = {};
|
| 15 |
+
|
| 16 |
+
setToStringTag(obj, sentinel);
|
| 17 |
+
|
| 18 |
+
t['throws'](
|
| 19 |
+
// @ts-expect-error
|
| 20 |
+
function () { setToStringTag(obj, sentinel, { force: 'yes' }); },
|
| 21 |
+
TypeError,
|
| 22 |
+
'throws if options is not an object'
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
t.test('has Symbol.toStringTag', { skip: !hasToStringTag }, function (st) {
|
| 26 |
+
st.ok(hasOwn(obj, Symbol.toStringTag), 'has toStringTag property');
|
| 27 |
+
|
| 28 |
+
st.equal(obj[Symbol.toStringTag], sentinel, 'toStringTag property is as expected');
|
| 29 |
+
|
| 30 |
+
st.equal(String(obj), '[object Object]', 'toStringTag works');
|
| 31 |
+
|
| 32 |
+
/** @type {{ [Symbol.toStringTag]?: string }} */
|
| 33 |
+
var tagged = {};
|
| 34 |
+
tagged[Symbol.toStringTag] = 'already tagged';
|
| 35 |
+
st.equal(String(tagged), '[object already tagged]', 'toStringTag works');
|
| 36 |
+
|
| 37 |
+
setToStringTag(tagged, 'new tag');
|
| 38 |
+
st.equal(String(tagged), '[object already tagged]', 'toStringTag is unchanged');
|
| 39 |
+
|
| 40 |
+
setToStringTag(tagged, 'new tag', { force: true });
|
| 41 |
+
st.equal(String(tagged), '[object new tag]', 'toStringTag is changed with force: true');
|
| 42 |
+
|
| 43 |
+
st.deepEqual(
|
| 44 |
+
Object.getOwnPropertyDescriptor(tagged, Symbol.toStringTag),
|
| 45 |
+
{
|
| 46 |
+
configurable: true,
|
| 47 |
+
enumerable: false,
|
| 48 |
+
value: 'new tag',
|
| 49 |
+
writable: false
|
| 50 |
+
},
|
| 51 |
+
'has expected property descriptor'
|
| 52 |
+
);
|
| 53 |
+
|
| 54 |
+
setToStringTag(tagged, 'new tag', { force: true, nonConfigurable: true });
|
| 55 |
+
st.deepEqual(
|
| 56 |
+
Object.getOwnPropertyDescriptor(tagged, Symbol.toStringTag),
|
| 57 |
+
{
|
| 58 |
+
configurable: false,
|
| 59 |
+
enumerable: false,
|
| 60 |
+
value: 'new tag',
|
| 61 |
+
writable: false
|
| 62 |
+
},
|
| 63 |
+
'is nonconfigurable'
|
| 64 |
+
);
|
| 65 |
+
|
| 66 |
+
st.end();
|
| 67 |
+
});
|
| 68 |
+
|
| 69 |
+
t.test('does not have Symbol.toStringTag', { skip: hasToStringTag }, function (st) {
|
| 70 |
+
var passed = true;
|
| 71 |
+
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
| 72 |
+
if (hasOwn(obj, key)) {
|
| 73 |
+
st.fail('object has own key ' + key);
|
| 74 |
+
passed = false;
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
if (passed) {
|
| 78 |
+
st.ok(true, 'object has no enumerable own keys');
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
st.end();
|
| 82 |
+
});
|
| 83 |
+
|
| 84 |
+
t.end();
|
| 85 |
+
});
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/.github/FUNDING.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# These are supported funding model platforms
|
| 2 |
+
|
| 3 |
+
github: [ljharb]
|
| 4 |
+
patreon: # Replace with a single Patreon username
|
| 5 |
+
open_collective: # Replace with a single Open Collective username
|
| 6 |
+
ko_fi: # Replace with a single Ko-fi username
|
| 7 |
+
tidelift: npm/es-to-primitive
|
| 8 |
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
| 9 |
+
liberapay: # Replace with a single Liberapay username
|
| 10 |
+
issuehunt: # Replace with a single IssueHunt username
|
| 11 |
+
otechie: # Replace with a single Otechie username
|
| 12 |
+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/helpers/isPrimitive.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
/** @type {(value: unknown) => value is null | undefined | string | symbol | number | boolean | bigint} */
|
| 4 |
+
module.exports = function isPrimitive(value) {
|
| 5 |
+
return value === null || (typeof value !== 'function' && typeof value !== 'object');
|
| 6 |
+
};
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/test/es2015.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var test = require('tape');
|
| 4 |
+
var toPrimitive = require('../es2015');
|
| 5 |
+
var is = require('object-is');
|
| 6 |
+
var forEach = require('for-each');
|
| 7 |
+
var functionName = require('function.prototype.name');
|
| 8 |
+
var debug = require('object-inspect');
|
| 9 |
+
var v = require('es-value-fixtures');
|
| 10 |
+
|
| 11 |
+
/** @typedef {{ toString?: unknown, valueOf?: unknown, [Symbol.toPrimitive]?: unknown }} Coercible */
|
| 12 |
+
|
| 13 |
+
test('function properties', function (t) {
|
| 14 |
+
t.equal(toPrimitive.length, 1, 'length is 1');
|
| 15 |
+
t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive');
|
| 16 |
+
|
| 17 |
+
t.end();
|
| 18 |
+
});
|
| 19 |
+
|
| 20 |
+
test('primitives', function (t) {
|
| 21 |
+
forEach(v.primitives, function (i) {
|
| 22 |
+
t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value');
|
| 23 |
+
t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value');
|
| 24 |
+
t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value');
|
| 25 |
+
});
|
| 26 |
+
t.end();
|
| 27 |
+
});
|
| 28 |
+
|
| 29 |
+
test('Symbols', { skip: !v.hasSymbols }, function (t) {
|
| 30 |
+
forEach(v.symbols, function (sym) {
|
| 31 |
+
t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value');
|
| 32 |
+
t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same value');
|
| 33 |
+
t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same value');
|
| 34 |
+
});
|
| 35 |
+
|
| 36 |
+
var primitiveSym = Symbol('primitiveSym');
|
| 37 |
+
var objectSym = Object(primitiveSym);
|
| 38 |
+
t.equal(toPrimitive(objectSym), primitiveSym, 'toPrimitive(' + debug(objectSym) + ') returns ' + debug(primitiveSym));
|
| 39 |
+
t.equal(toPrimitive(objectSym, String), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', String) returns ' + debug(primitiveSym));
|
| 40 |
+
t.equal(toPrimitive(objectSym, Number), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', Number) returns ' + debug(primitiveSym));
|
| 41 |
+
t.end();
|
| 42 |
+
});
|
| 43 |
+
|
| 44 |
+
test('Arrays', function (t) {
|
| 45 |
+
var arrays = [[], ['a', 'b'], [1, 2]];
|
| 46 |
+
forEach(arrays, function (arr) {
|
| 47 |
+
t.equal(toPrimitive(arr), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
|
| 48 |
+
t.equal(toPrimitive(arr, String), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
|
| 49 |
+
t.equal(toPrimitive(arr, Number), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
|
| 50 |
+
});
|
| 51 |
+
t.end();
|
| 52 |
+
});
|
| 53 |
+
|
| 54 |
+
test('Dates', function (t) {
|
| 55 |
+
var dates = [new Date(), new Date(0), new Date(NaN)];
|
| 56 |
+
forEach(dates, function (date) {
|
| 57 |
+
t.equal(toPrimitive(date), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date');
|
| 58 |
+
t.equal(toPrimitive(date, String), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date');
|
| 59 |
+
t.ok(is(toPrimitive(date, Number), Number(date)), 'toPrimitive(' + debug(date) + ') returns the number version of the date');
|
| 60 |
+
});
|
| 61 |
+
t.end();
|
| 62 |
+
});
|
| 63 |
+
|
| 64 |
+
test('Objects', function (t) {
|
| 65 |
+
t.equal(toPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject with no hint coerces to valueOf');
|
| 66 |
+
t.equal(toPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf');
|
| 67 |
+
t.equal(toPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to non-stringified toString');
|
| 68 |
+
|
| 69 |
+
t.equal(toPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to non-stringified toString');
|
| 70 |
+
t.equal(toPrimitive(v.coercibleFnObject, Number), v.coercibleFnObject.toString(), 'coercibleFnObject with hint Number coerces to non-stringified toString');
|
| 71 |
+
t.equal(toPrimitive(v.coercibleFnObject, String), v.coercibleFnObject.toString(), 'coercibleFnObject with hint String coerces to non-stringified toString');
|
| 72 |
+
|
| 73 |
+
t.equal(toPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString');
|
| 74 |
+
t.equal(toPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString');
|
| 75 |
+
t.equal(toPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString');
|
| 76 |
+
|
| 77 |
+
t.equal(toPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns non-stringified toString');
|
| 78 |
+
t.equal(toPrimitive(v.toStringOnlyObject, Number), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint Number returns non-stringified toString');
|
| 79 |
+
t.equal(toPrimitive(v.toStringOnlyObject, String), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint String returns non-stringified toString');
|
| 80 |
+
|
| 81 |
+
t.equal(toPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf');
|
| 82 |
+
t.equal(toPrimitive(v.valueOfOnlyObject, Number), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint Number returns valueOf');
|
| 83 |
+
t.equal(toPrimitive(v.valueOfOnlyObject, String), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint String returns non-stringified valueOf');
|
| 84 |
+
|
| 85 |
+
t.test('Symbol.toPrimitive', { skip: !v.hasSymbols || !Symbol.toPrimitive }, function (st) {
|
| 86 |
+
/** @type {Coercible} */
|
| 87 |
+
var overriddenObject = { toString: st.fail, valueOf: st.fail };
|
| 88 |
+
overriddenObject[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
|
| 89 |
+
return String(hint);
|
| 90 |
+
};
|
| 91 |
+
|
| 92 |
+
st.equal(toPrimitive(overriddenObject), 'default', 'object with Symbol.toPrimitive + no hint invokes that');
|
| 93 |
+
st.equal(toPrimitive(overriddenObject, Number), 'number', 'object with Symbol.toPrimitive + hint Number invokes that');
|
| 94 |
+
st.equal(toPrimitive(overriddenObject, String), 'string', 'object with Symbol.toPrimitive + hint String invokes that');
|
| 95 |
+
|
| 96 |
+
/** @type {Coercible} */
|
| 97 |
+
var nullToPrimitive = { toString: v.coercibleObject.toString, valueOf: v.coercibleObject.valueOf };
|
| 98 |
+
nullToPrimitive[Symbol.toPrimitive] = null;
|
| 99 |
+
st.equal(toPrimitive(nullToPrimitive), toPrimitive(v.coercibleObject), 'object with no hint + null Symbol.toPrimitive ignores it');
|
| 100 |
+
st.equal(toPrimitive(nullToPrimitive, Number), toPrimitive(v.coercibleObject, Number), 'object with hint Number + null Symbol.toPrimitive ignores it');
|
| 101 |
+
st.equal(toPrimitive(nullToPrimitive, String), toPrimitive(v.coercibleObject, String), 'object with hint String + null Symbol.toPrimitive ignores it');
|
| 102 |
+
|
| 103 |
+
st.test('exceptions', function (sst) {
|
| 104 |
+
/** @type {Coercible} */
|
| 105 |
+
var nonFunctionToPrimitive = { toString: sst.fail, valueOf: sst.fail };
|
| 106 |
+
nonFunctionToPrimitive[Symbol.toPrimitive] = {};
|
| 107 |
+
sst['throws'](toPrimitive.bind(null, nonFunctionToPrimitive), TypeError, 'Symbol.toPrimitive returning a non-function throws');
|
| 108 |
+
|
| 109 |
+
/** @type {Coercible} */
|
| 110 |
+
var uncoercibleToPrimitive = { toString: sst.fail, valueOf: sst.fail };
|
| 111 |
+
uncoercibleToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
|
| 112 |
+
return { toString: function () { return hint; } };
|
| 113 |
+
};
|
| 114 |
+
sst['throws'](toPrimitive.bind(null, uncoercibleToPrimitive), TypeError, 'Symbol.toPrimitive returning an object throws');
|
| 115 |
+
|
| 116 |
+
/** @type {Coercible} */
|
| 117 |
+
var throwingToPrimitive = { toString: sst.fail, valueOf: sst.fail };
|
| 118 |
+
throwingToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
|
| 119 |
+
throw new RangeError(hint);
|
| 120 |
+
};
|
| 121 |
+
sst['throws'](toPrimitive.bind(null, throwingToPrimitive), RangeError, 'Symbol.toPrimitive throwing throws');
|
| 122 |
+
|
| 123 |
+
sst.end();
|
| 124 |
+
});
|
| 125 |
+
|
| 126 |
+
st.end();
|
| 127 |
+
});
|
| 128 |
+
|
| 129 |
+
t.test('exceptions', function (st) {
|
| 130 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleObject), TypeError, 'uncoercibleObject throws a TypeError');
|
| 131 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleObject, Number), TypeError, 'uncoercibleObject with hint Number throws a TypeError');
|
| 132 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleObject, String), TypeError, 'uncoercibleObject with hint String throws a TypeError');
|
| 133 |
+
|
| 134 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject), TypeError, 'uncoercibleFnObject throws a TypeError');
|
| 135 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, Number), TypeError, 'uncoercibleFnObject with hint Number throws a TypeError');
|
| 136 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, String), TypeError, 'uncoercibleFnObject with hint String throws a TypeError');
|
| 137 |
+
st.end();
|
| 138 |
+
});
|
| 139 |
+
t.end();
|
| 140 |
+
});
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/test/es5.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var test = require('tape');
|
| 4 |
+
var toPrimitive = require('../es5');
|
| 5 |
+
var is = require('object-is');
|
| 6 |
+
var forEach = require('for-each');
|
| 7 |
+
var functionName = require('function.prototype.name');
|
| 8 |
+
var debug = require('object-inspect');
|
| 9 |
+
var v = require('es-value-fixtures');
|
| 10 |
+
|
| 11 |
+
test('function properties', function (t) {
|
| 12 |
+
t.equal(toPrimitive.length, 1, 'length is 1');
|
| 13 |
+
t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive');
|
| 14 |
+
|
| 15 |
+
t.end();
|
| 16 |
+
});
|
| 17 |
+
|
| 18 |
+
test('primitives', function (t) {
|
| 19 |
+
forEach(v.primitives, function (i) {
|
| 20 |
+
t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value');
|
| 21 |
+
t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value');
|
| 22 |
+
t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value');
|
| 23 |
+
});
|
| 24 |
+
t.end();
|
| 25 |
+
});
|
| 26 |
+
|
| 27 |
+
test('Symbols', { skip: !v.hasSymbols }, function (t) {
|
| 28 |
+
forEach(v.symbols, function (sym) {
|
| 29 |
+
t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value');
|
| 30 |
+
t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same value');
|
| 31 |
+
t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same value');
|
| 32 |
+
});
|
| 33 |
+
|
| 34 |
+
var primitiveSym = Symbol('primitiveSym');
|
| 35 |
+
var stringSym = Symbol.prototype.toString.call(primitiveSym);
|
| 36 |
+
var objectSym = Object(primitiveSym);
|
| 37 |
+
t.equal(toPrimitive(objectSym), primitiveSym, 'toPrimitive(' + debug(objectSym) + ') returns ' + debug(primitiveSym));
|
| 38 |
+
|
| 39 |
+
// This is different from ES2015, as the ES5 algorithm doesn't account for the existence of Symbols:
|
| 40 |
+
t.equal(toPrimitive(objectSym, String), stringSym, 'toPrimitive(' + debug(objectSym) + ', String) returns ' + debug(stringSym));
|
| 41 |
+
t.equal(toPrimitive(objectSym, Number), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', Number) returns ' + debug(primitiveSym));
|
| 42 |
+
t.end();
|
| 43 |
+
});
|
| 44 |
+
|
| 45 |
+
test('Arrays', function (t) {
|
| 46 |
+
var arrays = [[], ['a', 'b'], [1, 2]];
|
| 47 |
+
forEach(arrays, function (arr) {
|
| 48 |
+
t.ok(is(toPrimitive(arr), arr.toString()), 'toPrimitive(' + debug(arr) + ') returns toString of the array');
|
| 49 |
+
t.equal(toPrimitive(arr, String), arr.toString(), 'toPrimitive(' + debug(arr) + ') returns toString of the array');
|
| 50 |
+
t.ok(is(toPrimitive(arr, Number), arr.toString()), 'toPrimitive(' + debug(arr) + ') returns toString of the array');
|
| 51 |
+
});
|
| 52 |
+
t.end();
|
| 53 |
+
});
|
| 54 |
+
|
| 55 |
+
test('Dates', function (t) {
|
| 56 |
+
var dates = [new Date(), new Date(0), new Date(NaN)];
|
| 57 |
+
forEach(dates, function (date) {
|
| 58 |
+
t.equal(toPrimitive(date), date.toString(), 'toPrimitive(' + debug(date) + ') returns toString of the date');
|
| 59 |
+
t.equal(toPrimitive(date, String), date.toString(), 'toPrimitive(' + debug(date) + ') returns toString of the date');
|
| 60 |
+
t.ok(is(toPrimitive(date, Number), date.valueOf()), 'toPrimitive(' + debug(date) + ') returns valueOf of the date');
|
| 61 |
+
});
|
| 62 |
+
t.end();
|
| 63 |
+
});
|
| 64 |
+
|
| 65 |
+
test('Objects', function (t) {
|
| 66 |
+
t.equal(toPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject with no hint coerces to valueOf');
|
| 67 |
+
t.equal(toPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to toString');
|
| 68 |
+
t.equal(toPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf');
|
| 69 |
+
|
| 70 |
+
t.equal(toPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to toString');
|
| 71 |
+
t.equal(toPrimitive(v.coercibleFnObject, String), v.coercibleFnObject.toString(), 'coercibleFnObject with hint String coerces to toString');
|
| 72 |
+
t.equal(toPrimitive(v.coercibleFnObject, Number), v.coercibleFnObject.toString(), 'coercibleFnObject with hint Number coerces to toString');
|
| 73 |
+
|
| 74 |
+
t.ok(is(toPrimitive({}), '[object Object]'), '{} with no hint coerces to Object#toString');
|
| 75 |
+
t.equal(toPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString');
|
| 76 |
+
t.ok(is(toPrimitive({}, Number), '[object Object]'), '{} with hint Number coerces to Object#toString');
|
| 77 |
+
|
| 78 |
+
t.equal(toPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns toString');
|
| 79 |
+
t.equal(toPrimitive(v.toStringOnlyObject, String), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint String returns toString');
|
| 80 |
+
t.equal(toPrimitive(v.toStringOnlyObject, Number), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint Number returns toString');
|
| 81 |
+
|
| 82 |
+
t.equal(toPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf');
|
| 83 |
+
t.equal(toPrimitive(v.valueOfOnlyObject, String), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint String returns valueOf');
|
| 84 |
+
t.equal(toPrimitive(v.valueOfOnlyObject, Number), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint Number returns valueOf');
|
| 85 |
+
|
| 86 |
+
t.test('exceptions', function (st) {
|
| 87 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleObject), TypeError, 'uncoercibleObject throws a TypeError');
|
| 88 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleObject, String), TypeError, 'uncoercibleObject with hint String throws a TypeError');
|
| 89 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleObject, Number), TypeError, 'uncoercibleObject with hint Number throws a TypeError');
|
| 90 |
+
|
| 91 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject), TypeError, 'uncoercibleFnObject throws a TypeError');
|
| 92 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, String), TypeError, 'uncoercibleFnObject with hint String throws a TypeError');
|
| 93 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, Number), TypeError, 'uncoercibleFnObject with hint Number throws a TypeError');
|
| 94 |
+
st.end();
|
| 95 |
+
});
|
| 96 |
+
|
| 97 |
+
t.end();
|
| 98 |
+
});
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/test/es6.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var test = require('tape');
|
| 4 |
+
var toPrimitive = require('../es6');
|
| 5 |
+
var is = require('object-is');
|
| 6 |
+
var forEach = require('for-each');
|
| 7 |
+
var functionName = require('function.prototype.name');
|
| 8 |
+
var debug = require('object-inspect');
|
| 9 |
+
var v = require('es-value-fixtures');
|
| 10 |
+
|
| 11 |
+
/** @typedef {{ toString?: unknown, valueOf?: unknown, [Symbol.toPrimitive]?: unknown }} Coercible */
|
| 12 |
+
|
| 13 |
+
test('function properties', function (t) {
|
| 14 |
+
t.equal(toPrimitive.length, 1, 'length is 1');
|
| 15 |
+
t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive');
|
| 16 |
+
|
| 17 |
+
t.end();
|
| 18 |
+
});
|
| 19 |
+
|
| 20 |
+
test('primitives', function (t) {
|
| 21 |
+
forEach(v.primitives, function (i) {
|
| 22 |
+
t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value');
|
| 23 |
+
t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value');
|
| 24 |
+
t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value');
|
| 25 |
+
});
|
| 26 |
+
t.end();
|
| 27 |
+
});
|
| 28 |
+
|
| 29 |
+
test('Symbols', { skip: !v.hasSymbols }, function (t) {
|
| 30 |
+
forEach(v.symbols, function (sym) {
|
| 31 |
+
t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value');
|
| 32 |
+
t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same value');
|
| 33 |
+
t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same value');
|
| 34 |
+
});
|
| 35 |
+
|
| 36 |
+
var primitiveSym = Symbol('primitiveSym');
|
| 37 |
+
var objectSym = Object(primitiveSym);
|
| 38 |
+
t.equal(toPrimitive(objectSym), primitiveSym, 'toPrimitive(' + debug(objectSym) + ') returns ' + debug(primitiveSym));
|
| 39 |
+
t.equal(toPrimitive(objectSym, String), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', String) returns ' + debug(primitiveSym));
|
| 40 |
+
t.equal(toPrimitive(objectSym, Number), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', Number) returns ' + debug(primitiveSym));
|
| 41 |
+
t.end();
|
| 42 |
+
});
|
| 43 |
+
|
| 44 |
+
test('Arrays', function (t) {
|
| 45 |
+
var arrays = [[], ['a', 'b'], [1, 2]];
|
| 46 |
+
forEach(arrays, function (arr) {
|
| 47 |
+
t.equal(toPrimitive(arr), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
|
| 48 |
+
t.equal(toPrimitive(arr, String), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
|
| 49 |
+
t.equal(toPrimitive(arr, Number), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
|
| 50 |
+
});
|
| 51 |
+
t.end();
|
| 52 |
+
});
|
| 53 |
+
|
| 54 |
+
test('Dates', function (t) {
|
| 55 |
+
var dates = [new Date(), new Date(0), new Date(NaN)];
|
| 56 |
+
forEach(dates, function (date) {
|
| 57 |
+
t.equal(toPrimitive(date), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date');
|
| 58 |
+
t.equal(toPrimitive(date, String), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date');
|
| 59 |
+
t.ok(is(toPrimitive(date, Number), Number(date)), 'toPrimitive(' + debug(date) + ') returns the number version of the date');
|
| 60 |
+
});
|
| 61 |
+
t.end();
|
| 62 |
+
});
|
| 63 |
+
|
| 64 |
+
test('Objects', function (t) {
|
| 65 |
+
t.equal(toPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject with no hint coerces to valueOf');
|
| 66 |
+
t.equal(toPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf');
|
| 67 |
+
t.equal(toPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to non-stringified toString');
|
| 68 |
+
|
| 69 |
+
t.equal(toPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to non-stringified toString');
|
| 70 |
+
t.equal(toPrimitive(v.coercibleFnObject, Number), v.coercibleFnObject.toString(), 'coercibleFnObject with hint Number coerces to non-stringified toString');
|
| 71 |
+
t.equal(toPrimitive(v.coercibleFnObject, String), v.coercibleFnObject.toString(), 'coercibleFnObject with hint String coerces to non-stringified toString');
|
| 72 |
+
|
| 73 |
+
t.equal(toPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString');
|
| 74 |
+
t.equal(toPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString');
|
| 75 |
+
t.equal(toPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString');
|
| 76 |
+
|
| 77 |
+
t.equal(toPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns non-stringified toString');
|
| 78 |
+
t.equal(toPrimitive(v.toStringOnlyObject, Number), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint Number returns non-stringified toString');
|
| 79 |
+
t.equal(toPrimitive(v.toStringOnlyObject, String), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint String returns non-stringified toString');
|
| 80 |
+
|
| 81 |
+
t.equal(toPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf');
|
| 82 |
+
t.equal(toPrimitive(v.valueOfOnlyObject, Number), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint Number returns valueOf');
|
| 83 |
+
t.equal(toPrimitive(v.valueOfOnlyObject, String), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint String returns non-stringified valueOf');
|
| 84 |
+
|
| 85 |
+
t.test('Symbol.toPrimitive', { skip: !v.hasSymbols || !Symbol.toPrimitive }, function (st) {
|
| 86 |
+
/** @type {Coercible} */
|
| 87 |
+
var overriddenObject = { toString: st.fail, valueOf: st.fail };
|
| 88 |
+
overriddenObject[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
|
| 89 |
+
return String(hint);
|
| 90 |
+
};
|
| 91 |
+
|
| 92 |
+
st.equal(toPrimitive(overriddenObject), 'default', 'object with Symbol.toPrimitive + no hint invokes that');
|
| 93 |
+
st.equal(toPrimitive(overriddenObject, Number), 'number', 'object with Symbol.toPrimitive + hint Number invokes that');
|
| 94 |
+
st.equal(toPrimitive(overriddenObject, String), 'string', 'object with Symbol.toPrimitive + hint String invokes that');
|
| 95 |
+
|
| 96 |
+
/** @type {Coercible} */
|
| 97 |
+
var nullToPrimitive = { toString: v.coercibleObject.toString, valueOf: v.coercibleObject.valueOf };
|
| 98 |
+
nullToPrimitive[Symbol.toPrimitive] = null;
|
| 99 |
+
st.equal(toPrimitive(nullToPrimitive), toPrimitive(v.coercibleObject), 'object with no hint + null Symbol.toPrimitive ignores it');
|
| 100 |
+
st.equal(toPrimitive(nullToPrimitive, Number), toPrimitive(v.coercibleObject, Number), 'object with hint Number + null Symbol.toPrimitive ignores it');
|
| 101 |
+
st.equal(toPrimitive(nullToPrimitive, String), toPrimitive(v.coercibleObject, String), 'object with hint String + null Symbol.toPrimitive ignores it');
|
| 102 |
+
|
| 103 |
+
st.test('exceptions', function (sst) {
|
| 104 |
+
/** @type {Coercible} */
|
| 105 |
+
var nonFunctionToPrimitive = { toString: sst.fail, valueOf: sst.fail };
|
| 106 |
+
nonFunctionToPrimitive[Symbol.toPrimitive] = {};
|
| 107 |
+
sst['throws'](toPrimitive.bind(null, nonFunctionToPrimitive), TypeError, 'Symbol.toPrimitive returning a non-function throws');
|
| 108 |
+
|
| 109 |
+
/** @type {Coercible} */
|
| 110 |
+
var uncoercibleToPrimitive = { toString: sst.fail, valueOf: sst.fail };
|
| 111 |
+
uncoercibleToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
|
| 112 |
+
return { toString: function () { return hint; } };
|
| 113 |
+
};
|
| 114 |
+
sst['throws'](toPrimitive.bind(null, uncoercibleToPrimitive), TypeError, 'Symbol.toPrimitive returning an object throws');
|
| 115 |
+
|
| 116 |
+
/** @type {Coercible} */
|
| 117 |
+
var throwingToPrimitive = { toString: sst.fail, valueOf: sst.fail };
|
| 118 |
+
throwingToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
|
| 119 |
+
throw new RangeError(hint);
|
| 120 |
+
};
|
| 121 |
+
sst['throws'](toPrimitive.bind(null, throwingToPrimitive), RangeError, 'Symbol.toPrimitive throwing throws');
|
| 122 |
+
|
| 123 |
+
sst.end();
|
| 124 |
+
});
|
| 125 |
+
|
| 126 |
+
st.end();
|
| 127 |
+
});
|
| 128 |
+
|
| 129 |
+
t.test('exceptions', function (st) {
|
| 130 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleObject), TypeError, 'uncoercibleObject throws a TypeError');
|
| 131 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleObject, Number), TypeError, 'uncoercibleObject with hint Number throws a TypeError');
|
| 132 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleObject, String), TypeError, 'uncoercibleObject with hint String throws a TypeError');
|
| 133 |
+
|
| 134 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject), TypeError, 'uncoercibleFnObject throws a TypeError');
|
| 135 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, Number), TypeError, 'uncoercibleFnObject with hint Number throws a TypeError');
|
| 136 |
+
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, String), TypeError, 'uncoercibleFnObject with hint String throws a TypeError');
|
| 137 |
+
st.end();
|
| 138 |
+
});
|
| 139 |
+
t.end();
|
| 140 |
+
});
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-to-primitive/test/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var toPrimitive = require('../');
|
| 4 |
+
var ES5 = require('../es5');
|
| 5 |
+
var ES6 = require('../es6');
|
| 6 |
+
var ES2015 = require('../es2015');
|
| 7 |
+
|
| 8 |
+
var test = require('tape');
|
| 9 |
+
|
| 10 |
+
test('default export', function (t) {
|
| 11 |
+
t.equal(toPrimitive, ES2015, 'default export is ES2015');
|
| 12 |
+
t.equal(toPrimitive.ES5, ES5, 'ES5 property has ES5 method');
|
| 13 |
+
t.equal(toPrimitive.ES6, ES6, 'ES6 property has ES6 method');
|
| 14 |
+
t.equal(toPrimitive.ES2015, ES2015, 'ES2015 property has ES2015 method');
|
| 15 |
+
t.end();
|
| 16 |
+
});
|
| 17 |
+
|
| 18 |
+
require('./es5');
|
| 19 |
+
require('./es6');
|
| 20 |
+
require('./es2015');
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/shuffle.d.mts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Randomizes the order of elements in an `array` using the Fisher-Yates algorithm.
|
| 3 |
+
*
|
| 4 |
+
* This function takes an `array` and returns a new `array` with its elements shuffled in a random order.
|
| 5 |
+
*
|
| 6 |
+
* @template T - The type of elements in the `array`.
|
| 7 |
+
* @param {T[]} array - The `array` to shuffle.
|
| 8 |
+
* @returns {T[]} A new `array` with its elements shuffled in random order.
|
| 9 |
+
*/
|
| 10 |
+
declare function shuffle<T>(array: ArrayLike<T> | null | undefined): T[];
|
| 11 |
+
/**
|
| 12 |
+
* Randomizes the order of elements in an `object` using the Fisher-Yates algorithm.
|
| 13 |
+
*
|
| 14 |
+
* This function takes an `object` and returns a new `object` with its values shuffled in a random order.
|
| 15 |
+
*
|
| 16 |
+
* @template T - The type of elements in the `object`.
|
| 17 |
+
* @param {T} object - The `object` to shuffle.
|
| 18 |
+
* @returns {T[]} A new `Array` with the values of the `object` shuffled in a random order.
|
| 19 |
+
*/
|
| 20 |
+
declare function shuffle<T extends object>(object: T | null | undefined): Array<T[keyof T]>;
|
| 21 |
+
|
| 22 |
+
export { shuffle };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/shuffle.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Randomizes the order of elements in an `array` using the Fisher-Yates algorithm.
|
| 3 |
+
*
|
| 4 |
+
* This function takes an `array` and returns a new `array` with its elements shuffled in a random order.
|
| 5 |
+
*
|
| 6 |
+
* @template T - The type of elements in the `array`.
|
| 7 |
+
* @param {T[]} array - The `array` to shuffle.
|
| 8 |
+
* @returns {T[]} A new `array` with its elements shuffled in random order.
|
| 9 |
+
*/
|
| 10 |
+
declare function shuffle<T>(array: ArrayLike<T> | null | undefined): T[];
|
| 11 |
+
/**
|
| 12 |
+
* Randomizes the order of elements in an `object` using the Fisher-Yates algorithm.
|
| 13 |
+
*
|
| 14 |
+
* This function takes an `object` and returns a new `object` with its values shuffled in a random order.
|
| 15 |
+
*
|
| 16 |
+
* @template T - The type of elements in the `object`.
|
| 17 |
+
* @param {T} object - The `object` to shuffle.
|
| 18 |
+
* @returns {T[]} A new `Array` with the values of the `object` shuffled in a random order.
|
| 19 |
+
*/
|
| 20 |
+
declare function shuffle<T extends object>(object: T | null | undefined): Array<T[keyof T]>;
|
| 21 |
+
|
| 22 |
+
export { shuffle };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/shuffle.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 4 |
+
|
| 5 |
+
const shuffle$1 = require('../../array/shuffle.js');
|
| 6 |
+
const values = require('../object/values.js');
|
| 7 |
+
const isArray = require('../predicate/isArray.js');
|
| 8 |
+
const isArrayLike = require('../predicate/isArrayLike.js');
|
| 9 |
+
const isNil = require('../predicate/isNil.js');
|
| 10 |
+
const isObjectLike = require('../predicate/isObjectLike.js');
|
| 11 |
+
|
| 12 |
+
function shuffle(collection) {
|
| 13 |
+
if (isNil.isNil(collection)) {
|
| 14 |
+
return [];
|
| 15 |
+
}
|
| 16 |
+
if (isArray.isArray(collection)) {
|
| 17 |
+
return shuffle$1.shuffle(collection);
|
| 18 |
+
}
|
| 19 |
+
if (isArrayLike.isArrayLike(collection)) {
|
| 20 |
+
return shuffle$1.shuffle(Array.from(collection));
|
| 21 |
+
}
|
| 22 |
+
if (isObjectLike.isObjectLike(collection)) {
|
| 23 |
+
return shuffle$1.shuffle(values.values(collection));
|
| 24 |
+
}
|
| 25 |
+
return [];
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
exports.shuffle = shuffle;
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/shuffle.mjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { shuffle as shuffle$1 } from '../../array/shuffle.mjs';
|
| 2 |
+
import { values } from '../object/values.mjs';
|
| 3 |
+
import { isArray } from '../predicate/isArray.mjs';
|
| 4 |
+
import { isArrayLike } from '../predicate/isArrayLike.mjs';
|
| 5 |
+
import { isNil } from '../predicate/isNil.mjs';
|
| 6 |
+
import { isObjectLike } from '../predicate/isObjectLike.mjs';
|
| 7 |
+
|
| 8 |
+
function shuffle(collection) {
|
| 9 |
+
if (isNil(collection)) {
|
| 10 |
+
return [];
|
| 11 |
+
}
|
| 12 |
+
if (isArray(collection)) {
|
| 13 |
+
return shuffle$1(collection);
|
| 14 |
+
}
|
| 15 |
+
if (isArrayLike(collection)) {
|
| 16 |
+
return shuffle$1(Array.from(collection));
|
| 17 |
+
}
|
| 18 |
+
if (isObjectLike(collection)) {
|
| 19 |
+
return shuffle$1(values(collection));
|
| 20 |
+
}
|
| 21 |
+
return [];
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
export { shuffle };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/size.d.mts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Returns the length of an array, string, or object.
|
| 3 |
+
*
|
| 4 |
+
* This function takes an array, string, or object and returns its length.
|
| 5 |
+
* For arrays and strings, it returns the number of elements or characters, respectively.
|
| 6 |
+
* For objects, it returns the number of enumerable properties.
|
| 7 |
+
*
|
| 8 |
+
* @template T - The type of the input value.
|
| 9 |
+
* @param {T[] | object | string | Map<unknown, T> | Set<T> | null | undefined } target - The value whose size is to be determined. It can be an array, string, or object.
|
| 10 |
+
* @returns {number} The size of the input value.
|
| 11 |
+
*
|
| 12 |
+
* @example
|
| 13 |
+
* const arr = [1, 2, 3];
|
| 14 |
+
* const arrSize = size(arr);
|
| 15 |
+
* // arrSize will be 3
|
| 16 |
+
*
|
| 17 |
+
* const str = 'hello';
|
| 18 |
+
* const strSize = size(str);
|
| 19 |
+
* // strSize will be 5
|
| 20 |
+
*
|
| 21 |
+
* const obj = { a: 1, b: 2, c: 3 };
|
| 22 |
+
* const objSize = size(obj);
|
| 23 |
+
* // objSize will be 3
|
| 24 |
+
*
|
| 25 |
+
* const emptyArr = [];
|
| 26 |
+
* const emptyArrSize = size(emptyArr);
|
| 27 |
+
* // emptyArrSize will be 0
|
| 28 |
+
*
|
| 29 |
+
* const emptyStr = '';
|
| 30 |
+
* const emptyStrSize = size(emptyStr);
|
| 31 |
+
* // emptyStrSize will be 0
|
| 32 |
+
*
|
| 33 |
+
* const emptyObj = {};
|
| 34 |
+
* const emptyObjSize = size(emptyObj);
|
| 35 |
+
* // emptyObjSize will be 0
|
| 36 |
+
*/
|
| 37 |
+
declare function size(collection: object | string | null | undefined): number;
|
| 38 |
+
|
| 39 |
+
export { size };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/size.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Returns the length of an array, string, or object.
|
| 3 |
+
*
|
| 4 |
+
* This function takes an array, string, or object and returns its length.
|
| 5 |
+
* For arrays and strings, it returns the number of elements or characters, respectively.
|
| 6 |
+
* For objects, it returns the number of enumerable properties.
|
| 7 |
+
*
|
| 8 |
+
* @template T - The type of the input value.
|
| 9 |
+
* @param {T[] | object | string | Map<unknown, T> | Set<T> | null | undefined } target - The value whose size is to be determined. It can be an array, string, or object.
|
| 10 |
+
* @returns {number} The size of the input value.
|
| 11 |
+
*
|
| 12 |
+
* @example
|
| 13 |
+
* const arr = [1, 2, 3];
|
| 14 |
+
* const arrSize = size(arr);
|
| 15 |
+
* // arrSize will be 3
|
| 16 |
+
*
|
| 17 |
+
* const str = 'hello';
|
| 18 |
+
* const strSize = size(str);
|
| 19 |
+
* // strSize will be 5
|
| 20 |
+
*
|
| 21 |
+
* const obj = { a: 1, b: 2, c: 3 };
|
| 22 |
+
* const objSize = size(obj);
|
| 23 |
+
* // objSize will be 3
|
| 24 |
+
*
|
| 25 |
+
* const emptyArr = [];
|
| 26 |
+
* const emptyArrSize = size(emptyArr);
|
| 27 |
+
* // emptyArrSize will be 0
|
| 28 |
+
*
|
| 29 |
+
* const emptyStr = '';
|
| 30 |
+
* const emptyStrSize = size(emptyStr);
|
| 31 |
+
* // emptyStrSize will be 0
|
| 32 |
+
*
|
| 33 |
+
* const emptyObj = {};
|
| 34 |
+
* const emptyObjSize = size(emptyObj);
|
| 35 |
+
* // emptyObjSize will be 0
|
| 36 |
+
*/
|
| 37 |
+
declare function size(collection: object | string | null | undefined): number;
|
| 38 |
+
|
| 39 |
+
export { size };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/size.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 4 |
+
|
| 5 |
+
const isNil = require('../../predicate/isNil.js');
|
| 6 |
+
|
| 7 |
+
function size(target) {
|
| 8 |
+
if (isNil.isNil(target)) {
|
| 9 |
+
return 0;
|
| 10 |
+
}
|
| 11 |
+
if (target instanceof Map || target instanceof Set) {
|
| 12 |
+
return target.size;
|
| 13 |
+
}
|
| 14 |
+
return Object.keys(target).length;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
exports.size = size;
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/size.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { isNil } from '../../predicate/isNil.mjs';
|
| 2 |
+
|
| 3 |
+
function size(target) {
|
| 4 |
+
if (isNil(target)) {
|
| 5 |
+
return 0;
|
| 6 |
+
}
|
| 7 |
+
if (target instanceof Map || target instanceof Set) {
|
| 8 |
+
return target.size;
|
| 9 |
+
}
|
| 10 |
+
return Object.keys(target).length;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
export { size };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/slice.d.mts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Create a slice of `array` from `start` up to, but not including, `end`.
|
| 3 |
+
*
|
| 4 |
+
* It does not return a dense array for sparse arrays unlike the native `Array.prototype.slice`.
|
| 5 |
+
*
|
| 6 |
+
* @template T - The type of the array elements.
|
| 7 |
+
* @param {ArrayLike<T> | null | undefined} array - The array to slice.
|
| 8 |
+
* @param {number} [start=0] - The start position.
|
| 9 |
+
* @param {number} [end=array.length] - The end position.
|
| 10 |
+
* @returns {T[]} - Returns the slice of `array`.
|
| 11 |
+
*
|
| 12 |
+
* @example
|
| 13 |
+
* slice([1, 2, 3], 1, 2); // => [2]
|
| 14 |
+
* slice(new Array(3)); // => [undefined, undefined, undefined]
|
| 15 |
+
*/
|
| 16 |
+
declare function slice<T>(array: ArrayLike<T> | null | undefined, start?: number, end?: number): T[];
|
| 17 |
+
|
| 18 |
+
export { slice };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/slice.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Create a slice of `array` from `start` up to, but not including, `end`.
|
| 3 |
+
*
|
| 4 |
+
* It does not return a dense array for sparse arrays unlike the native `Array.prototype.slice`.
|
| 5 |
+
*
|
| 6 |
+
* @template T - The type of the array elements.
|
| 7 |
+
* @param {ArrayLike<T> | null | undefined} array - The array to slice.
|
| 8 |
+
* @param {number} [start=0] - The start position.
|
| 9 |
+
* @param {number} [end=array.length] - The end position.
|
| 10 |
+
* @returns {T[]} - Returns the slice of `array`.
|
| 11 |
+
*
|
| 12 |
+
* @example
|
| 13 |
+
* slice([1, 2, 3], 1, 2); // => [2]
|
| 14 |
+
* slice(new Array(3)); // => [undefined, undefined, undefined]
|
| 15 |
+
*/
|
| 16 |
+
declare function slice<T>(array: ArrayLike<T> | null | undefined, start?: number, end?: number): T[];
|
| 17 |
+
|
| 18 |
+
export { slice };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/slice.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 4 |
+
|
| 5 |
+
const isIterateeCall = require('../_internal/isIterateeCall.js');
|
| 6 |
+
const isArrayLike = require('../predicate/isArrayLike.js');
|
| 7 |
+
const toInteger = require('../util/toInteger.js');
|
| 8 |
+
|
| 9 |
+
function slice(array, start, end) {
|
| 10 |
+
if (!isArrayLike.isArrayLike(array)) {
|
| 11 |
+
return [];
|
| 12 |
+
}
|
| 13 |
+
const length = array.length;
|
| 14 |
+
if (end === undefined) {
|
| 15 |
+
end = length;
|
| 16 |
+
}
|
| 17 |
+
else if (typeof end !== 'number' && isIterateeCall.isIterateeCall(array, start, end)) {
|
| 18 |
+
start = 0;
|
| 19 |
+
end = length;
|
| 20 |
+
}
|
| 21 |
+
start = toInteger.toInteger(start);
|
| 22 |
+
end = toInteger.toInteger(end);
|
| 23 |
+
if (start < 0) {
|
| 24 |
+
start = Math.max(length + start, 0);
|
| 25 |
+
}
|
| 26 |
+
else {
|
| 27 |
+
start = Math.min(start, length);
|
| 28 |
+
}
|
| 29 |
+
if (end < 0) {
|
| 30 |
+
end = Math.max(length + end, 0);
|
| 31 |
+
}
|
| 32 |
+
else {
|
| 33 |
+
end = Math.min(end, length);
|
| 34 |
+
}
|
| 35 |
+
const resultLength = Math.max(end - start, 0);
|
| 36 |
+
const result = new Array(resultLength);
|
| 37 |
+
for (let i = 0; i < resultLength; ++i) {
|
| 38 |
+
result[i] = array[start + i];
|
| 39 |
+
}
|
| 40 |
+
return result;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
exports.slice = slice;
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/slice.mjs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { isIterateeCall } from '../_internal/isIterateeCall.mjs';
|
| 2 |
+
import { isArrayLike } from '../predicate/isArrayLike.mjs';
|
| 3 |
+
import { toInteger } from '../util/toInteger.mjs';
|
| 4 |
+
|
| 5 |
+
function slice(array, start, end) {
|
| 6 |
+
if (!isArrayLike(array)) {
|
| 7 |
+
return [];
|
| 8 |
+
}
|
| 9 |
+
const length = array.length;
|
| 10 |
+
if (end === undefined) {
|
| 11 |
+
end = length;
|
| 12 |
+
}
|
| 13 |
+
else if (typeof end !== 'number' && isIterateeCall(array, start, end)) {
|
| 14 |
+
start = 0;
|
| 15 |
+
end = length;
|
| 16 |
+
}
|
| 17 |
+
start = toInteger(start);
|
| 18 |
+
end = toInteger(end);
|
| 19 |
+
if (start < 0) {
|
| 20 |
+
start = Math.max(length + start, 0);
|
| 21 |
+
}
|
| 22 |
+
else {
|
| 23 |
+
start = Math.min(start, length);
|
| 24 |
+
}
|
| 25 |
+
if (end < 0) {
|
| 26 |
+
end = Math.max(length + end, 0);
|
| 27 |
+
}
|
| 28 |
+
else {
|
| 29 |
+
end = Math.min(end, length);
|
| 30 |
+
}
|
| 31 |
+
const resultLength = Math.max(end - start, 0);
|
| 32 |
+
const result = new Array(resultLength);
|
| 33 |
+
for (let i = 0; i < resultLength; ++i) {
|
| 34 |
+
result[i] = array[start + i];
|
| 35 |
+
}
|
| 36 |
+
return result;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
export { slice };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/some.d.mts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { ListIterateeCustom } from '../_internal/ListIterateeCustom.mjs';
|
| 2 |
+
import { ObjectIterateeCustom } from '../_internal/ObjectIteratee.mjs';
|
| 3 |
+
|
| 4 |
+
/**
|
| 5 |
+
* Checks if predicate returns truthy for any element of collection.
|
| 6 |
+
*
|
| 7 |
+
* @template T
|
| 8 |
+
* @param {ArrayLike<T> | null | undefined} collection - The collection to iterate over.
|
| 9 |
+
* @param {ListIterateeCustom<T, boolean>} [predicate] - The function invoked per iteration.
|
| 10 |
+
* @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.
|
| 11 |
+
*
|
| 12 |
+
* @example
|
| 13 |
+
* some([null, 0, 'yes', false], Boolean);
|
| 14 |
+
* // => true
|
| 15 |
+
*/
|
| 16 |
+
declare function some<T>(collection: ArrayLike<T> | null | undefined, predicate?: ListIterateeCustom<T, boolean>): boolean;
|
| 17 |
+
/**
|
| 18 |
+
* Checks if predicate returns truthy for any element of collection.
|
| 19 |
+
*
|
| 20 |
+
* @template T
|
| 21 |
+
* @param {T | null | undefined} collection - The object to iterate over.
|
| 22 |
+
* @param {ObjectIterateeCustom<T, boolean>} [predicate] - The function invoked per iteration.
|
| 23 |
+
* @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.
|
| 24 |
+
*
|
| 25 |
+
* @example
|
| 26 |
+
* some({ 'a': 0, 'b': 1, 'c': 0 }, function(n) { return n > 0; });
|
| 27 |
+
* // => true
|
| 28 |
+
*/
|
| 29 |
+
declare function some<T extends object>(collection: T | null | undefined, predicate?: ObjectIterateeCustom<T, boolean>): boolean;
|
| 30 |
+
|
| 31 |
+
export { some };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/some.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { ListIterateeCustom } from '../_internal/ListIterateeCustom.js';
|
| 2 |
+
import { ObjectIterateeCustom } from '../_internal/ObjectIteratee.js';
|
| 3 |
+
|
| 4 |
+
/**
|
| 5 |
+
* Checks if predicate returns truthy for any element of collection.
|
| 6 |
+
*
|
| 7 |
+
* @template T
|
| 8 |
+
* @param {ArrayLike<T> | null | undefined} collection - The collection to iterate over.
|
| 9 |
+
* @param {ListIterateeCustom<T, boolean>} [predicate] - The function invoked per iteration.
|
| 10 |
+
* @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.
|
| 11 |
+
*
|
| 12 |
+
* @example
|
| 13 |
+
* some([null, 0, 'yes', false], Boolean);
|
| 14 |
+
* // => true
|
| 15 |
+
*/
|
| 16 |
+
declare function some<T>(collection: ArrayLike<T> | null | undefined, predicate?: ListIterateeCustom<T, boolean>): boolean;
|
| 17 |
+
/**
|
| 18 |
+
* Checks if predicate returns truthy for any element of collection.
|
| 19 |
+
*
|
| 20 |
+
* @template T
|
| 21 |
+
* @param {T | null | undefined} collection - The object to iterate over.
|
| 22 |
+
* @param {ObjectIterateeCustom<T, boolean>} [predicate] - The function invoked per iteration.
|
| 23 |
+
* @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.
|
| 24 |
+
*
|
| 25 |
+
* @example
|
| 26 |
+
* some({ 'a': 0, 'b': 1, 'c': 0 }, function(n) { return n > 0; });
|
| 27 |
+
* // => true
|
| 28 |
+
*/
|
| 29 |
+
declare function some<T extends object>(collection: T | null | undefined, predicate?: ObjectIterateeCustom<T, boolean>): boolean;
|
| 30 |
+
|
| 31 |
+
export { some };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/some.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 4 |
+
|
| 5 |
+
const identity = require('../../function/identity.js');
|
| 6 |
+
const property = require('../object/property.js');
|
| 7 |
+
const matches = require('../predicate/matches.js');
|
| 8 |
+
const matchesProperty = require('../predicate/matchesProperty.js');
|
| 9 |
+
|
| 10 |
+
function some(source, predicate, guard) {
|
| 11 |
+
if (!source) {
|
| 12 |
+
return false;
|
| 13 |
+
}
|
| 14 |
+
if (guard != null) {
|
| 15 |
+
predicate = undefined;
|
| 16 |
+
}
|
| 17 |
+
if (!predicate) {
|
| 18 |
+
predicate = identity.identity;
|
| 19 |
+
}
|
| 20 |
+
const values = Array.isArray(source) ? source : Object.values(source);
|
| 21 |
+
switch (typeof predicate) {
|
| 22 |
+
case 'function': {
|
| 23 |
+
if (!Array.isArray(source)) {
|
| 24 |
+
const keys = Object.keys(source);
|
| 25 |
+
for (let i = 0; i < keys.length; i++) {
|
| 26 |
+
const key = keys[i];
|
| 27 |
+
const value = source[key];
|
| 28 |
+
if (predicate(value, key, source)) {
|
| 29 |
+
return true;
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
return false;
|
| 33 |
+
}
|
| 34 |
+
for (let i = 0; i < source.length; i++) {
|
| 35 |
+
if (predicate(source[i], i, source)) {
|
| 36 |
+
return true;
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
return false;
|
| 40 |
+
}
|
| 41 |
+
case 'object': {
|
| 42 |
+
if (Array.isArray(predicate) && predicate.length === 2) {
|
| 43 |
+
const key = predicate[0];
|
| 44 |
+
const value = predicate[1];
|
| 45 |
+
const matchFunc = matchesProperty.matchesProperty(key, value);
|
| 46 |
+
if (Array.isArray(source)) {
|
| 47 |
+
for (let i = 0; i < source.length; i++) {
|
| 48 |
+
if (matchFunc(source[i])) {
|
| 49 |
+
return true;
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
return false;
|
| 53 |
+
}
|
| 54 |
+
return values.some(matchFunc);
|
| 55 |
+
}
|
| 56 |
+
else {
|
| 57 |
+
const matchFunc = matches.matches(predicate);
|
| 58 |
+
if (Array.isArray(source)) {
|
| 59 |
+
for (let i = 0; i < source.length; i++) {
|
| 60 |
+
if (matchFunc(source[i])) {
|
| 61 |
+
return true;
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
return false;
|
| 65 |
+
}
|
| 66 |
+
return values.some(matchFunc);
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
case 'number':
|
| 70 |
+
case 'symbol':
|
| 71 |
+
case 'string': {
|
| 72 |
+
const propFunc = property.property(predicate);
|
| 73 |
+
if (Array.isArray(source)) {
|
| 74 |
+
for (let i = 0; i < source.length; i++) {
|
| 75 |
+
if (propFunc(source[i])) {
|
| 76 |
+
return true;
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
return false;
|
| 80 |
+
}
|
| 81 |
+
return values.some(propFunc);
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
exports.some = some;
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/some.mjs
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { identity } from '../../function/identity.mjs';
|
| 2 |
+
import { property } from '../object/property.mjs';
|
| 3 |
+
import { matches } from '../predicate/matches.mjs';
|
| 4 |
+
import { matchesProperty } from '../predicate/matchesProperty.mjs';
|
| 5 |
+
|
| 6 |
+
function some(source, predicate, guard) {
|
| 7 |
+
if (!source) {
|
| 8 |
+
return false;
|
| 9 |
+
}
|
| 10 |
+
if (guard != null) {
|
| 11 |
+
predicate = undefined;
|
| 12 |
+
}
|
| 13 |
+
if (!predicate) {
|
| 14 |
+
predicate = identity;
|
| 15 |
+
}
|
| 16 |
+
const values = Array.isArray(source) ? source : Object.values(source);
|
| 17 |
+
switch (typeof predicate) {
|
| 18 |
+
case 'function': {
|
| 19 |
+
if (!Array.isArray(source)) {
|
| 20 |
+
const keys = Object.keys(source);
|
| 21 |
+
for (let i = 0; i < keys.length; i++) {
|
| 22 |
+
const key = keys[i];
|
| 23 |
+
const value = source[key];
|
| 24 |
+
if (predicate(value, key, source)) {
|
| 25 |
+
return true;
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
return false;
|
| 29 |
+
}
|
| 30 |
+
for (let i = 0; i < source.length; i++) {
|
| 31 |
+
if (predicate(source[i], i, source)) {
|
| 32 |
+
return true;
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
return false;
|
| 36 |
+
}
|
| 37 |
+
case 'object': {
|
| 38 |
+
if (Array.isArray(predicate) && predicate.length === 2) {
|
| 39 |
+
const key = predicate[0];
|
| 40 |
+
const value = predicate[1];
|
| 41 |
+
const matchFunc = matchesProperty(key, value);
|
| 42 |
+
if (Array.isArray(source)) {
|
| 43 |
+
for (let i = 0; i < source.length; i++) {
|
| 44 |
+
if (matchFunc(source[i])) {
|
| 45 |
+
return true;
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
return false;
|
| 49 |
+
}
|
| 50 |
+
return values.some(matchFunc);
|
| 51 |
+
}
|
| 52 |
+
else {
|
| 53 |
+
const matchFunc = matches(predicate);
|
| 54 |
+
if (Array.isArray(source)) {
|
| 55 |
+
for (let i = 0; i < source.length; i++) {
|
| 56 |
+
if (matchFunc(source[i])) {
|
| 57 |
+
return true;
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
return false;
|
| 61 |
+
}
|
| 62 |
+
return values.some(matchFunc);
|
| 63 |
+
}
|
| 64 |
+
}
|
| 65 |
+
case 'number':
|
| 66 |
+
case 'symbol':
|
| 67 |
+
case 'string': {
|
| 68 |
+
const propFunc = property(predicate);
|
| 69 |
+
if (Array.isArray(source)) {
|
| 70 |
+
for (let i = 0; i < source.length; i++) {
|
| 71 |
+
if (propFunc(source[i])) {
|
| 72 |
+
return true;
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
return false;
|
| 76 |
+
}
|
| 77 |
+
return values.some(propFunc);
|
| 78 |
+
}
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
export { some };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortBy.d.mts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { ListIteratee } from '../_internal/ListIteratee.mjs';
|
| 2 |
+
import { Many } from '../_internal/Many.mjs';
|
| 3 |
+
import { ObjectIteratee } from '../_internal/ObjectIteratee.mjs';
|
| 4 |
+
|
| 5 |
+
/**
|
| 6 |
+
* Sorts an array of objects based on multiple properties and their corresponding order directions.
|
| 7 |
+
*
|
| 8 |
+
* This function takes an array of objects, an array of criteria to sort by.
|
| 9 |
+
* It returns the ascending sorted array, ordering by each key.
|
| 10 |
+
* If values for a key are equal, it moves to the next key to determine the order.
|
| 11 |
+
*
|
| 12 |
+
* @template T - The type of elements in the array.
|
| 13 |
+
* @param {ArrayLike<T> | object | null | undefined} collection - The array of objects to be sorted.
|
| 14 |
+
* @param {Array<Array<Criterion<T> | Criterion<T>>>} criteria - An array of criteria (property names or property paths or custom key functions) to sort by.
|
| 15 |
+
* @returns {T[]} - The ascending sorted array.
|
| 16 |
+
*
|
| 17 |
+
* @example
|
| 18 |
+
* // Sort an array of objects by 'user' in ascending order and 'age' in descending order.
|
| 19 |
+
* const users = [
|
| 20 |
+
* { user: 'fred', age: 48 },
|
| 21 |
+
* { user: 'barney', age: 34 },
|
| 22 |
+
* { user: 'fred', age: 40 },
|
| 23 |
+
* { user: 'barney', age: 36 },
|
| 24 |
+
* ];
|
| 25 |
+
* const result = sortBy(users, ['user', (item) => item.age])
|
| 26 |
+
* // result will be:
|
| 27 |
+
* // [
|
| 28 |
+
* // { user: 'barney', age: 34 },
|
| 29 |
+
* // { user: 'barney', age: 36 },
|
| 30 |
+
* // { user: 'fred', age: 40 },
|
| 31 |
+
* // { user: 'fred', age: 48 },
|
| 32 |
+
* // ]
|
| 33 |
+
*/
|
| 34 |
+
/**
|
| 35 |
+
* Creates an array of elements, sorted in ascending order by the results of running each element in a collection thru each iteratee.
|
| 36 |
+
*
|
| 37 |
+
* @template T
|
| 38 |
+
* @param {ArrayLike<T> | null | undefined} collection - The collection to iterate over.
|
| 39 |
+
* @param {...Array<T | readonly T[] | ListIteratee<T>>} iteratees - The iteratees to sort by.
|
| 40 |
+
* @returns {T[]} Returns the new sorted array.
|
| 41 |
+
*
|
| 42 |
+
* @example
|
| 43 |
+
* const users = [
|
| 44 |
+
* { 'user': 'fred', 'age': 48 },
|
| 45 |
+
* { 'user': 'barney', 'age': 36 },
|
| 46 |
+
* { 'user': 'fred', 'age': 42 },
|
| 47 |
+
* { 'user': 'barney', 'age': 34 }
|
| 48 |
+
* ];
|
| 49 |
+
*
|
| 50 |
+
* sortBy(users, [function(o) { return o.user; }]);
|
| 51 |
+
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
|
| 52 |
+
*/
|
| 53 |
+
declare function sortBy<T>(collection: ArrayLike<T> | null | undefined, ...iteratees: Array<Many<ListIteratee<T>>>): T[];
|
| 54 |
+
/**
|
| 55 |
+
* Creates an array of elements, sorted in ascending order by the results of running each element in a collection thru each iteratee.
|
| 56 |
+
*
|
| 57 |
+
* @template T
|
| 58 |
+
* @param {T | null | undefined} collection - The object to iterate over.
|
| 59 |
+
* @param {...Array<T[keyof T] | readonly Array<T[keyof T]> | ObjectIteratee<T>>} iteratees - The iteratees to sort by.
|
| 60 |
+
* @returns {Array<T[keyof T]>} Returns the new sorted array.
|
| 61 |
+
*
|
| 62 |
+
* @example
|
| 63 |
+
* const users = {
|
| 64 |
+
* 'a': { 'user': 'fred', 'age': 48 },
|
| 65 |
+
* 'b': { 'user': 'barney', 'age': 36 }
|
| 66 |
+
* };
|
| 67 |
+
*
|
| 68 |
+
* sortBy(users, [function(o) { return o.user; }]);
|
| 69 |
+
* // => [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 48 }]
|
| 70 |
+
*/
|
| 71 |
+
declare function sortBy<T extends object>(collection: T | null | undefined, ...iteratees: Array<Many<ObjectIteratee<T>>>): Array<T[keyof T]>;
|
| 72 |
+
|
| 73 |
+
export { sortBy };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortBy.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { ListIteratee } from '../_internal/ListIteratee.js';
|
| 2 |
+
import { Many } from '../_internal/Many.js';
|
| 3 |
+
import { ObjectIteratee } from '../_internal/ObjectIteratee.js';
|
| 4 |
+
|
| 5 |
+
/**
|
| 6 |
+
* Sorts an array of objects based on multiple properties and their corresponding order directions.
|
| 7 |
+
*
|
| 8 |
+
* This function takes an array of objects, an array of criteria to sort by.
|
| 9 |
+
* It returns the ascending sorted array, ordering by each key.
|
| 10 |
+
* If values for a key are equal, it moves to the next key to determine the order.
|
| 11 |
+
*
|
| 12 |
+
* @template T - The type of elements in the array.
|
| 13 |
+
* @param {ArrayLike<T> | object | null | undefined} collection - The array of objects to be sorted.
|
| 14 |
+
* @param {Array<Array<Criterion<T> | Criterion<T>>>} criteria - An array of criteria (property names or property paths or custom key functions) to sort by.
|
| 15 |
+
* @returns {T[]} - The ascending sorted array.
|
| 16 |
+
*
|
| 17 |
+
* @example
|
| 18 |
+
* // Sort an array of objects by 'user' in ascending order and 'age' in descending order.
|
| 19 |
+
* const users = [
|
| 20 |
+
* { user: 'fred', age: 48 },
|
| 21 |
+
* { user: 'barney', age: 34 },
|
| 22 |
+
* { user: 'fred', age: 40 },
|
| 23 |
+
* { user: 'barney', age: 36 },
|
| 24 |
+
* ];
|
| 25 |
+
* const result = sortBy(users, ['user', (item) => item.age])
|
| 26 |
+
* // result will be:
|
| 27 |
+
* // [
|
| 28 |
+
* // { user: 'barney', age: 34 },
|
| 29 |
+
* // { user: 'barney', age: 36 },
|
| 30 |
+
* // { user: 'fred', age: 40 },
|
| 31 |
+
* // { user: 'fred', age: 48 },
|
| 32 |
+
* // ]
|
| 33 |
+
*/
|
| 34 |
+
/**
|
| 35 |
+
* Creates an array of elements, sorted in ascending order by the results of running each element in a collection thru each iteratee.
|
| 36 |
+
*
|
| 37 |
+
* @template T
|
| 38 |
+
* @param {ArrayLike<T> | null | undefined} collection - The collection to iterate over.
|
| 39 |
+
* @param {...Array<T | readonly T[] | ListIteratee<T>>} iteratees - The iteratees to sort by.
|
| 40 |
+
* @returns {T[]} Returns the new sorted array.
|
| 41 |
+
*
|
| 42 |
+
* @example
|
| 43 |
+
* const users = [
|
| 44 |
+
* { 'user': 'fred', 'age': 48 },
|
| 45 |
+
* { 'user': 'barney', 'age': 36 },
|
| 46 |
+
* { 'user': 'fred', 'age': 42 },
|
| 47 |
+
* { 'user': 'barney', 'age': 34 }
|
| 48 |
+
* ];
|
| 49 |
+
*
|
| 50 |
+
* sortBy(users, [function(o) { return o.user; }]);
|
| 51 |
+
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
|
| 52 |
+
*/
|
| 53 |
+
declare function sortBy<T>(collection: ArrayLike<T> | null | undefined, ...iteratees: Array<Many<ListIteratee<T>>>): T[];
|
| 54 |
+
/**
|
| 55 |
+
* Creates an array of elements, sorted in ascending order by the results of running each element in a collection thru each iteratee.
|
| 56 |
+
*
|
| 57 |
+
* @template T
|
| 58 |
+
* @param {T | null | undefined} collection - The object to iterate over.
|
| 59 |
+
* @param {...Array<T[keyof T] | readonly Array<T[keyof T]> | ObjectIteratee<T>>} iteratees - The iteratees to sort by.
|
| 60 |
+
* @returns {Array<T[keyof T]>} Returns the new sorted array.
|
| 61 |
+
*
|
| 62 |
+
* @example
|
| 63 |
+
* const users = {
|
| 64 |
+
* 'a': { 'user': 'fred', 'age': 48 },
|
| 65 |
+
* 'b': { 'user': 'barney', 'age': 36 }
|
| 66 |
+
* };
|
| 67 |
+
*
|
| 68 |
+
* sortBy(users, [function(o) { return o.user; }]);
|
| 69 |
+
* // => [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 48 }]
|
| 70 |
+
*/
|
| 71 |
+
declare function sortBy<T extends object>(collection: T | null | undefined, ...iteratees: Array<Many<ObjectIteratee<T>>>): Array<T[keyof T]>;
|
| 72 |
+
|
| 73 |
+
export { sortBy };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortBy.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 4 |
+
|
| 5 |
+
const orderBy = require('./orderBy.js');
|
| 6 |
+
const flatten = require('../../array/flatten.js');
|
| 7 |
+
const isIterateeCall = require('../_internal/isIterateeCall.js');
|
| 8 |
+
|
| 9 |
+
function sortBy(collection, ...criteria) {
|
| 10 |
+
const length = criteria.length;
|
| 11 |
+
if (length > 1 && isIterateeCall.isIterateeCall(collection, criteria[0], criteria[1])) {
|
| 12 |
+
criteria = [];
|
| 13 |
+
}
|
| 14 |
+
else if (length > 2 && isIterateeCall.isIterateeCall(criteria[0], criteria[1], criteria[2])) {
|
| 15 |
+
criteria = [criteria[0]];
|
| 16 |
+
}
|
| 17 |
+
return orderBy.orderBy(collection, flatten.flatten(criteria), ['asc']);
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
exports.sortBy = sortBy;
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortBy.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { orderBy } from './orderBy.mjs';
|
| 2 |
+
import { flatten } from '../../array/flatten.mjs';
|
| 3 |
+
import { isIterateeCall } from '../_internal/isIterateeCall.mjs';
|
| 4 |
+
|
| 5 |
+
function sortBy(collection, ...criteria) {
|
| 6 |
+
const length = criteria.length;
|
| 7 |
+
if (length > 1 && isIterateeCall(collection, criteria[0], criteria[1])) {
|
| 8 |
+
criteria = [];
|
| 9 |
+
}
|
| 10 |
+
else if (length > 2 && isIterateeCall(criteria[0], criteria[1], criteria[2])) {
|
| 11 |
+
criteria = [criteria[0]];
|
| 12 |
+
}
|
| 13 |
+
return orderBy(collection, flatten(criteria), ['asc']);
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
export { sortBy };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndex.d.mts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Uses a binary search to determine the lowest index at which `value`
|
| 3 |
+
* should be inserted into `array` in order to maintain its sort order.
|
| 4 |
+
*
|
| 5 |
+
* @category Array
|
| 6 |
+
* @param {ArrayLike<T> | null | undefined} array The sorted array to inspect.
|
| 7 |
+
* @param {T} value The value to evaluate.
|
| 8 |
+
* @returns {number} Returns the index at which `value` should be inserted
|
| 9 |
+
* into `array`.
|
| 10 |
+
* @example
|
| 11 |
+
* sortedIndex([30, 50], 40)
|
| 12 |
+
* // => 1
|
| 13 |
+
*/
|
| 14 |
+
declare function sortedIndex<T>(array: ArrayLike<T> | null | undefined, value: T): number;
|
| 15 |
+
/**
|
| 16 |
+
* Uses a binary search to determine the lowest index at which `value`
|
| 17 |
+
* should be inserted into `array` in order to maintain its sort order.
|
| 18 |
+
*
|
| 19 |
+
* @category Array
|
| 20 |
+
* @param {ArrayLike<T> | null | undefined} array The sorted array to inspect.
|
| 21 |
+
* @param {T} value The value to evaluate.
|
| 22 |
+
* @returns {number} Returns the index at which `value` should be inserted
|
| 23 |
+
* into `array`.
|
| 24 |
+
* @example
|
| 25 |
+
* sortedIndex([30, 50], 40)
|
| 26 |
+
* // => 1
|
| 27 |
+
*/
|
| 28 |
+
declare function sortedIndex<T>(array: ArrayLike<T> | null | undefined, value: T): number;
|
| 29 |
+
|
| 30 |
+
export { sortedIndex };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndex.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Uses a binary search to determine the lowest index at which `value`
|
| 3 |
+
* should be inserted into `array` in order to maintain its sort order.
|
| 4 |
+
*
|
| 5 |
+
* @category Array
|
| 6 |
+
* @param {ArrayLike<T> | null | undefined} array The sorted array to inspect.
|
| 7 |
+
* @param {T} value The value to evaluate.
|
| 8 |
+
* @returns {number} Returns the index at which `value` should be inserted
|
| 9 |
+
* into `array`.
|
| 10 |
+
* @example
|
| 11 |
+
* sortedIndex([30, 50], 40)
|
| 12 |
+
* // => 1
|
| 13 |
+
*/
|
| 14 |
+
declare function sortedIndex<T>(array: ArrayLike<T> | null | undefined, value: T): number;
|
| 15 |
+
/**
|
| 16 |
+
* Uses a binary search to determine the lowest index at which `value`
|
| 17 |
+
* should be inserted into `array` in order to maintain its sort order.
|
| 18 |
+
*
|
| 19 |
+
* @category Array
|
| 20 |
+
* @param {ArrayLike<T> | null | undefined} array The sorted array to inspect.
|
| 21 |
+
* @param {T} value The value to evaluate.
|
| 22 |
+
* @returns {number} Returns the index at which `value` should be inserted
|
| 23 |
+
* into `array`.
|
| 24 |
+
* @example
|
| 25 |
+
* sortedIndex([30, 50], 40)
|
| 26 |
+
* // => 1
|
| 27 |
+
*/
|
| 28 |
+
declare function sortedIndex<T>(array: ArrayLike<T> | null | undefined, value: T): number;
|
| 29 |
+
|
| 30 |
+
export { sortedIndex };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndex.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 4 |
+
|
| 5 |
+
const sortedIndexBy = require('./sortedIndexBy.js');
|
| 6 |
+
const isNil = require('../../predicate/isNil.js');
|
| 7 |
+
const isNull = require('../../predicate/isNull.js');
|
| 8 |
+
const isSymbol = require('../../predicate/isSymbol.js');
|
| 9 |
+
const isNumber = require('../predicate/isNumber.js');
|
| 10 |
+
|
| 11 |
+
const MAX_ARRAY_LENGTH = 4294967295;
|
| 12 |
+
const HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
|
| 13 |
+
function sortedIndex(array, value) {
|
| 14 |
+
if (isNil.isNil(array)) {
|
| 15 |
+
return 0;
|
| 16 |
+
}
|
| 17 |
+
let low = 0, high = isNil.isNil(array) ? low : array.length;
|
| 18 |
+
if (isNumber.isNumber(value) && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
|
| 19 |
+
while (low < high) {
|
| 20 |
+
const mid = (low + high) >>> 1;
|
| 21 |
+
const compute = array[mid];
|
| 22 |
+
if (!isNull.isNull(compute) && !isSymbol.isSymbol(compute) && compute < value) {
|
| 23 |
+
low = mid + 1;
|
| 24 |
+
}
|
| 25 |
+
else {
|
| 26 |
+
high = mid;
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
return high;
|
| 30 |
+
}
|
| 31 |
+
return sortedIndexBy.sortedIndexBy(array, value, value => value);
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
exports.sortedIndex = sortedIndex;
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndex.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { sortedIndexBy } from './sortedIndexBy.mjs';
|
| 2 |
+
import { isNil } from '../../predicate/isNil.mjs';
|
| 3 |
+
import { isNull } from '../../predicate/isNull.mjs';
|
| 4 |
+
import { isSymbol } from '../../predicate/isSymbol.mjs';
|
| 5 |
+
import { isNumber } from '../predicate/isNumber.mjs';
|
| 6 |
+
|
| 7 |
+
const MAX_ARRAY_LENGTH = 4294967295;
|
| 8 |
+
const HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
|
| 9 |
+
function sortedIndex(array, value) {
|
| 10 |
+
if (isNil(array)) {
|
| 11 |
+
return 0;
|
| 12 |
+
}
|
| 13 |
+
let low = 0, high = isNil(array) ? low : array.length;
|
| 14 |
+
if (isNumber(value) && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
|
| 15 |
+
while (low < high) {
|
| 16 |
+
const mid = (low + high) >>> 1;
|
| 17 |
+
const compute = array[mid];
|
| 18 |
+
if (!isNull(compute) && !isSymbol(compute) && compute < value) {
|
| 19 |
+
low = mid + 1;
|
| 20 |
+
}
|
| 21 |
+
else {
|
| 22 |
+
high = mid;
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
return high;
|
| 26 |
+
}
|
| 27 |
+
return sortedIndexBy(array, value, value => value);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
export { sortedIndex };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.d.mts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { ValueIteratee } from '../_internal/ValueIteratee.mjs';
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* This method is like `sortedIndex` except that it accepts `iteratee`
|
| 5 |
+
* which is invoked for `value` and each element of `array` to compute their
|
| 6 |
+
* sort ranking. The iteratee is invoked with one argument: (value).
|
| 7 |
+
*
|
| 8 |
+
* @template T
|
| 9 |
+
* @param {ArrayLike<T> | null | undefined} array - The sorted array to inspect.
|
| 10 |
+
* @param {T} value - The value to evaluate.
|
| 11 |
+
* @param {ValueIteratee<T>} [iteratee] - The iteratee invoked per element.
|
| 12 |
+
* @returns {number} Returns the index at which `value` should be inserted into `array`.
|
| 13 |
+
*
|
| 14 |
+
* @example
|
| 15 |
+
* const dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
|
| 16 |
+
* sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
|
| 17 |
+
* // => 1
|
| 18 |
+
*
|
| 19 |
+
* @example
|
| 20 |
+
* sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
|
| 21 |
+
* // => 0
|
| 22 |
+
*/
|
| 23 |
+
declare function sortedIndexBy<T>(array: ArrayLike<T> | null | undefined, value: T, iteratee?: ValueIteratee<T>): number;
|
| 24 |
+
|
| 25 |
+
export { sortedIndexBy };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { ValueIteratee } from '../_internal/ValueIteratee.js';
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* This method is like `sortedIndex` except that it accepts `iteratee`
|
| 5 |
+
* which is invoked for `value` and each element of `array` to compute their
|
| 6 |
+
* sort ranking. The iteratee is invoked with one argument: (value).
|
| 7 |
+
*
|
| 8 |
+
* @template T
|
| 9 |
+
* @param {ArrayLike<T> | null | undefined} array - The sorted array to inspect.
|
| 10 |
+
* @param {T} value - The value to evaluate.
|
| 11 |
+
* @param {ValueIteratee<T>} [iteratee] - The iteratee invoked per element.
|
| 12 |
+
* @returns {number} Returns the index at which `value` should be inserted into `array`.
|
| 13 |
+
*
|
| 14 |
+
* @example
|
| 15 |
+
* const dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
|
| 16 |
+
* sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
|
| 17 |
+
* // => 1
|
| 18 |
+
*
|
| 19 |
+
* @example
|
| 20 |
+
* sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
|
| 21 |
+
* // => 0
|
| 22 |
+
*/
|
| 23 |
+
declare function sortedIndexBy<T>(array: ArrayLike<T> | null | undefined, value: T, iteratee?: ValueIteratee<T>): number;
|
| 24 |
+
|
| 25 |
+
export { sortedIndexBy };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 4 |
+
|
| 5 |
+
const isNull = require('../../predicate/isNull.js');
|
| 6 |
+
const isUndefined = require('../../predicate/isUndefined.js');
|
| 7 |
+
const isNaN = require('../predicate/isNaN.js');
|
| 8 |
+
const isNil = require('../predicate/isNil.js');
|
| 9 |
+
const isSymbol = require('../predicate/isSymbol.js');
|
| 10 |
+
const iteratee = require('../util/iteratee.js');
|
| 11 |
+
|
| 12 |
+
const MAX_ARRAY_LENGTH = 4294967295;
|
| 13 |
+
const MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
|
| 14 |
+
function sortedIndexBy(array, value, iteratee$1 = iteratee.iteratee, retHighest) {
|
| 15 |
+
let low = 0;
|
| 16 |
+
let high = array == null ? 0 : array.length;
|
| 17 |
+
if (high === 0 || isNil.isNil(array)) {
|
| 18 |
+
return 0;
|
| 19 |
+
}
|
| 20 |
+
const iterateeFunction = iteratee.iteratee(iteratee$1);
|
| 21 |
+
const transformedValue = iterateeFunction(value);
|
| 22 |
+
const valIsNaN = isNaN.isNaN(transformedValue);
|
| 23 |
+
const valIsNull = isNull.isNull(transformedValue);
|
| 24 |
+
const valIsSymbol = isSymbol.isSymbol(transformedValue);
|
| 25 |
+
const valIsUndefined = isUndefined.isUndefined(transformedValue);
|
| 26 |
+
while (low < high) {
|
| 27 |
+
let setLow;
|
| 28 |
+
const mid = Math.floor((low + high) / 2);
|
| 29 |
+
const computed = iterateeFunction(array[mid]);
|
| 30 |
+
const othIsDefined = !isUndefined.isUndefined(computed);
|
| 31 |
+
const othIsNull = isNull.isNull(computed);
|
| 32 |
+
const othIsReflexive = !isNaN.isNaN(computed);
|
| 33 |
+
const othIsSymbol = isSymbol.isSymbol(computed);
|
| 34 |
+
if (valIsNaN) {
|
| 35 |
+
setLow = retHighest || othIsReflexive;
|
| 36 |
+
}
|
| 37 |
+
else if (valIsUndefined) {
|
| 38 |
+
setLow = othIsReflexive && (retHighest || othIsDefined);
|
| 39 |
+
}
|
| 40 |
+
else if (valIsNull) {
|
| 41 |
+
setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
|
| 42 |
+
}
|
| 43 |
+
else if (valIsSymbol) {
|
| 44 |
+
setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
|
| 45 |
+
}
|
| 46 |
+
else if (othIsNull || othIsSymbol) {
|
| 47 |
+
setLow = false;
|
| 48 |
+
}
|
| 49 |
+
else {
|
| 50 |
+
setLow = retHighest ? computed <= transformedValue : computed < transformedValue;
|
| 51 |
+
}
|
| 52 |
+
if (setLow) {
|
| 53 |
+
low = mid + 1;
|
| 54 |
+
}
|
| 55 |
+
else {
|
| 56 |
+
high = mid;
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
return Math.min(high, MAX_ARRAY_INDEX);
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
exports.sortedIndexBy = sortedIndexBy;
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.mjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { isNull } from '../../predicate/isNull.mjs';
|
| 2 |
+
import { isUndefined } from '../../predicate/isUndefined.mjs';
|
| 3 |
+
import { isNaN } from '../predicate/isNaN.mjs';
|
| 4 |
+
import { isNil } from '../predicate/isNil.mjs';
|
| 5 |
+
import { isSymbol } from '../predicate/isSymbol.mjs';
|
| 6 |
+
import { iteratee } from '../util/iteratee.mjs';
|
| 7 |
+
|
| 8 |
+
const MAX_ARRAY_LENGTH = 4294967295;
|
| 9 |
+
const MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
|
| 10 |
+
function sortedIndexBy(array, value, iteratee$1 = iteratee, retHighest) {
|
| 11 |
+
let low = 0;
|
| 12 |
+
let high = array == null ? 0 : array.length;
|
| 13 |
+
if (high === 0 || isNil(array)) {
|
| 14 |
+
return 0;
|
| 15 |
+
}
|
| 16 |
+
const iterateeFunction = iteratee(iteratee$1);
|
| 17 |
+
const transformedValue = iterateeFunction(value);
|
| 18 |
+
const valIsNaN = isNaN(transformedValue);
|
| 19 |
+
const valIsNull = isNull(transformedValue);
|
| 20 |
+
const valIsSymbol = isSymbol(transformedValue);
|
| 21 |
+
const valIsUndefined = isUndefined(transformedValue);
|
| 22 |
+
while (low < high) {
|
| 23 |
+
let setLow;
|
| 24 |
+
const mid = Math.floor((low + high) / 2);
|
| 25 |
+
const computed = iterateeFunction(array[mid]);
|
| 26 |
+
const othIsDefined = !isUndefined(computed);
|
| 27 |
+
const othIsNull = isNull(computed);
|
| 28 |
+
const othIsReflexive = !isNaN(computed);
|
| 29 |
+
const othIsSymbol = isSymbol(computed);
|
| 30 |
+
if (valIsNaN) {
|
| 31 |
+
setLow = retHighest || othIsReflexive;
|
| 32 |
+
}
|
| 33 |
+
else if (valIsUndefined) {
|
| 34 |
+
setLow = othIsReflexive && (retHighest || othIsDefined);
|
| 35 |
+
}
|
| 36 |
+
else if (valIsNull) {
|
| 37 |
+
setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
|
| 38 |
+
}
|
| 39 |
+
else if (valIsSymbol) {
|
| 40 |
+
setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
|
| 41 |
+
}
|
| 42 |
+
else if (othIsNull || othIsSymbol) {
|
| 43 |
+
setLow = false;
|
| 44 |
+
}
|
| 45 |
+
else {
|
| 46 |
+
setLow = retHighest ? computed <= transformedValue : computed < transformedValue;
|
| 47 |
+
}
|
| 48 |
+
if (setLow) {
|
| 49 |
+
low = mid + 1;
|
| 50 |
+
}
|
| 51 |
+
else {
|
| 52 |
+
high = mid;
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
return Math.min(high, MAX_ARRAY_INDEX);
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
export { sortedIndexBy };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexOf.d.mts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Finds the index of the first occurrence of a value in a sorted array, similar to how `Array#indexOf` works, but specifically for sorted arrays.
|
| 3 |
+
*
|
| 4 |
+
* Make sure to provide a sorted array to this function, as it uses a binary search to quickly find the index.
|
| 5 |
+
*
|
| 6 |
+
* @param {ArrayLike<T> | null | undefined} array The sorted array to inspect.
|
| 7 |
+
* @param {T} value The value to search for.
|
| 8 |
+
* @returns {number} Returns the index of the matched value, else -1.
|
| 9 |
+
*
|
| 10 |
+
* @example
|
| 11 |
+
* const numbers = [1, 2, 3, 4, 5];
|
| 12 |
+
* sortedIndexOf(numbers, 11); // Return value: 0
|
| 13 |
+
* sortedIndexOf(numbers, 30); // Return value: -1
|
| 14 |
+
*
|
| 15 |
+
* // If the value is duplicated, it returns the first index of the value.
|
| 16 |
+
* const duplicateNumbers = [1, 2, 2, 3, 3, 3, 4];
|
| 17 |
+
* sortedIndexOf(duplicateNumbers, 3); // Return value: 3
|
| 18 |
+
*
|
| 19 |
+
* // If the array is unsorted, it can return the wrong index.
|
| 20 |
+
* const unSortedArray = [55, 33, 22, 11, 44];
|
| 21 |
+
* sortedIndexOf(unSortedArray, 11); // Return value: -1
|
| 22 |
+
*
|
| 23 |
+
* // -0 and 0 are treated the same
|
| 24 |
+
* const mixedZeroArray = [-0, 0];
|
| 25 |
+
* sortedIndexOf(mixedZeroArray, 0); // Return value: 0
|
| 26 |
+
* sortedIndexOf(mixedZeroArray, -0); // Return value: 0
|
| 27 |
+
*
|
| 28 |
+
* // It works with array-like objects
|
| 29 |
+
* const arrayLike = { length: 3, 0: 10, 1: 20, 2: 30 };
|
| 30 |
+
* sortedIndexOf(arrayLike, 20); // Return value: 1
|
| 31 |
+
*/
|
| 32 |
+
declare function sortedIndexOf<T>(array: ArrayLike<T> | null | undefined, value: T): number;
|
| 33 |
+
|
| 34 |
+
export { sortedIndexOf };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexOf.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Finds the index of the first occurrence of a value in a sorted array, similar to how `Array#indexOf` works, but specifically for sorted arrays.
|
| 3 |
+
*
|
| 4 |
+
* Make sure to provide a sorted array to this function, as it uses a binary search to quickly find the index.
|
| 5 |
+
*
|
| 6 |
+
* @param {ArrayLike<T> | null | undefined} array The sorted array to inspect.
|
| 7 |
+
* @param {T} value The value to search for.
|
| 8 |
+
* @returns {number} Returns the index of the matched value, else -1.
|
| 9 |
+
*
|
| 10 |
+
* @example
|
| 11 |
+
* const numbers = [1, 2, 3, 4, 5];
|
| 12 |
+
* sortedIndexOf(numbers, 11); // Return value: 0
|
| 13 |
+
* sortedIndexOf(numbers, 30); // Return value: -1
|
| 14 |
+
*
|
| 15 |
+
* // If the value is duplicated, it returns the first index of the value.
|
| 16 |
+
* const duplicateNumbers = [1, 2, 2, 3, 3, 3, 4];
|
| 17 |
+
* sortedIndexOf(duplicateNumbers, 3); // Return value: 3
|
| 18 |
+
*
|
| 19 |
+
* // If the array is unsorted, it can return the wrong index.
|
| 20 |
+
* const unSortedArray = [55, 33, 22, 11, 44];
|
| 21 |
+
* sortedIndexOf(unSortedArray, 11); // Return value: -1
|
| 22 |
+
*
|
| 23 |
+
* // -0 and 0 are treated the same
|
| 24 |
+
* const mixedZeroArray = [-0, 0];
|
| 25 |
+
* sortedIndexOf(mixedZeroArray, 0); // Return value: 0
|
| 26 |
+
* sortedIndexOf(mixedZeroArray, -0); // Return value: 0
|
| 27 |
+
*
|
| 28 |
+
* // It works with array-like objects
|
| 29 |
+
* const arrayLike = { length: 3, 0: 10, 1: 20, 2: 30 };
|
| 30 |
+
* sortedIndexOf(arrayLike, 20); // Return value: 1
|
| 31 |
+
*/
|
| 32 |
+
declare function sortedIndexOf<T>(array: ArrayLike<T> | null | undefined, value: T): number;
|
| 33 |
+
|
| 34 |
+
export { sortedIndexOf };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexOf.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 4 |
+
|
| 5 |
+
const sortedIndex = require('./sortedIndex.js');
|
| 6 |
+
const eq = require('../util/eq.js');
|
| 7 |
+
|
| 8 |
+
function sortedIndexOf(array, value) {
|
| 9 |
+
if (!array?.length) {
|
| 10 |
+
return -1;
|
| 11 |
+
}
|
| 12 |
+
const index = sortedIndex.sortedIndex(array, value);
|
| 13 |
+
if (index < array.length && eq.eq(array[index], value)) {
|
| 14 |
+
return index;
|
| 15 |
+
}
|
| 16 |
+
return -1;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
exports.sortedIndexOf = sortedIndexOf;
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedIndexOf.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { sortedIndex } from './sortedIndex.mjs';
|
| 2 |
+
import { eq } from '../util/eq.mjs';
|
| 3 |
+
|
| 4 |
+
function sortedIndexOf(array, value) {
|
| 5 |
+
if (!array?.length) {
|
| 6 |
+
return -1;
|
| 7 |
+
}
|
| 8 |
+
const index = sortedIndex(array, value);
|
| 9 |
+
if (index < array.length && eq(array[index], value)) {
|
| 10 |
+
return index;
|
| 11 |
+
}
|
| 12 |
+
return -1;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
export { sortedIndexOf };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndex.d.mts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Uses a binary search to determine the highest index at which `value`
|
| 3 |
+
* should be inserted into `array` in order to maintain its sort order.
|
| 4 |
+
*
|
| 5 |
+
* @category Array
|
| 6 |
+
* @param {ArrayLike<T> | null | undefined} array The sorted array to inspect.
|
| 7 |
+
* @param {T} value The value to evaluate.
|
| 8 |
+
* @returns {number} Returns the index at which `value` should be inserted
|
| 9 |
+
* into `array`.
|
| 10 |
+
* @example
|
| 11 |
+
* sortedIndex([4, 5, 5, 5, 6], 5)
|
| 12 |
+
* // => 4
|
| 13 |
+
*/
|
| 14 |
+
declare function sortedLastIndex<T>(array: ArrayLike<T> | null | undefined, value: T): number;
|
| 15 |
+
|
| 16 |
+
export { sortedLastIndex };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndex.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Uses a binary search to determine the highest index at which `value`
|
| 3 |
+
* should be inserted into `array` in order to maintain its sort order.
|
| 4 |
+
*
|
| 5 |
+
* @category Array
|
| 6 |
+
* @param {ArrayLike<T> | null | undefined} array The sorted array to inspect.
|
| 7 |
+
* @param {T} value The value to evaluate.
|
| 8 |
+
* @returns {number} Returns the index at which `value` should be inserted
|
| 9 |
+
* into `array`.
|
| 10 |
+
* @example
|
| 11 |
+
* sortedIndex([4, 5, 5, 5, 6], 5)
|
| 12 |
+
* // => 4
|
| 13 |
+
*/
|
| 14 |
+
declare function sortedLastIndex<T>(array: ArrayLike<T> | null | undefined, value: T): number;
|
| 15 |
+
|
| 16 |
+
export { sortedLastIndex };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndex.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 4 |
+
|
| 5 |
+
const sortedLastIndexBy = require('./sortedLastIndexBy.js');
|
| 6 |
+
const isNil = require('../../predicate/isNil.js');
|
| 7 |
+
const isNull = require('../../predicate/isNull.js');
|
| 8 |
+
const isSymbol = require('../../predicate/isSymbol.js');
|
| 9 |
+
const isNumber = require('../predicate/isNumber.js');
|
| 10 |
+
|
| 11 |
+
const MAX_ARRAY_LENGTH = 4294967295;
|
| 12 |
+
const HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
|
| 13 |
+
function sortedLastIndex(array, value) {
|
| 14 |
+
if (isNil.isNil(array)) {
|
| 15 |
+
return 0;
|
| 16 |
+
}
|
| 17 |
+
let high = array.length;
|
| 18 |
+
if (!isNumber.isNumber(value) || Number.isNaN(value) || high > HALF_MAX_ARRAY_LENGTH) {
|
| 19 |
+
return sortedLastIndexBy.sortedLastIndexBy(array, value, value => value);
|
| 20 |
+
}
|
| 21 |
+
let low = 0;
|
| 22 |
+
while (low < high) {
|
| 23 |
+
const mid = (low + high) >>> 1;
|
| 24 |
+
const compute = array[mid];
|
| 25 |
+
if (!isNull.isNull(compute) && !isSymbol.isSymbol(compute) && compute <= value) {
|
| 26 |
+
low = mid + 1;
|
| 27 |
+
}
|
| 28 |
+
else {
|
| 29 |
+
high = mid;
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
return high;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
exports.sortedLastIndex = sortedLastIndex;
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndex.mjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { sortedLastIndexBy } from './sortedLastIndexBy.mjs';
|
| 2 |
+
import { isNil } from '../../predicate/isNil.mjs';
|
| 3 |
+
import { isNull } from '../../predicate/isNull.mjs';
|
| 4 |
+
import { isSymbol } from '../../predicate/isSymbol.mjs';
|
| 5 |
+
import { isNumber } from '../predicate/isNumber.mjs';
|
| 6 |
+
|
| 7 |
+
const MAX_ARRAY_LENGTH = 4294967295;
|
| 8 |
+
const HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
|
| 9 |
+
function sortedLastIndex(array, value) {
|
| 10 |
+
if (isNil(array)) {
|
| 11 |
+
return 0;
|
| 12 |
+
}
|
| 13 |
+
let high = array.length;
|
| 14 |
+
if (!isNumber(value) || Number.isNaN(value) || high > HALF_MAX_ARRAY_LENGTH) {
|
| 15 |
+
return sortedLastIndexBy(array, value, value => value);
|
| 16 |
+
}
|
| 17 |
+
let low = 0;
|
| 18 |
+
while (low < high) {
|
| 19 |
+
const mid = (low + high) >>> 1;
|
| 20 |
+
const compute = array[mid];
|
| 21 |
+
if (!isNull(compute) && !isSymbol(compute) && compute <= value) {
|
| 22 |
+
low = mid + 1;
|
| 23 |
+
}
|
| 24 |
+
else {
|
| 25 |
+
high = mid;
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
return high;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
export { sortedLastIndex };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexBy.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { ValueIteratee } from '../_internal/ValueIteratee.mjs';
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* This method is like `sortedLastIndex` except that it accepts `iteratee`
|
| 5 |
+
* which is invoked for `value` and each element of `array` to compute their
|
| 6 |
+
* sort ranking. The iteratee is invoked with one argument: (value).
|
| 7 |
+
*
|
| 8 |
+
* @template T
|
| 9 |
+
* @param {ArrayLike<T> | null | undefined} array - The sorted array to inspect.
|
| 10 |
+
* @param {T} value - The value to evaluate.
|
| 11 |
+
* @param {ValueIteratee<T>} iteratee - The iteratee invoked per element.
|
| 12 |
+
* @returns {number} Returns the index at which `value` should be inserted into `array`.
|
| 13 |
+
*
|
| 14 |
+
* @example
|
| 15 |
+
* sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
|
| 16 |
+
* // => 1
|
| 17 |
+
*/
|
| 18 |
+
declare function sortedLastIndexBy<T>(array: ArrayLike<T> | null | undefined, value: T, iteratee: ValueIteratee<T>): number;
|
| 19 |
+
|
| 20 |
+
export { sortedLastIndexBy };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexBy.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { ValueIteratee } from '../_internal/ValueIteratee.js';
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* This method is like `sortedLastIndex` except that it accepts `iteratee`
|
| 5 |
+
* which is invoked for `value` and each element of `array` to compute their
|
| 6 |
+
* sort ranking. The iteratee is invoked with one argument: (value).
|
| 7 |
+
*
|
| 8 |
+
* @template T
|
| 9 |
+
* @param {ArrayLike<T> | null | undefined} array - The sorted array to inspect.
|
| 10 |
+
* @param {T} value - The value to evaluate.
|
| 11 |
+
* @param {ValueIteratee<T>} iteratee - The iteratee invoked per element.
|
| 12 |
+
* @returns {number} Returns the index at which `value` should be inserted into `array`.
|
| 13 |
+
*
|
| 14 |
+
* @example
|
| 15 |
+
* sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
|
| 16 |
+
* // => 1
|
| 17 |
+
*/
|
| 18 |
+
declare function sortedLastIndexBy<T>(array: ArrayLike<T> | null | undefined, value: T, iteratee: ValueIteratee<T>): number;
|
| 19 |
+
|
| 20 |
+
export { sortedLastIndexBy };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexBy.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 4 |
+
|
| 5 |
+
const sortedIndexBy = require('./sortedIndexBy.js');
|
| 6 |
+
|
| 7 |
+
function sortedLastIndexBy(array, value, iteratee) {
|
| 8 |
+
return sortedIndexBy.sortedIndexBy(array, value, iteratee, true);
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
exports.sortedLastIndexBy = sortedLastIndexBy;
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexBy.mjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { sortedIndexBy } from './sortedIndexBy.mjs';
|
| 2 |
+
|
| 3 |
+
function sortedLastIndexBy(array, value, iteratee) {
|
| 4 |
+
return sortedIndexBy(array, value, iteratee, true);
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
export { sortedLastIndexBy };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexOf.d.mts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Finds the index of the last occurrence of a value in a sorted array.
|
| 3 |
+
* This function is similar to `Array#lastIndexOf` but is specifically designed for sorted arrays.
|
| 4 |
+
*
|
| 5 |
+
* Make sure to provide a sorted array to this function, as it uses a binary search to quickly find the index.
|
| 6 |
+
*
|
| 7 |
+
* @param {ArrayLike<T> | null | undefined} array The sorted array to inspect.
|
| 8 |
+
* @param {T} value The value to search for.
|
| 9 |
+
* @returns {number} Returns the index of the last matched value, else -1.
|
| 10 |
+
*
|
| 11 |
+
* @example
|
| 12 |
+
* const numbers = [1, 2, 3, 4, 5];
|
| 13 |
+
* sortedLastIndexOf(numbers, 3); // Return value: 2
|
| 14 |
+
* sortedLastIndexOf(numbers, 6); // Return value: -1
|
| 15 |
+
*
|
| 16 |
+
* // If the value is duplicated, it returns the last index of the value.
|
| 17 |
+
* const duplicateNumbers = [1, 2, 2, 3, 3, 3, 4];
|
| 18 |
+
* sortedLastIndexOf(duplicateNumbers, 3); // Return value: 5
|
| 19 |
+
*
|
| 20 |
+
* // If the array is unsorted, it can return the wrong index.
|
| 21 |
+
* const unSortedArray = [55, 33, 22, 11, 44];
|
| 22 |
+
* sortedLastIndexOf(unSortedArray, 11); // Return value: -1
|
| 23 |
+
*
|
| 24 |
+
* // -0 and 0 are treated the same
|
| 25 |
+
* const mixedZeroArray = [-0, 0];
|
| 26 |
+
* sortedLastIndexOf(mixedZeroArray, 0); // Return value: 1
|
| 27 |
+
* sortedLastIndexOf(mixedZeroArray, -0); // Return value: 1
|
| 28 |
+
*
|
| 29 |
+
* // It works with array-like objects
|
| 30 |
+
* const arrayLike = { length: 3, 0: 10, 1: 20, 2: 20 };
|
| 31 |
+
* sortedLastIndexOf(arrayLike, 20); // Return value: 2
|
| 32 |
+
*/
|
| 33 |
+
declare function sortedLastIndexOf<T>(array: ArrayLike<T> | null | undefined, value: T): number;
|
| 34 |
+
|
| 35 |
+
export { sortedLastIndexOf };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexOf.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Finds the index of the last occurrence of a value in a sorted array.
|
| 3 |
+
* This function is similar to `Array#lastIndexOf` but is specifically designed for sorted arrays.
|
| 4 |
+
*
|
| 5 |
+
* Make sure to provide a sorted array to this function, as it uses a binary search to quickly find the index.
|
| 6 |
+
*
|
| 7 |
+
* @param {ArrayLike<T> | null | undefined} array The sorted array to inspect.
|
| 8 |
+
* @param {T} value The value to search for.
|
| 9 |
+
* @returns {number} Returns the index of the last matched value, else -1.
|
| 10 |
+
*
|
| 11 |
+
* @example
|
| 12 |
+
* const numbers = [1, 2, 3, 4, 5];
|
| 13 |
+
* sortedLastIndexOf(numbers, 3); // Return value: 2
|
| 14 |
+
* sortedLastIndexOf(numbers, 6); // Return value: -1
|
| 15 |
+
*
|
| 16 |
+
* // If the value is duplicated, it returns the last index of the value.
|
| 17 |
+
* const duplicateNumbers = [1, 2, 2, 3, 3, 3, 4];
|
| 18 |
+
* sortedLastIndexOf(duplicateNumbers, 3); // Return value: 5
|
| 19 |
+
*
|
| 20 |
+
* // If the array is unsorted, it can return the wrong index.
|
| 21 |
+
* const unSortedArray = [55, 33, 22, 11, 44];
|
| 22 |
+
* sortedLastIndexOf(unSortedArray, 11); // Return value: -1
|
| 23 |
+
*
|
| 24 |
+
* // -0 and 0 are treated the same
|
| 25 |
+
* const mixedZeroArray = [-0, 0];
|
| 26 |
+
* sortedLastIndexOf(mixedZeroArray, 0); // Return value: 1
|
| 27 |
+
* sortedLastIndexOf(mixedZeroArray, -0); // Return value: 1
|
| 28 |
+
*
|
| 29 |
+
* // It works with array-like objects
|
| 30 |
+
* const arrayLike = { length: 3, 0: 10, 1: 20, 2: 20 };
|
| 31 |
+
* sortedLastIndexOf(arrayLike, 20); // Return value: 2
|
| 32 |
+
*/
|
| 33 |
+
declare function sortedLastIndexOf<T>(array: ArrayLike<T> | null | undefined, value: T): number;
|
| 34 |
+
|
| 35 |
+
export { sortedLastIndexOf };
|
novas/novacore-zephyr/groq-code-cli/node_modules/es-toolkit/dist/compat/array/sortedLastIndexOf.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
| 4 |
+
|
| 5 |
+
const sortedLastIndex = require('./sortedLastIndex.js');
|
| 6 |
+
const eq = require('../util/eq.js');
|
| 7 |
+
|
| 8 |
+
function sortedLastIndexOf(array, value) {
|
| 9 |
+
if (!array?.length) {
|
| 10 |
+
return -1;
|
| 11 |
+
}
|
| 12 |
+
const index = sortedLastIndex.sortedLastIndex(array, value) - 1;
|
| 13 |
+
if (index >= 0 && eq.eq(array[index], value)) {
|
| 14 |
+
return index;
|
| 15 |
+
}
|
| 16 |
+
return -1;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
exports.sortedLastIndexOf = sortedLastIndexOf;
|