@poppinss/utils 7.0.0-next.5 → 7.0.0-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +23 -2
- package/build/lodash/main.cjs +43 -34
- package/build/src/detect_ai_agent.d.ts +18 -0
- package/build/src/imports_bag.d.ts +1 -0
- package/lodash/lodash.types.d.ts +59 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -95,7 +95,9 @@ Lodash is quite a big library, and we do not use all its helper methods. Therefo
|
|
|
95
95
|
> **Why not use something else**: All other helpers I have used are not as accurate or well implemented as lodash.
|
|
96
96
|
|
|
97
97
|
- pick
|
|
98
|
+
- pickBy
|
|
98
99
|
- omit
|
|
100
|
+
- omitBy
|
|
99
101
|
- has
|
|
100
102
|
- get
|
|
101
103
|
- set
|
|
@@ -627,6 +629,52 @@ const rawValue = secret.release()
|
|
|
627
629
|
rawValue === opaque_raw_token // true
|
|
628
630
|
```
|
|
629
631
|
|
|
632
|
+
## AI Agent Detection
|
|
633
|
+
|
|
634
|
+
Detect if your code is running inside an AI coding assistant. This is useful for adjusting application behavior when running under AI agents (e.g., disabling prompts, adjusting logging, or enabling special debugging modes).
|
|
635
|
+
|
|
636
|
+
### detectAIAgent
|
|
637
|
+
|
|
638
|
+
Returns the name of the detected AI agent or `null` if none is detected.
|
|
639
|
+
|
|
640
|
+
```ts
|
|
641
|
+
import { detectAIAgent } from '@poppinss/utils'
|
|
642
|
+
|
|
643
|
+
const agent = detectAIAgent()
|
|
644
|
+
|
|
645
|
+
if (agent === 'claude') {
|
|
646
|
+
console.log('Running in Claude Code')
|
|
647
|
+
} else if (agent === 'copilot') {
|
|
648
|
+
console.log('Running in GitHub Copilot')
|
|
649
|
+
}
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
**Supported agents:**
|
|
653
|
+
|
|
654
|
+
| Agent | Environment Variable(s) | Return Value |
|
|
655
|
+
| --------------- | ------------------------------------------------------------ | ------------ |
|
|
656
|
+
| Claude Code | `CLAUDECODE='1'` | `'claude'` |
|
|
657
|
+
| Gemini | `GEMINI_CLI='1'` | `'gemini'` |
|
|
658
|
+
| GitHub Copilot | `GITHUB_COPILOT_CLI_MODE='1'` | `'copilot'` |
|
|
659
|
+
| Windsurf | `WINDSURF_SESSION='1'` or `TERM_PROGRAM='windsurf'` | `'windsurf'` |
|
|
660
|
+
| Codex | `CODEX_CLI='1'` or `CODEX_SANDBOX='1'` | `'codex'` |
|
|
661
|
+
| OpenCode | `OPENCODE='1'` | `'opencode'` |
|
|
662
|
+
| Cursor | `CURSOR_AGENT='1'` | `'cursor'` |
|
|
663
|
+
|
|
664
|
+
### isRunningInAIAgent
|
|
665
|
+
|
|
666
|
+
Returns `true` if the code is running inside any AI coding agent.
|
|
667
|
+
|
|
668
|
+
```ts
|
|
669
|
+
import { isRunningInAIAgent } from '@poppinss/utils'
|
|
670
|
+
|
|
671
|
+
if (isRunningInAIAgent()) {
|
|
672
|
+
// Disable interactive prompts
|
|
673
|
+
// Enable verbose logging
|
|
674
|
+
// Skip waiting for user input
|
|
675
|
+
}
|
|
676
|
+
```
|
|
677
|
+
|
|
630
678
|
## ImportsBag
|
|
631
679
|
|
|
632
680
|
The `ImportsBag` class helps you manage and deduplicate import statements when generating code. It automatically merges imports from the same source and generates properly formatted import statements.
|
package/build/index.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export { importDefault } from './src/import_default.js';
|
|
|
8
8
|
export { MessageBuilder } from './src/message_builder.js';
|
|
9
9
|
export { ImportsBag, type ImportInfo } from './src/imports_bag.js';
|
|
10
10
|
export { defineStaticProperty } from './src/define_static_property.js';
|
|
11
|
+
export { detectAIAgent, isRunningInAIAgent } from './src/detect_ai_agent.js';
|
package/build/index.js
CHANGED
|
@@ -95,13 +95,19 @@ var ImportsBag = class {
|
|
|
95
95
|
if (imp.namedImports && imp.namedImports.length > 0) importParts.push(`{ ${imp.namedImports.join(", ")} }`);
|
|
96
96
|
parts.push(`import ${importParts.join(", ")} from '${imp.source}'`);
|
|
97
97
|
}
|
|
98
|
-
if (imp.typeImports && imp.typeImports.length > 0)
|
|
98
|
+
if (imp.defaultTypeImport || imp.typeImports && imp.typeImports.length > 0) {
|
|
99
|
+
const typeImportParts = [];
|
|
100
|
+
if (imp.defaultTypeImport) typeImportParts.push(imp.defaultTypeImport);
|
|
101
|
+
if (imp.typeImports && imp.typeImports.length > 0) typeImportParts.push(`{ ${imp.typeImports.join(", ")} }`);
|
|
102
|
+
parts.push(`import type ${typeImportParts.join(", ")} from '${imp.source}'`);
|
|
103
|
+
}
|
|
99
104
|
return parts.join("\n");
|
|
100
105
|
}
|
|
101
106
|
add(importInfo) {
|
|
102
107
|
const existing = this.#imports.get(importInfo.source);
|
|
103
108
|
if (existing) {
|
|
104
109
|
if (importInfo.defaultImport) existing.defaultImport = importInfo.defaultImport;
|
|
110
|
+
if (importInfo.defaultTypeImport) existing.defaultTypeImport = importInfo.defaultTypeImport;
|
|
105
111
|
if (importInfo.namedImports) {
|
|
106
112
|
if (!existing.namedImports) existing.namedImports = [];
|
|
107
113
|
existing.namedImports.push(...importInfo.namedImports);
|
|
@@ -113,6 +119,7 @@ var ImportsBag = class {
|
|
|
113
119
|
} else this.#imports.set(importInfo.source, {
|
|
114
120
|
source: importInfo.source,
|
|
115
121
|
defaultImport: importInfo.defaultImport,
|
|
122
|
+
defaultTypeImport: importInfo.defaultTypeImport,
|
|
116
123
|
namedImports: importInfo.namedImports ? [...importInfo.namedImports] : void 0,
|
|
117
124
|
typeImports: importInfo.typeImports ? [...importInfo.typeImports] : void 0
|
|
118
125
|
});
|
|
@@ -122,6 +129,7 @@ var ImportsBag = class {
|
|
|
122
129
|
return Array.from(this.#imports.values()).map((imp) => ({
|
|
123
130
|
source: imp.source,
|
|
124
131
|
defaultImport: imp.defaultImport,
|
|
132
|
+
defaultTypeImport: imp.defaultTypeImport,
|
|
125
133
|
namedImports: imp.namedImports ? [...new Set(imp.namedImports)] : void 0,
|
|
126
134
|
typeImports: imp.typeImports ? [...new Set(imp.typeImports)] : void 0
|
|
127
135
|
}));
|
|
@@ -151,4 +159,17 @@ function defineStaticProperty(self, propertyName, { initialValue, strategy }) {
|
|
|
151
159
|
});
|
|
152
160
|
}
|
|
153
161
|
}
|
|
154
|
-
|
|
162
|
+
function detectAIAgent() {
|
|
163
|
+
if (process.env.CLAUDECODE === "1") return "claude";
|
|
164
|
+
if (process.env.GEMINI_CLI === "1") return "gemini";
|
|
165
|
+
if (process.env.GITHUB_COPILOT_CLI_MODE === "1") return "copilot";
|
|
166
|
+
if (process.env.WINDSURF_SESSION === "1" || process.env.TERM_PROGRAM === "windsurf") return "windsurf";
|
|
167
|
+
if (process.env.CODEX_CLI === "1" || process.env.CODEX_SANDBOX === "1") return "codex";
|
|
168
|
+
if (process.env.OPENCODE === "1") return "opencode";
|
|
169
|
+
if (process.env.CURSOR_AGENT === "1") return "cursor";
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
function isRunningInAIAgent() {
|
|
173
|
+
return detectAIAgent() !== null;
|
|
174
|
+
}
|
|
175
|
+
export { ImportsBag, MessageBuilder, Secret, compose, defineStaticProperty, detectAIAgent, flatten, importDefault, isRunningInAIAgent, isScriptFile, naturalSort, safeEqual };
|
package/build/lodash/main.cjs
CHANGED
|
@@ -1,39 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
|
4
|
-
* Build: `lodash include="pick,omit,has,get,set,unset,mergeWith,merge,size,clone,cloneWith,cloneDeep,cloneDeepWith,toPath" --production`
|
|
4
|
+
* Build: `lodash include="pick,pickBy,omit,omitBy,has,get,set,unset,mergeWith,merge,size,clone,cloneWith,cloneDeep,cloneDeepWith,toPath" --production`
|
|
5
5
|
*/
|
|
6
6
|
;(function(){function t(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function e(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&false!==e(t[n],n,t););}function n(t,e){for(var n=-1,r=null==t?0:t.length,u=0,o=[];++n<r;){var c=t[n];e(c,n,t)&&(o[u++]=c)}return o}function r(t,e){for(var n=-1,r=null==t?0:t.length,u=Array(r);++n<r;)u[n]=e(t[n],n,t);return u}function u(t,e){for(var n=-1,r=e.length,u=t.length;++n<r;)t[u+n]=e[n];
|
|
7
|
-
return t}function o(t){return function(
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return o
|
|
12
|
-
}function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return function(e){return null
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
7
|
+
return t}function o(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return true;return false}function c(t){return function(e){return null==e?Zt:e[t]}}function i(t){return function(e){return t(e)}}function f(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function a(t){var e=Object;return function(n){return t(e(n))}}function l(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function s(){}function b(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){
|
|
8
|
+
var r=t[e];this.set(r[0],r[1])}}function h(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function p(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function y(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new p;++e<n;)this.add(t[e])}function j(t){this.size=(this.__data__=new h(t)).size}function _(t,e){var n=An(t),r=!n&&vn(t),u=!n&&!r&&wn(t),o=!n&&!r&&!u&&Sn(t);if(n=n||r||u||o){for(var r=t.length,c=String,i=-1,f=Array(r);++i<r;)f[i]=c(i);
|
|
9
|
+
r=f}else r=[];var a,c=r.length;for(a in t)!e&&!Fe.call(t,a)||n&&("length"==a||u&&("offset"==a||"parent"==a)||o&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||gt(a,c))||r.push(a);return r}function d(t,e,n){(n===Zt||Ft(t[e],n))&&(n!==Zt||e in t)||m(t,e,n)}function g(t,e,n){var r=t[e];Fe.call(t,e)&&Ft(r,n)&&(n!==Zt||e in t)||m(t,e,n)}function v(t,e){for(var n=t.length;n--;)if(Ft(t[n][0],e))return n;return-1}function A(t,e){return t&&tt(e,Nt(e),t)}function w(t,e){return t&&tt(e,Gt(e),t)}function m(t,e,n){
|
|
10
|
+
"__proto__"==e&&Ge?Ge(t,e,{configurable:true,enumerable:true,value:n,writable:true}):t[e]=n}function O(t,n,r,u,o,c){var i,f=1&n,a=2&n,l=4&n;if(r&&(i=o?r(t,u,o,c):r(t)),i!==Zt)return i;if(!Ut(t))return t;if(u=An(t)){if(i=yt(t),!f)return Z(t,i)}else{var s=_n(t),b="[object Function]"==s||"[object GeneratorFunction]"==s;if(wn(t))return Q(t,f);if("[object Object]"==s||"[object Arguments]"==s||b&&!o){if(i=a||b?{}:jt(t),!f)return a?nt(t,w(i,t)):et(t,A(i,t))}else{if(!he[s])return o?t:{};i=_t(t,s,f)}}if(c||(c=new j),
|
|
11
|
+
o=c.get(t))return o;if(c.set(t,i),On(t))return t.forEach(function(e){i.add(O(e,n,r,e,t,c))}),i;if(mn(t))return t.forEach(function(e,u){i.set(u,O(e,n,r,u,t,c))}),i;var a=l?a?at:ft:a?Gt:Nt,h=u?Zt:a(t);return e(h||t,function(e,u){h&&(u=e,e=t[u]),g(i,u,O(e,n,r,u,t,c))}),i}function S(t,e,n,r,o){var c=-1,i=t.length;for(n||(n=dt),o||(o=[]);++c<i;){var f=t[c];0<e&&n(f)?1<e?S(f,e-1,n,r,o):u(o,f):r||(o[o.length]=f)}return o}function k(t,e){e=K(e,t);for(var n=0,r=e.length;null!=t&&n<r;)t=t[Ot(e[n++])];return n&&n==r?t:Zt;
|
|
12
|
+
}function z(t,e,n){return e=e(t),An(t)?e:u(e,n(t))}function x(t){if(null==t)t=t===Zt?"[object Undefined]":"[object Null]";else if(Ne&&Ne in Object(t)){var e=Fe.call(t,Ne),n=t[Ne];try{t[Ne]=Zt;var r=true}catch(t){}var u=Me.call(t);r&&(e?t[Ne]=n:delete t[Ne]),t=u}else t=Me.call(t);return t}function E(t,e){return null!=t&&Fe.call(t,e)}function F(t,e){return null!=t&&e in Object(t)}function I(t){return Pt(t)&&"[object Arguments]"==x(t)}function M(t,e,n,r,u){if(t===e)e=true;else if(null==t||null==e||!Pt(t)&&!Pt(e))e=t!==t&&e!==e;else t:{
|
|
13
|
+
var o=An(t),c=An(e),i=o?"[object Array]":_n(t),f=c?"[object Array]":_n(e),i="[object Arguments]"==i?"[object Object]":i,f="[object Arguments]"==f?"[object Object]":f,a="[object Object]"==i,c="[object Object]"==f;if((f=i==f)&&wn(t)){if(!wn(e)){e=false;break t}o=true,a=false}if(f&&!a)u||(u=new j),e=o||Sn(t)?ot(t,e,n,r,M,u):ct(t,e,i,n,r,M,u);else{if(!(1&n)&&(o=a&&Fe.call(t,"__wrapped__"),i=c&&Fe.call(e,"__wrapped__"),o||i)){t=o?t.value():t,e=i?e.value():e,u||(u=new j),e=M(t,e,n,r,u);break t}if(f)e:if(u||(u=new j),
|
|
14
|
+
o=1&n,i=ft(t),c=i.length,f=ft(e).length,c==f||o){for(a=c;a--;){var l=i[a];if(!(o?l in e:Fe.call(e,l))){e=false;break e}}if((f=u.get(t))&&u.get(e))e=f==e;else{f=true,u.set(t,e),u.set(e,t);for(var s=o;++a<c;){var l=i[a],b=t[l],h=e[l];if(r)var p=o?r(h,b,l,e,t,u):r(b,h,l,t,e,u);if(p===Zt?b!==h&&!M(b,h,n,r,u):!p){f=false;break}s||(s="constructor"==l)}f&&!s&&(n=t.constructor,r=e.constructor,n!=r&&"constructor"in t&&"constructor"in e&&!(typeof n=="function"&&n instanceof n&&typeof r=="function"&&r instanceof r)&&(f=false)),
|
|
15
|
+
u.delete(t),u.delete(e),e=f}}else e=false;else e=false}}return e}function B(t){return Pt(t)&&"[object Map]"==_n(t)}function D(t,e){var n=e.length,r=n;if(null==t)return!r;for(t=Object(t);n--;){var u=e[n];if(u[2]?u[1]!==t[u[0]]:!(u[0]in t))return false}for(;++n<r;){var u=e[n],o=u[0],c=t[o],i=u[1];if(u[2]){if(c===Zt&&!(o in t))return false}else if(u=new j,void 0===Zt?!M(i,c,3,void 0,u):1)return false}return true}function U(t){return Pt(t)&&"[object Set]"==_n(t)}function P(t){return Pt(t)&&Dt(t.length)&&!!be[x(t)]}function L(t){
|
|
16
|
+
return typeof t=="function"?t:null==t?Jt:typeof t=="object"?An(t)?C(t[0],t[1]):R(t):Qt(t)}function $(t){if(!At(t))return Je(t);var e,n=[];for(e in Object(t))Fe.call(t,e)&&"constructor"!=e&&n.push(e);return n}function R(t){var e=bt(t);return 1==e.length&&e[0][2]?wt(e[0][0],e[0][1]):function(n){return n===t||D(n,e)}}function C(t,e){return vt(t)&&e===e&&!Ut(e)?wt(Ot(t),e):function(n){var r=Vt(n,t);return r===Zt&&r===e?Wt(n,t):M(e,r,3)}}function T(t,e,n,r,u){t!==e&&hn(e,function(o,c){if(Ut(o)){u||(u=new j);
|
|
17
|
+
var i=u,f="__proto__"==c?Zt:t[c],a="__proto__"==c?Zt:e[c],l=i.get(a);if(l)d(t,c,l);else{var l=r?r(f,a,c+"",t,e,i):Zt,s=l===Zt;if(s){var b=An(a),h=!b&&wn(a),p=!b&&!h&&Sn(a),l=a;b||h||p?An(f)?l=f:Mt(f)?l=Z(f):h?(s=false,l=Q(a,true)):p?(s=false,l=Y(a,true)):l=[]:Lt(a)||vn(a)?(l=f,vn(f)?l=Ct(f):(!Ut(f)||n&&Bt(f))&&(l=jt(a))):s=false}s&&(i.set(a,l),T(l,a,n,r,i),i.delete(a)),d(t,c,l)}}else i=r?r("__proto__"==c?Zt:t[c],o,c+"",t,e,u):Zt,i===Zt&&(i=o),d(t,c,i)},Gt)}function V(t,e){return W(t,e,function(e,n){return Wt(t,n);
|
|
18
|
+
})}function W(t,e,n){for(var r=-1,u=e.length,o={};++r<u;){var c=e[r],i=k(t,c);n(i,c)&&q(o,K(c,t),i)}return o}function N(t){return function(e){return k(e,t)}}function G(t){return dn(mt(t,void 0,Jt),t+"")}function q(t,e,n){if(!Ut(t))return t;e=K(e,t);for(var r=-1,u=e.length,o=u-1,c=t;null!=c&&++r<u;){var i=Ot(e[r]),f=n;if(r!=o){var a=c[i],f=Zt;f===Zt&&(f=Ut(a)?a:gt(e[r+1])?[]:{})}g(c,i,f),c=c[i]}return t}function H(t){if(typeof t=="string")return t;if(An(t))return r(t,H)+"";if(Rt(t))return sn?sn.call(t):"";
|
|
19
|
+
var e=t+"";return"0"==e&&1/t==-te?"-0":e}function J(t,e){e=K(e,t);var n;if(2>e.length)n=t;else{n=e;var r=0,u=-1,o=-1,c=n.length;for(0>r&&(r=-r>c?0:c+r),u=u>c?c:u,0>u&&(u+=c),c=r>u?0:u-r>>>0,r>>>=0,u=Array(c);++o<c;)u[o]=n[o+r];n=k(t,u)}return t=n,null==t||delete t[Ot(zt(e))]}function K(t,e){return An(t)?t:vt(t,e)?[t]:gn(Tt(t))}function Q(t,e){if(e)return t.slice();var n=t.length,n=$e?$e(n):new t.constructor(n);return t.copy(n),n}function X(t){var e=new t.constructor(t.byteLength);return new Le(e).set(new Le(t)),
|
|
20
|
+
e}function Y(t,e){return new t.constructor(e?X(t.buffer):t.buffer,t.byteOffset,t.length)}function Z(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function tt(t,e,n){var r=!n;n||(n={});for(var u=-1,o=e.length;++u<o;){var c=e[u],i=Zt;i===Zt&&(i=t[c]),r?m(n,c,i):g(n,c,i)}return n}function et(t,e){return tt(t,yn(t),e)}function nt(t,e){return tt(t,jn(t),e)}function rt(t){return G(function(e,n){var r,u=-1,o=n.length,c=1<o?n[o-1]:Zt,i=2<o?n[2]:Zt,c=3<t.length&&typeof c=="function"?(o--,
|
|
21
|
+
c):Zt;if(r=i){r=n[0];var f=n[1];if(Ut(i)){var a=typeof f;r=!!("number"==a?It(i)&>(f,i.length):"string"==a&&f in i)&&Ft(i[f],r)}else r=false}for(r&&(c=3>o?Zt:c,o=1),e=Object(e);++u<o;)(i=n[u])&&t(e,i,u,c);return e})}function ut(t){return Lt(t)?Zt:t}function ot(t,e,n,r,u,c){var i=1&n,f=t.length,a=e.length;if(f!=a&&!(i&&a>f))return false;if((a=c.get(t))&&c.get(e))return a==e;var a=-1,l=true,s=2&n?new y:Zt;for(c.set(t,e),c.set(e,t);++a<f;){var b=t[a],h=e[a];if(r)var p=i?r(h,b,a,e,t,c):r(b,h,a,t,e,c);if(p!==Zt){
|
|
22
|
+
if(p)continue;l=false;break}if(s){if(!o(e,function(t,e){if(!s.has(e)&&(b===t||u(b,t,n,r,c)))return s.push(e)})){l=false;break}}else if(b!==h&&!u(b,h,n,r,c)){l=false;break}}return c.delete(t),c.delete(e),l}function ct(t,e,n,r,u,o,c){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)break;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":if(t.byteLength!=e.byteLength||!o(new Le(t),new Le(e)))break;return true;case"[object Boolean]":case"[object Date]":case"[object Number]":
|
|
23
|
+
return Ft(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var i=f;case"[object Set]":if(i||(i=l),t.size!=e.size&&!(1&r))break;return(n=c.get(t))?n==e:(r|=2,c.set(t,e),e=ot(i(t),i(e),r,u,o,c),c.delete(t),e);case"[object Symbol]":if(ln)return ln.call(t)==ln.call(e)}return false}function it(t){return dn(mt(t,Zt,kt),t+"")}function ft(t){return z(t,Nt,yn)}function at(t){return z(t,Gt,jn)}function lt(){var t=s.iteratee||Kt,t=t===Kt?L:t;
|
|
24
|
+
return arguments.length?t(arguments[0],arguments[1]):t}function st(t,e){var n=t.__data__,r=typeof e;return("string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e)?n[typeof e=="string"?"string":"hash"]:n.map}function bt(t){for(var e=Nt(t),n=e.length;n--;){var r=e[n],u=t[r];e[n]=[r,u,u===u&&!Ut(u)]}return e}function ht(t,e){var n=null==t?Zt:t[e];return(!Ut(n)||Ie&&Ie in n?0:(Bt(n)?De:ce).test(St(n)))?n:Zt}function pt(t,e,n){e=K(e,t);for(var r=-1,u=e.length,o=false;++r<u;){var c=Ot(e[r]);
|
|
25
|
+
if(!(o=null!=t&&n(t,c)))break;t=t[c]}return o||++r!=u?o:(u=null==t?0:t.length,!!u&&Dt(u)&>(c,u)&&(An(t)||vn(t)))}function yt(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Fe.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function jt(t){return typeof t.constructor!="function"||At(t)?{}:bn(Re(t))}function _t(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return X(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":
|
|
26
|
+
return e=n?X(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Y(t,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return e=new t.constructor(t.source,oe.exec(t)),
|
|
27
|
+
e.lastIndex=t.lastIndex,e;case"[object Set]":return new r;case"[object Symbol]":return ln?Object(ln.call(t)):{}}}function dt(t){return An(t)||vn(t)||!!(We&&t&&t[We])}function gt(t,e){var n=typeof t;return e=null==e?9007199254740991:e,!!e&&("number"==n||"symbol"!=n&&ie.test(t))&&-1<t&&0==t%1&&t<e}function vt(t,e){if(An(t))return false;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Rt(t))||(ne.test(t)||!ee.test(t)||null!=e&&t in Object(e))}function At(t){var e=t&&t.constructor;
|
|
28
|
+
return t===(typeof e=="function"&&e.prototype||ze)}function wt(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==Zt||t in Object(n)))}}function mt(e,n,r){return n=Ke(n===Zt?e.length-1:n,0),function(){for(var u=arguments,o=-1,c=Ke(u.length-n,0),i=Array(c);++o<c;)i[o]=u[n+o];for(o=-1,c=Array(n+1);++o<n;)c[o]=u[o];return c[n]=r(i),t(e,this,c)}}function Ot(t){if(typeof t=="string"||Rt(t))return t;var e=t+"";return"0"==e&&1/t==-te?"-0":e}function St(t){if(null!=t){try{return Ee.call(t)}catch(t){}
|
|
29
|
+
return t+""}return""}function kt(t){return(null==t?0:t.length)?S(t,1):[]}function zt(t){var e=null==t?0:t.length;return e?t[e-1]:Zt}function xt(t,e){function n(){var r=arguments,u=e?e.apply(this,r):r[0],o=n.cache;return o.has(u)?o.get(u):(r=t.apply(this,r),n.cache=o.set(u,r)||o,r)}if(typeof t!="function"||null!=e&&typeof e!="function")throw new TypeError("Expected a function");return n.cache=new(xt.Cache||p),n}function Et(t){if(typeof t!="function")throw new TypeError("Expected a function");return function(){
|
|
30
|
+
var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Ft(t,e){return t===e||t!==t&&e!==e}function It(t){return null!=t&&Dt(t.length)&&!Bt(t)}function Mt(t){return Pt(t)&&It(t)}function Bt(t){return!!Ut(t)&&(t=x(t),"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t)}function Dt(t){return typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t;
|
|
31
|
+
}function Ut(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&typeof t=="object"}function Lt(t){return!(!Pt(t)||"[object Object]"!=x(t))&&(t=Re(t),null===t||(t=Fe.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&Ee.call(t)==Be))}function $t(t){return typeof t=="string"||!An(t)&&Pt(t)&&"[object String]"==x(t)}function Rt(t){return typeof t=="symbol"||Pt(t)&&"[object Symbol]"==x(t)}function Ct(t){return tt(t,Gt(t))}function Tt(t){
|
|
32
|
+
return null==t?"":H(t)}function Vt(t,e,n){return t=null==t?Zt:k(t,e),t===Zt?n:t}function Wt(t,e){return null!=t&&pt(t,e,F)}function Nt(t){return It(t)?_(t):$(t)}function Gt(t){if(It(t))t=_(t,true);else if(Ut(t)){var e,n=At(t),r=[];for(e in t)("constructor"!=e||!n&&Fe.call(t,e))&&r.push(e);t=r}else{if(e=[],null!=t)for(n in Object(t))e.push(n);t=e}return t}function qt(t,e){if(null==t)return{};var n=r(at(t),function(t){return[t]});return e=lt(e),W(t,n,function(t,n){return e(t,n[0])})}function Ht(t){return function(){
|
|
33
|
+
return t}}function Jt(t){return t}function Kt(t){return L(typeof t=="function"?t:O(t,1))}function Qt(t){return vt(t)?c(Ot(t)):N(t)}function Xt(){return[]}function Yt(){return false}var Zt,te=1/0,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ue=/\\(\\)?/g,oe=/\w*$/,ce=/^\[object .+?Constructor\]$/,ie=/^(?:0|[1-9]\d*)$/,fe="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*",ae="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",le=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+ae+fe,"g"),se=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),be={};
|
|
34
|
+
be["[object Float32Array]"]=be["[object Float64Array]"]=be["[object Int8Array]"]=be["[object Int16Array]"]=be["[object Int32Array]"]=be["[object Uint8Array]"]=be["[object Uint8ClampedArray]"]=be["[object Uint16Array]"]=be["[object Uint32Array]"]=true,be["[object Arguments]"]=be["[object Array]"]=be["[object ArrayBuffer]"]=be["[object Boolean]"]=be["[object DataView]"]=be["[object Date]"]=be["[object Error]"]=be["[object Function]"]=be["[object Map]"]=be["[object Number]"]=be["[object Object]"]=be["[object RegExp]"]=be["[object Set]"]=be["[object String]"]=be["[object WeakMap]"]=false;
|
|
35
|
+
var he={};he["[object Arguments]"]=he["[object Array]"]=he["[object ArrayBuffer]"]=he["[object DataView]"]=he["[object Boolean]"]=he["[object Date]"]=he["[object Float32Array]"]=he["[object Float64Array]"]=he["[object Int8Array]"]=he["[object Int16Array]"]=he["[object Int32Array]"]=he["[object Map]"]=he["[object Number]"]=he["[object Object]"]=he["[object RegExp]"]=he["[object Set]"]=he["[object String]"]=he["[object Symbol]"]=he["[object Uint8Array]"]=he["[object Uint8ClampedArray]"]=he["[object Uint16Array]"]=he["[object Uint32Array]"]=true,
|
|
36
|
+
he["[object Error]"]=he["[object Function]"]=he["[object WeakMap]"]=false;var pe,ye=typeof global=="object"&&global&&global.Object===Object&&global,je=typeof self=="object"&&self&&self.Object===Object&&self,_e=ye||je||Function("return this")(),de=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ge=de&&typeof module=="object"&&module&&!module.nodeType&&module,ve=ge&&ge.exports===de,Ae=ve&&ye.process;t:{try{pe=Ae&&Ae.binding&&Ae.binding("util");break t}catch(t){}pe=void 0}var we=pe&&pe.isMap,me=pe&&pe.isSet,Oe=pe&&pe.isTypedArray,Se=c("length"),ke=Array.prototype,ze=Object.prototype,xe=_e["__core-js_shared__"],Ee=Function.prototype.toString,Fe=ze.hasOwnProperty,Ie=function(){
|
|
37
|
+
var t=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Me=ze.toString,Be=Ee.call(Object),De=RegExp("^"+Ee.call(Fe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=ve?_e.Buffer:Zt,Pe=_e.Symbol,Le=_e.Uint8Array,$e=Ue?Ue.a:Zt,Re=a(Object.getPrototypeOf),Ce=Object.create,Te=ze.propertyIsEnumerable,Ve=ke.splice,We=Pe?Pe.isConcatSpreadable:Zt,Ne=Pe?Pe.toStringTag:Zt,Ge=function(){try{var t=ht(Object,"defineProperty");
|
|
38
|
+
return t({},"",{}),t}catch(t){}}(),qe=Object.getOwnPropertySymbols,He=Ue?Ue.isBuffer:Zt,Je=a(Object.keys),Ke=Math.max,Qe=Date.now,Xe=ht(_e,"DataView"),Ye=ht(_e,"Map"),Ze=ht(_e,"Promise"),tn=ht(_e,"Set"),en=ht(_e,"WeakMap"),nn=ht(Object,"create"),rn=St(Xe),un=St(Ye),on=St(Ze),cn=St(tn),fn=St(en),an=Pe?Pe.prototype:Zt,ln=an?an.valueOf:Zt,sn=an?an.toString:Zt,bn=function(){function t(){}return function(e){return Ut(e)?Ce?Ce(e):(t.prototype=e,e=new t,t.prototype=Zt,e):{}}}();b.prototype.clear=function(){
|
|
39
|
+
this.__data__=nn?nn(null):{},this.size=0},b.prototype.delete=function(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t},b.prototype.get=function(t){var e=this.__data__;return nn?(t=e[t],"__lodash_hash_undefined__"===t?Zt:t):Fe.call(e,t)?e[t]:Zt},b.prototype.has=function(t){var e=this.__data__;return nn?e[t]!==Zt:Fe.call(e,t)},b.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nn&&e===Zt?"__lodash_hash_undefined__":e,this},h.prototype.clear=function(){
|
|
40
|
+
this.__data__=[],this.size=0},h.prototype.delete=function(t){var e=this.__data__;return t=v(e,t),!(0>t)&&(t==e.length-1?e.pop():Ve.call(e,t,1),--this.size,true)},h.prototype.get=function(t){var e=this.__data__;return t=v(e,t),0>t?Zt:e[t][1]},h.prototype.has=function(t){return-1<v(this.__data__,t)},h.prototype.set=function(t,e){var n=this.__data__,r=v(n,t);return 0>r?(++this.size,n.push([t,e])):n[r][1]=e,this},p.prototype.clear=function(){this.size=0,this.__data__={hash:new b,map:new(Ye||h),string:new b
|
|
41
|
+
}},p.prototype.delete=function(t){return t=st(this,t).delete(t),this.size-=t?1:0,t},p.prototype.get=function(t){return st(this,t).get(t)},p.prototype.has=function(t){return st(this,t).has(t)},p.prototype.set=function(t,e){var n=st(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},y.prototype.add=y.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},y.prototype.has=function(t){return this.__data__.has(t)},j.prototype.clear=function(){this.__data__=new h,
|
|
42
|
+
this.size=0},j.prototype.delete=function(t){var e=this.__data__;return t=e.delete(t),this.size=e.size,t},j.prototype.get=function(t){return this.__data__.get(t)},j.prototype.has=function(t){return this.__data__.has(t)},j.prototype.set=function(t,e){var n=this.__data__;if(n instanceof h){var r=n.__data__;if(!Ye||199>r.length)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new p(r)}return n.set(t,e),this.size=n.size,this};var hn=function(t){return function(e,n,r){var u=-1,o=Object(e);r=r(e);
|
|
43
|
+
for(var c=r.length;c--;){var i=r[t?c:++u];if(false===n(o[i],i,o))break}return e}}(),pn=Ge?function(t,e){return Ge(t,"toString",{configurable:true,enumerable:false,value:Ht(e),writable:true})}:Jt,yn=qe?function(t){return null==t?[]:(t=Object(t),n(qe(t),function(e){return Te.call(t,e)}))}:Xt,jn=qe?function(t){for(var e=[];t;)u(e,yn(t)),t=Re(t);return e}:Xt,_n=x;(Xe&&"[object DataView]"!=_n(new Xe(new ArrayBuffer(1)))||Ye&&"[object Map]"!=_n(new Ye)||Ze&&"[object Promise]"!=_n(Ze.resolve())||tn&&"[object Set]"!=_n(new tn)||en&&"[object WeakMap]"!=_n(new en))&&(_n=function(t){
|
|
44
|
+
var e=x(t);if(t=(t="[object Object]"==e?t.constructor:Zt)?St(t):"")switch(t){case rn:return"[object DataView]";case un:return"[object Map]";case on:return"[object Promise]";case cn:return"[object Set]";case fn:return"[object WeakMap]"}return e});var dn=function(t){var e=0,n=0;return function(){var r=Qe(),u=16-(r-n);if(n=r,0<u){if(800<=++e)return arguments[0]}else e=0;return t.apply(Zt,arguments)}}(pn),gn=function(t){t=xt(t,function(t){return 500===e.size&&e.clear(),t});var e=t.cache;return t}(function(t){
|
|
45
|
+
var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(re,function(t,n,r,u){e.push(r?u.replace(ue,"$1"):n||t)}),e});xt.Cache=p;var vn=I(function(){return arguments}())?I:function(t){return Pt(t)&&Fe.call(t,"callee")&&!Te.call(t,"callee")},An=Array.isArray,wn=He||Yt,mn=we?i(we):B,On=me?i(me):U,Sn=Oe?i(Oe):P,kn=rt(function(t,e,n){T(t,e,n)}),zn=rt(function(t,e,n,r){T(t,e,n,r)}),xn=it(function(t,e){var n={};if(null==t)return n;var u=false;e=r(e,function(e){return e=K(e,t),u||(u=1<e.length),e}),tt(t,at(t),n),
|
|
46
|
+
u&&(n=O(n,7,ut));for(var o=e.length;o--;)J(n,e[o]);return n}),En=it(function(t,e){return null==t?{}:V(t,e)});s.constant=Ht,s.flatten=kt,s.iteratee=Kt,s.keys=Nt,s.keysIn=Gt,s.memoize=xt,s.merge=kn,s.mergeWith=zn,s.negate=Et,s.omit=xn,s.omitBy=function(t,e){return qt(t,Et(lt(e)))},s.pick=En,s.pickBy=qt,s.property=Qt,s.set=function(t,e,n){return null==t?t:q(t,e,n)},s.toPath=function(t){return An(t)?r(t,Ot):Rt(t)?[t]:Z(gn(Tt(t)))},s.toPlainObject=Ct,s.unset=function(t,e){return null==t||J(t,e)},s.clone=function(t){
|
|
47
|
+
return O(t,4)},s.cloneDeep=function(t){return O(t,5)},s.cloneDeepWith=function(t,e){return e=typeof e=="function"?e:Zt,O(t,5,e)},s.cloneWith=function(t,e){return e=typeof e=="function"?e:Zt,O(t,4,e)},s.eq=Ft,s.get=Vt,s.has=function(t,e){return null!=t&&pt(t,e,E)},s.hasIn=Wt,s.identity=Jt,s.isArguments=vn,s.isArray=An,s.isArrayLike=It,s.isArrayLikeObject=Mt,s.isBuffer=wn,s.isFunction=Bt,s.isLength=Dt,s.isMap=mn,s.isObject=Ut,s.isObjectLike=Pt,s.isPlainObject=Lt,s.isSet=On,s.isString=$t,s.isSymbol=Rt,
|
|
48
|
+
s.isTypedArray=Sn,s.last=zt,s.stubArray=Xt,s.stubFalse=Yt,s.size=function(t){if(null==t)return 0;if(It(t)){if($t(t))if(se.test(t)){for(var e=le.lastIndex=0;le.test(t);)++e;t=e}else t=Se(t);else t=t.length;return t}return e=_n(t),"[object Map]"==e||"[object Set]"==e?t.size:$(t).length},s.toString=Tt,s.VERSION="4.17.5",typeof define=="function"&&typeof define.amd=="object"&&define.amd?(_e._=s, define(function(){return s})):ge?((ge.exports=s)._=s,de._=s):_e._=s}).call(this);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type AIAgent = 'claude' | 'cursor' | 'opencode' | 'gemini' | 'copilot' | 'windsurf' | 'codex';
|
|
2
|
+
/**
|
|
3
|
+
* Detects which AI coding agent the code is running under.
|
|
4
|
+
* Checks for environment variables set by different AI coding assistants:
|
|
5
|
+
* - CLAUDECODE='1' for Claude Code
|
|
6
|
+
* - GEMINI_CLI='1' for Gemini
|
|
7
|
+
* - GITHUB_COPILOT_CLI_MODE='1' for GitHub Copilot
|
|
8
|
+
* - WINDSURF_SESSION='1' or TERM_PROGRAM='windsurf' for Windsurf
|
|
9
|
+
* - CODEX_CLI='1' or CODEX_SANDBOX='1' for Codex
|
|
10
|
+
* - OPENCODE='1' for OpenCode
|
|
11
|
+
* - CURSOR_AGENT='1' for Cursor
|
|
12
|
+
*/
|
|
13
|
+
export declare function detectAIAgent(): AIAgent | null;
|
|
14
|
+
/**
|
|
15
|
+
* Returns true if the code is running within any AI coding agent.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isRunningInAIAgent(): boolean;
|
|
18
|
+
export {};
|
package/lodash/lodash.types.d.ts
CHANGED
|
@@ -7,8 +7,14 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
type PartialShallow<T> = {
|
|
11
|
+
[P in keyof T]?: T[P] extends object ? object : T[P]
|
|
12
|
+
}
|
|
10
13
|
type PropertyName = string | number | symbol
|
|
11
14
|
type PropertyNames = PropertyName | ReadonlyArray<PropertyName>
|
|
15
|
+
type ValueKeyIterateeTypeGuard<T, S extends T> = (value: T, key: string) => value is S
|
|
16
|
+
type IterateeShorthand<T> = PropertyName | [PropertyName, any] | PartialShallow<T>
|
|
17
|
+
type ValueKeyIteratee<T> = ((value: T, key: string) => NotVoid) | IterateeShorthand<T>
|
|
12
18
|
|
|
13
19
|
/**
|
|
14
20
|
* Instead of using lodash as a dependency (which is around 4MB), we create a
|
|
@@ -23,10 +29,61 @@ type PropertyNames = PropertyName | ReadonlyArray<PropertyName>
|
|
|
23
29
|
declare module '@poppinss/utils/lodash' {
|
|
24
30
|
type LodashMethods = {
|
|
25
31
|
pick: <T>(object: T | null | undefined, ...props: Array<PropertyNames>) => Partial<T>
|
|
32
|
+
pickBy<T, S extends T>(
|
|
33
|
+
object: Record<string, T> | null | undefined,
|
|
34
|
+
predicate: ValueKeyIterateeTypeGuard<T, S>
|
|
35
|
+
): Record<string, S>
|
|
36
|
+
/**
|
|
37
|
+
* @see _.pickBy
|
|
38
|
+
*/
|
|
39
|
+
pickBy<T, S extends T>(
|
|
40
|
+
object: Record<number, T> | null | undefined,
|
|
41
|
+
predicate: ValueKeyIterateeTypeGuard<T, S>
|
|
42
|
+
): Record<number, S>
|
|
43
|
+
/**
|
|
44
|
+
* @see _.pickBy
|
|
45
|
+
*/
|
|
46
|
+
pickBy<T>(
|
|
47
|
+
object: Record<string, T> | null | undefined,
|
|
48
|
+
predicate?: ValueKeyIteratee<T>
|
|
49
|
+
): Record<string, T>
|
|
50
|
+
/**
|
|
51
|
+
* @see _.pickBy
|
|
52
|
+
*/
|
|
53
|
+
pickBy<T>(
|
|
54
|
+
object: Record<number, T> | null | undefined,
|
|
55
|
+
predicate?: ValueKeyIteratee<T>
|
|
56
|
+
): Record<number, T>
|
|
57
|
+
/**
|
|
58
|
+
* @see _.pickBy
|
|
59
|
+
*/
|
|
60
|
+
pickBy<T extends object>(
|
|
61
|
+
object: T | null | undefined,
|
|
62
|
+
predicate?: ValueKeyIteratee<T[keyof T]>
|
|
63
|
+
): PartialObject<T>
|
|
64
|
+
|
|
26
65
|
omit: <T extends object>(
|
|
27
66
|
object: T | null | undefined,
|
|
28
67
|
...paths: Array<PropertyNames>
|
|
29
68
|
) => Partial<T>
|
|
69
|
+
omitBy<T>(
|
|
70
|
+
object: Record<string, T> | null | undefined,
|
|
71
|
+
predicate?: ValueKeyIteratee<T>
|
|
72
|
+
): Record<string, T>
|
|
73
|
+
/**
|
|
74
|
+
* @see _.omitBy
|
|
75
|
+
*/
|
|
76
|
+
omitBy<T>(
|
|
77
|
+
object: Record<number, T> | null | undefined,
|
|
78
|
+
predicate?: ValueKeyIteratee<T>
|
|
79
|
+
): Record<number, T>
|
|
80
|
+
/**
|
|
81
|
+
* @see _.omitBy
|
|
82
|
+
*/
|
|
83
|
+
omitBy<T extends object>(
|
|
84
|
+
object: T | null | undefined,
|
|
85
|
+
predicate: ValueKeyIteratee<T[keyof T]>
|
|
86
|
+
): PartialObject<T>
|
|
30
87
|
has: <T>(object: T, path: PropertyNames) => boolean
|
|
31
88
|
get: (object: any, path: PropertyNames, defaultValue?: any) => any
|
|
32
89
|
set: (object: any, path: PropertyNames, value: any) => any
|
|
@@ -40,7 +97,7 @@ declare module '@poppinss/utils/lodash' {
|
|
|
40
97
|
customizer: (
|
|
41
98
|
value: any,
|
|
42
99
|
key: number | string | undefined,
|
|
43
|
-
object:
|
|
100
|
+
object: T | undefined,
|
|
44
101
|
stack: any
|
|
45
102
|
) => T | undefined
|
|
46
103
|
) => T
|
|
@@ -50,7 +107,7 @@ declare module '@poppinss/utils/lodash' {
|
|
|
50
107
|
customizer: (
|
|
51
108
|
value: any,
|
|
52
109
|
key: number | string | undefined,
|
|
53
|
-
object:
|
|
110
|
+
object: T | undefined,
|
|
54
111
|
stack: any
|
|
55
112
|
) => T | undefined
|
|
56
113
|
) => T
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poppinss/utils",
|
|
3
|
-
"version": "7.0.0-next.
|
|
3
|
+
"version": "7.0.0-next.7",
|
|
4
4
|
"description": "Handy utilities for repetitive work",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"pretest": "npm run lint",
|
|
31
31
|
"test": "npm run build:lodash && npm run quick:test",
|
|
32
|
-
"build:lodash": "lodash include=\"pick,omit,has,get,set,unset,mergeWith,merge,size,clone,cloneWith,cloneDeep,cloneDeepWith,toPath\" --production && move-file ./lodash.custom.min.js build/lodash/main.cjs",
|
|
32
|
+
"build:lodash": "lodash include=\"pick,pickBy,omit,omitBy,has,get,set,unset,mergeWith,merge,size,clone,cloneWith,cloneDeep,cloneDeepWith,toPath\" --production && move-file ./lodash.custom.min.js build/lodash/main.cjs",
|
|
33
33
|
"lint": "eslint",
|
|
34
34
|
"format": "prettier --write .",
|
|
35
35
|
"typecheck": "tsc --noEmit",
|