docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Type Check & Test (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:25:58 +08:00
1 parent f954252a34
commit e311ca3275
35554 files changed
+6229626 -4

No files matched your search

@@ -0,0 +1,5 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>
@@ -0,0 +1,42 @@
{
"name": "glob-parent",
"version": "3.1.0",
"description": "Strips glob magic from a string to provide the parent directory path",
"main": "index.js",
"scripts": {
"test": "istanbul test node_modules/mocha/bin/_mocha",
"ci-test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls"
},
"repository": {
"type": "git",
"url": "https://github.com/es128/glob-parent"
},
"keywords": [
"glob",
"parent",
"strip",
"path",
"dirname",
"directory",
"base",
"wildcard"
],
"files": [
"index.js"
],
"author": "Elan Shanker (https://github.com/es128)",
"license": "ISC",
"bugs": {
"url": "https://github.com/es128/glob-parent/issues"
},
"homepage": "https://github.com/es128/glob-parent",
"dependencies": {
"is-glob": "^3.1.0",
"path-dirname": "^1.0.0"
},
"devDependencies": {
"coveralls": "^2.11.2",
"istanbul": "^0.3.5",
"mocha": "^2.1.0"
}
}
@@ -0,0 +1,5 @@
var assertClassBrand = require("./assertClassBrand.js");
function _classPrivateSetter(s, r, a, t) {
return r(assertClassBrand(s, a), t), t;
}
module.exports = _classPrivateSetter, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1 @@
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){retuLine truncated
@@ -0,0 +1,64 @@
import type { ErrorCode } from '../errors';
import type { Range } from '../nodes/Node';
import type { Scalar } from '../nodes/Scalar';
import type { BlockScalar, FlowScalar, SourceToken, Token } from './cst';
/**
* If `token` is a CST flow or block scalar, determine its string value and a few other attributes.
* Otherwise, return `null`.
*/
export declare function resolveAsScalar(token: FlowScalar | BlockScalar, strict?: boolean, onError?: (offset: number, code: ErrorCode, message: string) => void): {
value: string;
type: Scalar.Type | null;
comment: string;
range: Range;
};
export declare function resolveAsScalar(token: Token | null | undefined, strict?: boolean, onError?: (offset: number, code: ErrorCode, message: string) => void): {
value: string;
type: Scalar.Type | null;
comment: string;
range: Range;
} | null;
/**
* Create a new scalar token with `value`
*
* Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
* as this function does not support any schema operations and won't check for such conflicts.
*
* @param value The string representation of the value, which will have its content properly indented.
* @param context.end Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added.
* @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
* @param context.indent The indent level of the token.
* @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value.
* @param context.offset The offset position of the token.
* @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
*/
export declare function createScalarToken(value: string, context: {
end?: SourceToken[];
implicitKey?: boolean;
indent: number;
inFlow?: boolean;
offset?: number;
type?: Scalar.Type;
}): BlockScalar | FlowScalar;
/**
* Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have.
*
* Best efforts are made to retain any comments previously associated with the `token`,
* though all contents within a collection's `items` will be overwritten.
*
* Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
* as this function does not support any schema operations and won't check for such conflicts.
*
* @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key.
* @param value The string representation of the value, which will have its content properly indented.
* @param context.afterKey In most cases, values after a key should have an additional level of indentation.
* @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
* @param context.inFlow Being within a flow collection may affect the resolved type of the token's value.
* @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
*/
export declare function setScalarValue(token: Token, value: string, context?: {
afterKey?: boolean;
implicitKey?: boolean;
inFlow?: boolean;
type?: Scalar.Type;
}): void;
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,oBAAoB,CAAC,sQAA0D,CAAC;AACpG","sources":["packages/@react-aria/menu/intl/he-IL.json"],"sourcesContent":["{\n \"longPressMessage\": \"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט\"\n}\n"],"names":[],"version":3,"file":"he-IL.main.js.map"}
@@ -0,0 +1,731 @@
flf2a$ 7 7 14 0 16 0 8031 0
Author : MJP
Date : 2003/9/23 6:27:51
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
!#
#
#
#
#
#
##
"#
#
#
#
#
#
##
##
#
#
#
#
#
##
$#
#
#
#
#
#
##
%#
#
#
#
#
#
##
&#
#
#
#
#
#
##
'#
#
#
#
#
#
##
(#
#
#
#
#
#
##
)#
#
#
#
#
#
##
*#
#
#
#
#
#
##
+#
#
#
#
#
#
##
,#
#
#
#
#
#
##
-#
#
#
#
#
#
##
.#
#
#
#
#
#
##
/#
#
#
#
#
#
##
0#
#
#
#
#
#
##
1#
#
#
#
#
#
##
2#
#
#
#
#
#
##
3#
#
#
#
#
#
##
4#
#
#
#
#
#
##
5#
#
#
#
#
#
##
6#
#
#
#
#
#
##
7#
#
#
#
#
#
##
8#
#
#
#
#
#
##
9#
#
#
#
#
#
##
:#
#
#
#
#
#
##
;#
#
#
#
#
#
##
<#
#
#
#
#
#
##
=#
#
#
#
#
#
##
>#
#
#
#
#
#
##
?#
#
#
#
#
#
##
@#
#
#
#
#
#
##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
_ #
/||_ #
/`_) #
| `. #
| (_)) #
(.'-' #
) ##
c c #
(OO) #
,'.--.) #
/ //_|_\ #
| \___ #
'. ) #
`-.' ##
_ #
_||\ #
(_'\ #
.' | #
((_) | #
`-`.) #
( ##
#
wWw #
(O)_ #
.' __) #
( _) #
`.__) #
##
#
wWw #
(O)_ #
.' __) #
( _) #
)/ #
( ##
\/ #
(OO) #
,'.--.) #
/ /|_|_\ #
| \_.--. #
'. \) \ #
`-.(_.' ##
\\ // #
(o)(o) #
|| || #
|(__)| #
/.--.\ #
-' `- #
##
wW Ww #
(O)(O) #
(..) #
|| #
_||_ #
(_/\_) #
##
_ #
_||\ #
(_'\ #
( | #
(\_) | #
`-`.) #
( ##
_ #
(OO) .' ) #
||_/ .' #
| / #
||\ \ #
(/\)\ `. #
`._) ##
W W #
(O)(O) #
|| #
| \ #
| `. #
(.-.__) #
`-' ##
\\\ /// #
((O) (O)) #
| \ / | #
||\\//|| #
|| \/ || #
|| || #
(_/ \_) ##
\\\ /// #
((O)(O)) #
| \ || #
||\\|| #
|| \ | #
|| || #
(_/ \_) ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
)) #
(o0)-. #
| (_)) #
| .-' #
|( #
\) #
( ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \___.--.| #
'. `---\) \ #
`-...(_.' ##
)) #
(Oo)-. #
| (_)) #
| .' #
)|\\ #
(/ \) #
) ##
oo_ #
/ _)-< #
\__ `. #
`. | #
_| | #
,-' | #
(_..--' ##
(o)__(o) #
(__ __) #
( ) #
)( #
( ) #
)/ #
( ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \ / / #
/ \/ \ #
\ `--' / #
`-..-' ##
(O)) ((O) #
|| || #
|| /\ || #
||//\\|| #
/ / \ \ #
( / \ ) #
) ( ##
wW Ww #
(O)\ /(O) #
`. \/ .' #
\ / #
/ \ #
.' /\ `. #
(_.' `._) ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \/ / #
\o / #
_/ / #
(_.' ##
_oo #
>-(_ \ #
/ _/ #
/ / #
/ ( #
( `-. #
`--.._) ##
[#
#
#
#
#
#
##
\#
#
#
#
#
#
##
]#
#
#
#
#
#
##
^#
#
#
#
#
#
##
_#
#
#
#
#
#
##
`#
#
#
#
#
#
##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
_ #
/||_ #
/`_) #
| `. #
| (_)) #
(.'-' #
) ##
c c #
(OO) #
,'.--.) #
/ //_|_\ #
| \___ #
'. ) #
`-.' ##
_ #
_||\ #
(_'\ #
.' | #
((_) | #
`-`.) #
( ##
#
wWw #
(O)_ #
.' __) #
( _) #
`.__) #
##
#
wWw #
(O)_ #
.' __) #
( _) #
)/ #
( ##
\/ #
(OO) #
,'.--.) #
/ /|_|_\ #
| \_.--. #
'. \) \ #
`-.(_.' ##
\\ // #
(o)(o) #
|| || #
|(__)| #
/.--.\ #
-' `- #
##
wW Ww #
(O)(O) #
(..) #
|| #
_||_ #
(_/\_) #
##
_ #
_||\ #
(_'\ #
( | #
(\_) | #
`-`.) #
( ##
_ #
(OO) .' ) #
||_/ .' #
| / #
||\ \ #
(/\)\ `. #
`._) ##
W W #
(O)(O) #
|| #
| \ #
| `. #
(.-.__) #
`-' ##
\\\ /// #
((O) (O)) #
| \ / | #
||\\//|| #
|| \/ || #
|| || #
(_/ \_) ##
\\\ /// #
((O)(O)) #
| \ || #
||\\|| #
|| \ | #
|| || #
(_/ \_) ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
)) #
(o0)-. #
| (_)) #
| .-' #
|( #
\) #
( ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \___.--.| #
'. `---\) \ #
`-...(_.' ##
)) #
(Oo)-. #
| (_)) #
| .' #
)|\\ #
(/ \) #
) ##
oo_ #
/ _)-< #
\__ `. #
`. | #
_| | #
,-' | #
(_..--' ##
(o)__(o) #
(__ __) #
( ) #
)( #
( ) #
)/ #
( ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \ / / #
/ \/ \ #
\ `--' / #
`-..-' ##
(O)) ((O) #
|| || #
|| /\ || #
||//\\|| #
/ / \ \ #
( / \ ) #
) ( ##
wW Ww #
(O)\ /(O) #
`. \/ .' #
\ / #
/ \ #
.' /\ `. #
(_.' `._) ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \/ / #
\o / #
_/ / #
(_.' ##
_oo #
>-(_ \ #
/ _/ #
/ / #
/ ( #
( `-. #
`--.._) ##
{#
#
#
#
#
#
##
|#
#
#
#
#
#
##
}#
#
#
#
#
#
##
~#
#
#
#
#
#
##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
ß#
#
#
#
#
#
##
@@ -0,0 +1,127 @@
'use strict';
var defineProperties = require('define-properties');
var test = require('tape');
var callBind = require('call-bind');
var functionsHaveNames = require('functions-have-names')();
var forEach = require('for-each');
var debug = require('object-inspect');
var v = require('es-value-fixtures');
var hasSymbols = require('has-symbols/shams')();
var mockProperty = require('mock-property');
var index = require('../Iterator.zip');
var impl = require('../Iterator.zip/implementation');
var from = require('../Iterator.from/polyfill')();
var isEnumerable = Object.prototype.propertyIsEnumerable;
var testIterator = require('./helpers/testIterator');
module.exports = {
tests: function (zip, name, t) {
t['throws'](
function () { return new zip(); }, // eslint-disable-line new-cap
TypeError,
'`' + name + '` itself is not a constructor'
);
t['throws'](
function () { return new zip({}); }, // eslint-disable-line new-cap
TypeError,
'`' + name + '` itself is not a constructor, with an argument'
);
forEach(v.primitives.concat(v.objects), function (nonIterator) {
t['throws'](
function () { zip(nonIterator, []); },
TypeError,
debug(nonIterator) + ' is not an iterable Object'
);
});
t.test('actual iteration', { skip: !hasSymbols }, function (st) {
forEach(v.nonFunctions, function (nonFunction) {
if (nonFunction != null) {
var badIterable = {};
badIterable[Symbol.iterator] = nonFunction;
st['throws'](
function () { zip([[], badIterable, []]).next(); },
TypeError,
debug(badIterable) + ' is not a function'
);
}
});
forEach(v.strings, function (string) {
st['throws'](
function () { zip([string]); },
TypeError,
'non-objects are not considered iterable'
);
});
var arrayIt = zip([[1, 2, 3]]);
st.equal(typeof arrayIt.next, 'function', 'has a `next` function');
st.test('real iterators', { skip: !hasSymbols }, function (s2t) {
var iter = [1, 2][Symbol.iterator]();
testIterator(zip([iter, [3, 4]]), [[1, 3], [2, 4]], s2t, 'array iterator + array yields combined results');
s2t.end();
});
st.test('observability in a replaced String iterator', function (s2t) {
var originalStringIterator = String.prototype[Symbol.iterator];
var observedType;
s2t.teardown(mockProperty(String.prototype, Symbol.iterator, {
get: function () {
'use strict'; // eslint-disable-line strict, lines-around-directive
observedType = typeof this;
return originalStringIterator;
}
}));
zip([from('')]);
s2t.equal(observedType, 'string', 'string primitive -> primitive receiver in Symbol.iterator getter');
zip([from(Object(''))]);
s2t.equal(observedType, 'object', 'boxed string -> boxed string in Symbol.iterator getter');
s2t.end();
});
st.end();
});
},
index: function () {
test('Iterator.zip: index', function (t) {
module.exports.tests(index, 'Iterator.zip', t);
t.end();
});
},
implementation: function () {
test('Iterator.zip: implementation', function (t) {
module.exports.tests(impl, 'Iterator.zip', t);
t.end();
});
},
shimmed: function () {
test('Iterator.zip: shimmed', function (t) {
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(Iterator.zip.name, 'zip', 'Iterator.zip has name "zip"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Iterator, 'zip'), 'Iterator.zip is not enumerable');
et.end();
});
module.exports.tests(callBind(Iterator.zip, Iterator), 'Iterator.zip', t);
t.end();
});
}
};
@@ -0,0 +1,728 @@
export default `flf2a$ 7 5 12 -1 12
Tinker-toy by Wendell Hicken 11/93 (whicken@parasoft.com)
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be \`a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
7 - height of a character
5 - height of a character, not including descenders
5 - max line length (excluding comment lines) + a fudge factor
15 - default smushmode for this font (like "-m 15" on command line)
12 - number of comment lines
$@
$@
$@
$@
$@
$@
$@@
o @
| @
o @
@
O @
@
@@
o o @
| | @
@
@
@
@
@@
| | @
-O-O- @
| | @
-O-O- @
| | @
@
@@
| | @
-O-O- @
o | | @
-O-O- @
| | o @
-O-O- @
| | @@
o O @
/ @
/ @
/ @
O o @
@
@@
@
o @
/| @
o-O-@
| @
@
@@
o @
| @
@
@
@
@
@@
/ @
o @
| @
o @
\\ @
@
@@
\\ @
o @
| @
o @
/ @
@
@@
@
o | o @
\\|/ @
--O-- @
/|\\ @
o | o @
@@
@
| @
-o- @
| @
@
@
@@
@
@
@
@
o @
| @
@@
@
@
o-o @
@
@
@
@@
@
@
@
@
O @
@
@@
o@
/ @
o @
/ @
o @
@
@@
o-o @
o /o @
| / | @
o/ o @
o-o @
@
@@
0 @
/| @
o | @
| @
o-o-o @
@
@@
-- @
o o @
/ @
/ @
o--o @
@
@@
o-o @
| @
oo @
| @
o-o @
@
@@
o o @
| | @
o--O @
| @
o @
@
@@
o--o @
| @
o-o @
| @
o-o @
@
@@
o @
/ @
O--o @
o | @
o-o @
@
@@
o---o @
/ @
o @
| @
o @
@
@@
o-o @
| | @
o-o @
| | @
o-o @
@
@@
o-o @
| o @
o--O @
/ @
o @
@
@@
@
O @
@
O @
@
@
@@
@
o @
@
o @
| @
@
@@
o @
/ @
O @
\\ @
o @
@
@@
@
@
o--o @
o--o @
@
@
@@
o @
\\ @
O @
/ @
o @
@
@@
o-o @
o o @
/ @
o @
@
O @
@@
o @
/ \\ @
o O-o @
\\ @
o- @
@
@@
O @
/ \\ @
o---o@
| |@
o o@
@
@@
o--o @
| | @
O--o @
| | @
o--o @
@
@@
o-o @
/ @
O @
\\ @
o-o @
@
@@
o-o @
| \\ @
| O @
| / @
o-o @
@
@@
o--o @
| @
O-o @
| @
o--o @
@
@@
o--o @
| @
O-o @
| @
o @
@
@@
o-o @
o @
| -o @
o | @
o-o @
@
@@
o o @
| | @
O--O @
| | @
o o @
@
@@
o-O-o @
| @
| @
| @
o-O-o @
@
@@
o @
| @
| @
\\ o @
o-o @
@
@@
o o @
| / @
OO @
| \\ @
o o @
@
@@
o @
| @
| @
| @
O---o@
@
@@
o o @
|\\ /| @
| O | @
| | @
o o @
@
@@
o o @
|\\ | @
| \\ | @
| \\| @
o o @
@
@@
o-o @
o o @
| | @
o o @
o-o @
@
@@
o--o @
| | @
O--o @
| @
o @
@
@@
o-o @
o o @
| | @
o O @
o-O\\ @
@
@@
o--o @
| | @
O-Oo @
| \\ @
o o @
@
@@
o-o @
| @
o-o @
| @
o--o @
@
@@
o-O-o @
| @
| @
| @
o @
@
@@
o o @
| | @
| | @
| | @
o-o @
@
@@
o o @
| | @
o o @
\\ / @
o @
@
@@
o o @
| | @
o o o @
\\ / \\ / @
o o @
@
@@
o o @
\\ / @
O @
/ \\ @
o o @
@
@@
o o @
\\ / @
O @
| @
o @
@
@@
o---o @
/ @
-O- @
/ @
o---o @
@
@@
O-o @
| @
| @
| @
O-o @
@
@@
o @
\\ @
o @
\\ @
o@
@
@@
o-O @
| @
| @
| @
o-O @
@
@@
o @
/ \\ @
@
@
@
@
@@
@
@
@
@
@
o---o@
@@
0 @
| @
@
@
@
@
@@
@
@
oo @
| | @
o-o-@
@
@@
o @
| @
O-o @
| | @
o-o @
@
@@
@
@
o-o @
| @
o-o @
@
@@
o @
| @
o-O @
| | @
o-o @
@
@@
@
@
o-o @
|-' @
o-o @
@
@@
o-o@
| @
-O- @
| @
o @
@
@@
@
@
o--o @
| | @
o--O @
| @
o--o @@
o @
| @
O--o @
| | @
o o @
@
@@
@
o @
@
| @
| @
@
@@
@
o @
@
o @
| @
o o @
o-o @@
o @
| / @
OO @
| \\ @
o o @
@
@@
o @
| @
| @
| @
o @
@
@@
@
@
o-O-o @
| | | @
o o o @
@
@@
@
@
o-o @
| | @
o o @
@
@@
@
@
o-o @
| | @
o-o @
@
@@
@
@
o-o @
| | @
O-o @
| @
o @@
@
@
o-o @
| | @
o-O @
| @
o @@
@
@
o-o @
| @
o @
@
@@
@
@
o-o @
\\ @
o-o @
@
@@
o @
| @
-o- @
| @
o @
@
@@
@
@
o o @
| | @
o--o @
@
@@
@
@
o o @
\\ / @
o @
@
@@
@
@
o o o@
\\ / \\ / @
o o @
@
@@
@
@
\\ / @
o @
/ \\ @
@
@@
@
@
o o @
| | @
o--O @
| @
o--o @@
@
@
o-o @
/ @
o-o @
@
@@
o-o @
| @
o-O @
| @
o-o @
@
@@
o @
| @
o @
| @
o @
@
@@
o-o @
| @
O-o @
| @
o-o @
@
@@
@
o_ / @
/ o @
@
@
@
@@
o O o@
/ \\ @
o---o@
| |@
o o@
@
@@
o o-o o@
o o @
| | @
o o @
o-o @
@
@@
o o o o @
| | @
o o @
\\ / @
o-o @
@
@@
o o @
@
oo @
| | @
o-o-@
@
@@
o o @
@
o-o @
| | @
o-o @
@
@@
o o @
@
o o @
| | @
o--o @
@
@@
o--o @
| | @
O--o @
| | @
o--o @
| @
o @@
`
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateMaybeClassMetadataPreDestroy = updateMaybeClassMetadataPreDestroy;
const InversifyCoreError_1 = require("../../error/models/InversifyCoreError");
const InversifyCoreErrorKind_1 = require("../../error/models/InversifyCoreErrorKind");
function updateMaybeClassMetadataPreDestroy(methodName) {
return (metadata) => {
if (metadata.lifecycle.preDestroyMethodNames.has(methodName)) {
throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.injectionDecoratorConflict, `Unexpected duplicated preDestroy method ${methodName.toString()}`);
}
metadata.lifecycle.preDestroyMethodNames.add(methodName);
return metadata;
};
}
//# sourceMappingURL=updateMaybeClassMetadataPreDestroy.js.map
@@ -0,0 +1,413 @@
export default `flf2a$ 4 1 6 -1 3 0 8192 0
Font Name: tmplr
Font Author: Eugene Ghanizadeh Khoub
FIGFont created with: http://patorjk.com/figfont-editor
@
@
@
@@
╻@
┃@
•@
@@
╹╹@
@
@
@@
╋╋@
┃┃@
╋╋@
@@
┏┻┓@
┗━┓@
┗┳┛@
@@
•┏ @
┃ @
┛•@
@@
┏┓@
┣╋@
┗┻@
@@
╹@
@
@
@@
┏@
┃@
┗@
@@
┓@
┃@
┛@
@@
┓┏@
┛┗@
@
@@
╻ @
━╋━@
╹ @
@@
@
@
╻@
@@
@
━━@
@
@@
@
@
•@
@@
┏@
┃@
┛@
@@
┏┓@
┃┫@
┗┛@
@@
┓@
┃@
┻@
@@
┏┓@
┏┛@
┗━@
@@
┏┓@
┫@
┗┛@
@@
┏┓@
┃┃@
┗╋@
@@
┏━@
┗┓@
┗┛@
@@
┏┓@
┣┓@
┗┛@
@@
━┓@
┃@
╹@
@@
┏┓@
┣┫@
┗┛@
@@
┏┓@
┗┫@
┗┛@
@@
@
•@
•@
@@
@
•@
╻@
@@
┏@
━┫@
┗@
@@
━━@
━━@
━━@
@@
┓ @
┣━@
┛ @
@@
┏┓@
┏┛@
• @
@@
┏━┓@
┃┗┛@
┗━┛@
@@
┏┓@
┣┫@
┛┗@
@@
┳┓@
┣┫@
┻┛@
@@
┏┓@
┃ @
┗┛@
@@
┳┓@
┃┃@
┻┛@
@@
┏┓@
┣ @
┗┛@
@@
┏┓@
┣ @
┻ @
@@
┏┓@
┃┓@
┗┛@
@@
┓┏@
┣┫@
┛┗@
@@
┳@
┃@
┻@
@@
┏┳@
┃@
┗┛@
@@
┓┏┓@
┃┫ @
┛┗┛@
@@
┓ @
┃ @
┗┛@
@@
┳┳┓@
┃┃┃@
┛ ┗@
@@
┳┓@
┃┃@
┛┗@
@@
┏┓@
┃┃@
┗┛@
@@
┏┓@
┃┃@
┣┛@
@@
┏┓@
┃┃@
┗┻@
@@
┳┓@
┣┫@
┛┗@
@@
┏┓@
┗┓@
┗┛@
@@
┏┳┓@
┃ @
┻ @
@@
┳┳@
┃┃@
┗┛@
@@
┓┏@
┃┃@
┗┛@
@@
┓ ┏@
┃┃┃@
┗┻┛@
@@
┏┓┏┓@
┃┃ @
┗┛┗┛@
@@
┓┏@
┗┫@
┗┛@
@@
┏┓@
┏┛@
┗┛@
@@
┏━@
┃ @
┗━@
@@
╻ @
┗┓@
╹@
@@
━┓@
┃@
━┛@
@@
┏┓@
@
@
@@
@
@
━@
@@
┓@
@
@
@@
@
┏┓@
┗┻@
@@
┓ @
┣┓@
┗┛@
@@
@
┏@
┗@
@@
┓@
┏┫@
┗┻@
@@
@
┏┓@
┗ @
@@
┏@
╋@
┛@
@@
@
┏┓@
┗┫@
┛@@
┓ @
┣┓@
┛┗@
@@
•@
┓@
┗@
@@
•@
┓@
┃@
┛@@
┓ @
┃┏@
┛┗@
@@
┓@
┃@
┗@
@@
@
┏┳┓@
┛┗┗@
@@
@
┏┓@
┛┗@
@@
@
┏┓@
┗┛@
@@
@
┏┓@
┣┛@
┛ @@
@
┏┓@
┗┫@
┗@@
@
┏┓@
┛ @
@@
@
┏@
┛@
@@
@
╋@
┗@
@@
@
┓┏@
┗┻@
@@
@
┓┏@
┗┛@
@@
@
┓┏┏@
┗┻┛@
@@
@
┓┏@
┛┗@
@@
@
┓┏@
┗┫@
┛@@
@
┓@
┗@
@@
┏@
┫@
┗@
@@
╻@
┃@
╹@
@@
┓@
┣@
┛@
@@
@
┏━┛@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
••@
┏┓@
┗┻@
@@
••@
┏┓@
┗┛@
@@
••@
┓┏@
┗┻@
@@
┏┓@
┣┫@
┻┛@
@@
`
@@ -0,0 +1,15 @@
var isObject = require('./isObject');
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
module.exports = isStrictComparable;
@@ -0,0 +1,5 @@
import type { TSchema } from '../../type/schema/index.mjs';
/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */
export declare function Clean(schema: TSchema, references: TSchema[], value: unknown): unknown;
/** `[Mutable]` Removes excess properties from a value and returns the result. This function does not check the value and returns an unknown type. You should Check the result before use. Clean is a mutable operation. To avoid mutation, Clone the value first. */
export declare function Clean(schema: TSchema, value: unknown): unknown;
@@ -0,0 +1,170 @@
/**
* @file glyph
* @author junmer
*/
/* eslint-env node */
var _ = require('lodash');
var isTtf = require('is-ttf');
var through = require('through2');
var TTF = require('fonteditor-core').TTF;
var TTFReader = require('fonteditor-core').TTFReader;
var TTFWriter = require('fonteditor-core').TTFWriter;
var b2ab = require('b3b').b2ab;
var ab2b = require('b3b').ab2b;
var util = require('../lib/util');
/**
* getSubsetGlyfs
*
* @param {ttfObject} ttf ttfobj
* @param {Array} subset subset unicode
* @return {Array} glyfs array
*/
function getSubsetGlyfs(ttf, subset) {
var glyphs = [];
var indexList = ttf.findGlyf({
unicode: subset || []
});
if (indexList.length) {
glyphs = ttf.getGlyf(indexList);
}
glyphs.unshift(ttf.get().glyf[0]);
return glyphs;
}
/**
* minifyFontObject
*
* @param {Object} ttfObject ttfObject
* @param {Array} subset subset
* @param {Function=} plugin use plugin
* @return {Object} ttfObject
*/
function minifyFontObject(ttfObject, subset, plugin) {
// check null
if (subset.length === 0) {
return ttfObject;
}
// new TTF Object
var ttf = new TTF(ttfObject);
// get target glyfs then set
ttf.setGlyf(getSubsetGlyfs(ttf, subset));
// use plugin
if (_.isFunction(plugin)) {
plugin(ttf);
}
return ttf.get();
}
/**
* minifyTtf
*
* @param {Buffer|Object} contents contents
* @param {Object} opts opts
* @return {Buffer} buffer
*/
function minifyTtf(contents, opts) {
opts = opts || {};
var ttfobj = contents;
if (Buffer.isBuffer(contents)) {
ttfobj = new TTFReader(opts).read(b2ab(contents));
}
var miniObj = minifyFontObject(
ttfobj,
opts.subset,
opts.use
);
var ttfBuffer = ab2b(
new TTFWriter(opts).write(miniObj)
);
return {
object: miniObj,
buffer: ttfBuffer
};
}
/**
* glyph fontmin plugin
*
* @param {Object} opts opts
* @param {string=} opts.text text
* @param {boolean=} opts.basicText useBasicText
* @param {boolean=} opts.hinting hint
* @param {Function=} opts.use plugin
* @return {Object} stream.Transform instance
* @api public
*/
module.exports = function (opts) {
opts = _.extend({hinting: true, trim: true}, opts);
// prepare subset
var subsetText = util.getSubsetText(opts);
opts.subset = util.string2unicodes(subsetText);
return through.ctor({
objectMode: true
}, function (file, enc, cb) {
// check null
if (file.isNull()) {
cb(null, file);
return;
}
// check stream
if (file.isStream()) {
cb(new Error('Streaming is not supported'));
return;
}
// check ttf
if (!isTtf(file.contents)) {
cb(null, file);
return;
}
try {
// write file buffer
var miniTtf = minifyTtf(
file.ttfObject || file.contents,
opts
);
file.contents = miniTtf.buffer;
file.ttfObject = miniTtf.object;
cb(null, file);
}
catch (err) {
cb(err);
}
});
};
@@ -0,0 +1,521 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const scope_manager_1 = require("@typescript-eslint/scope-manager");
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const isTypeImport_1 = require("../util/isTypeImport");
const allowedFunctionVariableDefTypes = new Set([
utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration,
utils_1.AST_NODE_TYPES.TSFunctionType,
utils_1.AST_NODE_TYPES.TSMethodSignature,
utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
utils_1.AST_NODE_TYPES.TSDeclareFunction,
utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration,
utils_1.AST_NODE_TYPES.TSConstructorType,
]);
const functionsHoistedNodes = new Set([utils_1.AST_NODE_TYPES.FunctionDeclaration]);
const typesHoistedNodes = new Set([
utils_1.AST_NODE_TYPES.TSInterfaceDeclaration,
utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration,
]);
exports.default = (0, util_1.createRule)({
name: 'no-shadow',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow variable declarations from shadowing variables declared in the outer scope',
extendsBaseRule: true,
},
messages: {
noShadow: "'{{name}}' is already declared in the upper scope on line {{shadowedLine}} column {{shadowedColumn}}.",
noShadowGlobal: "'{{name}}' is already a global variable.",
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allow: {
type: 'array',
description: 'Identifier names for which shadowing is allowed.',
items: {
type: 'string',
},
},
builtinGlobals: {
type: 'boolean',
description: 'Whether to report shadowing of built-in global variables.',
},
hoist: {
type: 'string',
description: 'Whether to report shadowing before outer functions or variables are defined.',
enum: ['all', 'functions', 'functions-and-types', 'never', 'types'],
},
ignoreFunctionTypeParameterNameValueShadow: {
type: 'boolean',
description: 'Whether to ignore function parameters named the same as a variable.',
},
ignoreOnInitialization: {
type: 'boolean',
description: 'Whether to ignore the variable initializers when the shadowed variable is presumably still unitialized.',
},
ignoreTypeValueShadow: {
type: 'boolean',
description: 'Whether to ignore types named the same as a variable.',
},
},
},
],
},
defaultOptions: [
{
allow: [],
builtinGlobals: false,
hoist: 'functions-and-types',
ignoreFunctionTypeParameterNameValueShadow: true,
ignoreOnInitialization: false,
ignoreTypeValueShadow: true,
},
],
create(context, [options]) {
/**
* Check if a scope is a TypeScript module augmenting the global namespace.
*/
function isGlobalAugmentation(scope) {
return ((scope.type === scope_manager_1.ScopeType.tsModule && scope.block.kind === 'global') ||
(!!scope.upper && isGlobalAugmentation(scope.upper)));
}
/**
* Check if variable is a `this` parameter.
*/
function isThisParam(variable) {
return (variable.defs[0].type === scope_manager_1.DefinitionType.Parameter &&
variable.name === 'this');
}
function isTypeValueShadow(variable, shadowed) {
if (options.ignoreTypeValueShadow !== true) {
return false;
}
if (!('isValueVariable' in variable)) {
// this shouldn't happen...
return false;
}
const firstDefinition = shadowed.defs.at(0);
const isShadowedValue = !('isValueVariable' in shadowed) ||
!firstDefinition ||
(!(0, isTypeImport_1.isTypeImport)(firstDefinition) && shadowed.isValueVariable);
return variable.isValueVariable !== isShadowedValue;
}
function isFunctionTypeParameterNameValueShadow(variable, shadowed) {
if (options.ignoreFunctionTypeParameterNameValueShadow !== true) {
return false;
}
if (!('isValueVariable' in variable)) {
// this shouldn't happen...
return false;
}
const isShadowedValue = 'isValueVariable' in shadowed ? shadowed.isValueVariable : true;
if (!isShadowedValue) {
return false;
}
return variable.defs.every(def => allowedFunctionVariableDefTypes.has(def.node.type));
}
function isGenericOfStaticMethod(variable) {
if (!('isTypeVariable' in variable)) {
// this shouldn't happen...
return false;
}
if (!variable.isTypeVariable) {
return false;
}
if (variable.identifiers.length === 0) {
return false;
}
const typeParameter = variable.identifiers[0].parent;
if (typeParameter.type !== utils_1.AST_NODE_TYPES.TSTypeParameter) {
return false;
}
const typeParameterDecl = typeParameter.parent;
if (typeParameterDecl.type !== utils_1.AST_NODE_TYPES.TSTypeParameterDeclaration) {
return false;
}
const functionExpr = typeParameterDecl.parent;
if (functionExpr.type !== utils_1.AST_NODE_TYPES.FunctionExpression &&
functionExpr.type !== utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) {
return false;
}
const methodDefinition = functionExpr.parent;
if (methodDefinition.type !== utils_1.AST_NODE_TYPES.MethodDefinition) {
return false;
}
return methodDefinition.static;
}
function isGenericOfClass(variable) {
if (!('isTypeVariable' in variable)) {
// this shouldn't happen...
return false;
}
if (!variable.isTypeVariable) {
return false;
}
if (variable.identifiers.length === 0) {
return false;
}
const typeParameter = variable.identifiers[0].parent;
if (typeParameter.type !== utils_1.AST_NODE_TYPES.TSTypeParameter) {
return false;
}
const typeParameterDecl = typeParameter.parent;
if (typeParameterDecl.type !== utils_1.AST_NODE_TYPES.TSTypeParameterDeclaration) {
return false;
}
const classDecl = typeParameterDecl.parent;
return (classDecl.type === utils_1.AST_NODE_TYPES.ClassDeclaration ||
classDecl.type === utils_1.AST_NODE_TYPES.ClassExpression);
}
function isGenericOfAStaticMethodShadow(variable, shadowed) {
return isGenericOfStaticMethod(variable) && isGenericOfClass(shadowed);
}
function isImportDeclaration(definition) {
return definition.type === utils_1.AST_NODE_TYPES.ImportDeclaration;
}
function isExternalModuleDeclarationWithName(scope, name) {
return (scope.type === scope_manager_1.ScopeType.tsModule &&
scope.block.id.type === utils_1.AST_NODE_TYPES.Literal &&
scope.block.id.value === name);
}
function isExternalDeclarationMerging(scope, variable, shadowed) {
const [firstDefinition] = shadowed.defs;
const [secondDefinition] = variable.defs;
return ((0, isTypeImport_1.isTypeImport)(firstDefinition) &&
isImportDeclaration(firstDefinition.parent) &&
isExternalModuleDeclarationWithName(scope, firstDefinition.parent.source.value) &&
(secondDefinition.node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration ||
secondDefinition.node.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration));
}
/**
* Check if variable name is allowed.
* @param variable The variable to check.
* @returns Whether or not the variable name is allowed.
*/
function isAllowed(variable) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return options.allow.includes(variable.name);
}
/**
* Checks if a variable of the class name in the class scope of ClassDeclaration.
*
* ClassDeclaration creates two variables of its name into its outer scope and its class scope.
* So we should ignore the variable in the class scope.
* @param variable The variable to check.
* @returns Whether or not the variable of the class name in the class scope of ClassDeclaration.
*/
function isDuplicatedClassNameVariable(variable) {
const block = variable.scope.block;
return (block.type === utils_1.AST_NODE_TYPES.ClassDeclaration &&
block.id === variable.identifiers[0]);
}
/**
* Checks if a variable of the class name in the class scope of TSEnumDeclaration.
*
* TSEnumDeclaration creates two variables of its name into its outer scope and its class scope.
* So we should ignore the variable in the class scope.
* @param variable The variable to check.
* @returns Whether or not the variable of the class name in the class scope of TSEnumDeclaration.
*/
function isDuplicatedEnumNameVariable(variable) {
const block = variable.scope.block;
return (block.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration &&
block.id === variable.identifiers[0]);
}
/**
* Checks whether or not a given location is inside of the range of a given node.
* @param node An node to check.
* @param location A location to check.
* @returns `true` if the location is inside of the range of the node.
*/
function isInRange(node, location) {
return node && node.range[0] <= location && location <= node.range[1];
}
/**
* Searches from the current node through its ancestry to find a matching node.
* @param node a node to get.
* @param match a callback that checks whether or not the node verifies its condition or not.
* @returns the matching node.
*/
function findSelfOrAncestor(node, match) {
let currentNode = node;
while (currentNode && !match(currentNode)) {
currentNode = currentNode.parent;
}
return currentNode;
}
/**
* Finds function's outer scope.
* @param scope Function's own scope.
* @returns Function's outer scope.
*/
function getOuterScope(scope) {
const upper = scope.upper;
if (upper?.type === scope_manager_1.ScopeType.functionExpressionName) {
return upper.upper;
}
return upper;
}
/**
* Checks if a variable and a shadowedVariable have the same init pattern ancestor.
* @param variable a variable to check.
* @param shadowedVariable a shadowedVariable to check.
* @returns Whether or not the variable and the shadowedVariable have the same init pattern ancestor.
*/
function isInitPatternNode(variable, shadowedVariable) {
const outerDef = shadowedVariable.defs.at(0);
if (!outerDef) {
return false;
}
const { variableScope } = variable.scope;
if (!((variableScope.block.type ===
utils_1.AST_NODE_TYPES.ArrowFunctionExpression ||
variableScope.block.type === utils_1.AST_NODE_TYPES.FunctionExpression) &&
getOuterScope(variableScope) === shadowedVariable.scope)) {
return false;
}
const fun = variableScope.block;
const { parent } = fun;
const callExpression = findSelfOrAncestor(parent, node => node.type === utils_1.AST_NODE_TYPES.CallExpression);
if (!callExpression) {
return false;
}
let node = outerDef.name;
const location = callExpression.range[1];
while (node) {
if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator) {
if (isInRange(node.init, location)) {
return true;
}
if ((node.parent.parent.type === utils_1.AST_NODE_TYPES.ForInStatement ||
node.parent.parent.type === utils_1.AST_NODE_TYPES.ForOfStatement) &&
isInRange(node.parent.parent.right, location)) {
return true;
}
break;
}
else if (node.type === utils_1.AST_NODE_TYPES.AssignmentPattern) {
if (isInRange(node.right, location)) {
return true;
}
}
else if ([
utils_1.AST_NODE_TYPES.ArrowFunctionExpression,
utils_1.AST_NODE_TYPES.CatchClause,
utils_1.AST_NODE_TYPES.ClassDeclaration,
utils_1.AST_NODE_TYPES.ClassExpression,
utils_1.AST_NODE_TYPES.ExportNamedDeclaration,
utils_1.AST_NODE_TYPES.FunctionDeclaration,
utils_1.AST_NODE_TYPES.FunctionExpression,
utils_1.AST_NODE_TYPES.ImportDeclaration,
].includes(node.type)) {
break;
}
node = node.parent;
}
return false;
}
/**
* Checks if a variable is inside the initializer of scopeVar.
*
* To avoid reporting at declarations such as `var a = function a() {};`.
* But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`.
* @param variable The variable to check.
* @param scopeVar The scope variable to look for.
* @returns Whether or not the variable is inside initializer of scopeVar.
*/
function isOnInitializer(variable, scopeVar) {
const outerScope = scopeVar.scope;
const outerDef = scopeVar.defs.at(0);
const outer = outerDef?.parent?.range;
const innerScope = variable.scope;
const innerDef = variable.defs.at(0);
const inner = innerDef?.name.range;
return !!(outer &&
inner &&
outer[0] < inner[0] &&
inner[1] < outer[1] &&
((innerDef.type === scope_manager_1.DefinitionType.FunctionName &&
innerDef.node.type === utils_1.AST_NODE_TYPES.FunctionExpression) ||
innerDef.node.type === utils_1.AST_NODE_TYPES.ClassExpression) &&
outerScope === innerScope.upper);
}
/**
* Get a range of a variable's identifier node.
* @param variable The variable to get.
* @returns The range of the variable's identifier node.
*/
function getNameRange(variable) {
const def = variable.defs.at(0);
return def?.name.range;
}
/**
* Checks if a variable is in TDZ of scopeVar.
* @param variable The variable to check.
* @param scopeVar The variable of TDZ.
* @returns Whether or not the variable is in TDZ of scopeVar.
*/
function isInTdz(variable, scopeVar) {
const outerDef = scopeVar.defs.at(0);
const inner = getNameRange(variable);
const outer = getNameRange(scopeVar);
if (!inner || !outer || inner[1] >= outer[0]) {
return false;
}
if (!outerDef) {
return true;
}
if (options.hoist === 'functions') {
return !functionsHoistedNodes.has(outerDef.node.type);
}
if (options.hoist === 'types') {
return !typesHoistedNodes.has(outerDef.node.type);
}
if (options.hoist === 'functions-and-types') {
return (!functionsHoistedNodes.has(outerDef.node.type) &&
!typesHoistedNodes.has(outerDef.node.type));
}
return true;
}
/**
* Get declared line and column of a variable.
* @param variable The variable to get.
* @returns The declared line and column of the variable.
*/
function getDeclaredLocation(variable) {
const identifier = variable.identifiers.at(0);
if (identifier) {
return {
column: identifier.loc.start.column + 1,
global: false,
line: identifier.loc.start.line,
};
}
return {
global: true,
};
}
/**
* Checks if the initialization of a variable has the declare modifier in a
* definition file.
*/
function isDeclareInDTSFile(variable) {
const fileName = context.filename;
if (!(0, util_1.isDefinitionFile)(fileName)) {
return false;
}
return variable.defs.some(def => {
return ((def.type === scope_manager_1.DefinitionType.Variable && def.parent.declare) ||
(def.type === scope_manager_1.DefinitionType.ClassName && def.node.declare) ||
(def.type === scope_manager_1.DefinitionType.TSEnumName && def.node.declare) ||
(def.type === scope_manager_1.DefinitionType.TSModuleName && def.node.declare));
});
}
/**
* Checks the current context for shadowed variables.
* @param scope Fixme
*/
function checkForShadows(scope) {
// ignore global augmentation
if (isGlobalAugmentation(scope)) {
return;
}
const variables = scope.variables;
for (const variable of variables) {
// ignore "arguments"
if (variable.identifiers.length === 0) {
continue;
}
// this params are pseudo-params that cannot be shadowed
if (isThisParam(variable)) {
continue;
}
// ignore variables of a class name in the class scope of ClassDeclaration
if (isDuplicatedClassNameVariable(variable)) {
continue;
}
// ignore variables of a class name in the class scope of ClassDeclaration
if (isDuplicatedEnumNameVariable(variable)) {
continue;
}
// ignore configured allowed names
if (isAllowed(variable)) {
continue;
}
// ignore variables with the declare keyword in .d.ts files
if (isDeclareInDTSFile(variable)) {
continue;
}
// Gets shadowed variable.
const shadowed = scope.upper
? utils_1.ASTUtils.findVariable(scope.upper, variable.name)
: null;
if (!shadowed) {
continue;
}
// ignore type value variable shadowing if configured
if (isTypeValueShadow(variable, shadowed)) {
continue;
}
// ignore function type parameter name shadowing if configured
if (isFunctionTypeParameterNameValueShadow(variable, shadowed)) {
continue;
}
// ignore static class method generic shadowing class generic
// this is impossible for the scope analyser to understand
// so we have to handle this manually in this rule
if (isGenericOfAStaticMethodShadow(variable, shadowed)) {
continue;
}
if (isExternalDeclarationMerging(scope, variable, shadowed)) {
continue;
}
const isESLintGlobal = 'writeable' in shadowed;
if ((shadowed.identifiers.length > 0 ||
(options.builtinGlobals && isESLintGlobal)) &&
!isOnInitializer(variable, shadowed) &&
!(options.ignoreOnInitialization &&
isInitPatternNode(variable, shadowed)) &&
!(options.hoist !== 'all' && isInTdz(variable, shadowed))) {
const location = getDeclaredLocation(shadowed);
context.report({
node: variable.identifiers[0],
...(location.global
? {
messageId: 'noShadowGlobal',
data: {
name: variable.name,
},
}
: {
messageId: 'noShadow',
data: {
name: variable.name,
shadowedColumn: location.column,
shadowedLine: location.line,
},
}),
});
}
}
}
return {
'Program:exit'(node) {
const globalScope = context.sourceCode.getScope(node);
const stack = [...globalScope.childScopes];
while (stack.length) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const scope = stack.pop();
stack.push(...scope.childScopes);
checkForShadows(scope);
}
},
};
},
});
@@ -0,0 +1 @@
{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAUlD,CAAA"}
@@ -0,0 +1 @@
export declare const xhtmlEntities: Record<string, string>;
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,kEAAY,CAAC;IACxE,qBAAqB,CAAC,yRAA+C,CAAC;IACtE,UAAU,CAAC,iDAAO,CAAC;IACnB,eAAe,CAAC,iIAAqB,CAAC;IACtC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,qJAAuB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,6FAAe,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kHAAkB,CAAC;QAAA,GAAG,CAAC,CAAC;IAC1O,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,mDAAS,CAAC;AACnD","sources":["packages/@react-aria/grid/intl/ru-RU.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} не выбрано.\",\n \"longPressToSelect\": \"Нажмите и удерживайте для входа в режим выбора.\",\n \"select\": \"Выбрать\",\n \"selectedAll\": \"Выбраны все элементы.\",\n \"selectedCount\": \"{count, plural, =0 {Нет выбранных элементов} one {# элемент выбран} other {# элементов выбрано}}.\",\n \"selectedItem\": \"{item} выбрано.\"\n}\n"],"names":[],"version":3,"file":"ru-RU.main.js.map"}
@@ -0,0 +1,72 @@
import { DateInput, Unit } from './types';
/**
* Checks if a date is between two other dates or specified time units.
* 检查一个日期是否在两个其他日期或指定的时间单位之间。
*
* @param date - The date to check. (要检查的日期。)
* @param from - The start date or time unit. (起始日期或时间单位。)
* @param to - The end date or time unit. (结束日期或时间单位。)
* @param unit - The unit of time to compare (e.g., 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond').
* (要比较的时间单位,例如 'year'、'month'、'day'、'hour'、'minute'、'second'、'millisecond'。)
* @param inclusivity - A string indicating whether the comparison is inclusive or exclusive.
* (表示比较是否包含边界的字符串。)
* - '()' means exclusive (不包含边界) (默认值)
* - '[)' means inclusive on the start, exclusive on the end (包含起始边界,不包含结束边界)
* - '(]' means exclusive on the start, inclusive on the end (不包含起始边界,包含结束边界)
* - '[]' means inclusive (包含边界)
* @returns A boolean indicating whether the date is between the two specified dates or time units.
* (布尔值,表示日期是否在两个指定的日期或时间单位之间。)
* @example
* ```ts
* // Checking if a date is between two dates (检查一个日期是否在两个日期之间)
* const date = new Date('2023-10-01');
* const from = new Date('2023-09-01');
* const to = new Date('2023-11-01');
* const isBetweenDates = isBetween(date, from, to, 'day');
* console.log(isBetweenDates); // Outputs: true (输出: true)
*
* // Checking if a date is between two years (检查一个日期是否在两个年份之间)
* const date2 = new Date('2023-01-01');
* const isBetweenYears = isBetween(date2, 2022, 2024, 'year');
* console.log(isBetweenYears); // Outputs: true (输出: true)
*
* // Checking if a date is between two months (检查一个日期是否在两个月份之间)
* const date3 = new Date('2023-10-01');
* const isBetweenMonths = isBetween(date3, '2023-09', '2023-11', 'month');
* console.log(isBetweenMonths); // Outputs: true (输出: true)
*
* // Checking if a date is between two days (检查一个日期是否在两个天数之间)
* const date4 = new Date('2023-10-02');
* const isBetweenDays = isBetween(date4, '2023-10-01', '2023-10-03', 'day');
* console.log(isBetweenDays); // Outputs: true (输出: true)
*
* // Checking if a date is between two hours (检查一个日期是否在两个小时之间)
* const date5 = new Date('2023-10-01T12:00:00');
* const isBetweenHours = isBetween(date5, '2023-10-01T11:00:00', '2023-10-01T13:00:00', 'hour');
* console.log(isBetweenHours); // Outputs: true (输出: true)
*
* // Checking if a date is between two minutes (检查一个日期是否在两个分钟之间)
* const date6 = new Date('2023-10-01T12:01:00');
* const isBetweenMinutes = isBetween(date6, '2023-10-01T12:00:00', '2023-10-01T12:02:00', 'minute');
* console.log(isBetweenMinutes); // Outputs: true (输出: true)
*
* // Checking if a date is between two seconds (检查一个日期是否在两个秒数之间)
* const date7 = new Date('2023-10-01T12:00:01');
* const isBetweenSeconds = isBetween(date7, '2023-10-01T12:00:00', '2023-10-01T12:00:02', 'second');
* console.log(isBetweenSeconds); // Outputs: true (输出: true)
*
* // Checking if a date is between two milliseconds (检查一个日期是否在两个毫秒数之间)
* const date8 = new Date('2023-10-01T12:00:00.500');
* const isBetweenMilliseconds = isBetween(date8, '2023-10-01T12:00:00.000', '2023-10-01T12:00:00.999', 'millisecond');
* console.log(isBetweenMilliseconds); // Outputs: true (输出: true)
*
* // Using different inclusivity options (使用不同的包含选项)
* const date9 = new Date('2023-10-01');
* const isBetweenInclusive = isBetween(date9, '2023-10-01', '2023-10-01', 'day', '[]');
* console.log(isBetweenInclusive); // Outputs: true (输出: true)
*
* const isBetweenExclusive = isBetween(date9, '2023-10-01', '2023-10-01', 'day', '()');
* console.log(isBetweenExclusive); // Outputs: false (输出: false)
* ```
*/
export default function isBetween(date: Date, from: DateInput, to: DateInput, unit?: Unit, inclusivity?: string): boolean;
@@ -0,0 +1,7 @@
# @lezer/json
This is a JSON grammar for the [lezer](https://lezer.codemirror.net/) parser system.
Reference:
- https://www.json.org/json-en.html
- https://tools.ietf.org/html/rfc8259 (The latest IETF RFC – contains the latest full spec)
@@ -0,0 +1,11 @@
import { a as absFloor } from "./absFloor-BlD_nfEw.mjs";
import { b as MS_IN_MINUTE } from "./constants-BuFquuHl.mjs";
import parse from "./parse.mjs";
function diffInMinutes(date, input, asFloat) {
const parsed = parse(input);
const output = (+date - +parsed) / MS_IN_MINUTE;
return asFloat ? output : absFloor(output);
}
export {
diffInMinutes as default
};
@@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./static"), exports);
@@ -0,0 +1 @@
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAqBM,SAAS,0CAAe,QAA4B,CAAC,CAAC;IAC3D,IAAI,cAAC,UAAU,EAAC,GAAG;IAEnB,8EAA8E;IAC9E,+FAA+F;IAC/F,IAAI,CAAC,YAAY,YAAY,GAAG,CAAA,GAAA,2CAAiB,EAAE,MAAM,UAAU,EAAE,MAAM,eAAe,IAAI,OAAO,MAAM,QAAQ;IAEnH,SAAS,eAAe,KAAK;QAC3B,IAAI,CAAC,YACH,YAAY;IAEhB;IAEA,SAAS;QACP,IAAI,CAAC,YACH,YAAY,CAAC;IAEjB;IAEA,OAAO;oBACL;QACA,aAAa;QACb,QAAQ;IACV;AACF","sources":["packages/@react-stately/toggle/src/useToggleState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ToggleStateOptions} from '@react-types/checkbox';\nimport {useControlledState} from '@react-stately/utils';\n\nexport type {ToggleStateOptions};\n\nexport interface ToggleState {\n /** Whether the toggle is selected. */\n readonly isSelected: boolean,\n\n /** Updates selection state. */\n setSelected(isSelected: boolean): void,\n\n /** Toggle the selection state. */\n toggle(): void\n}\n\n/**\n * Provides state management for toggle components like checkboxes and switches.\n */\nexport function useToggleState(props: ToggleStateOptions = {}): ToggleState {\n let {isReadOnly} = props;\n\n // have to provide an empty function so useControlledState doesn't throw a fit\n // can't use useControlledState's prop calling because we need the event object from the change\n let [isSelected, setSelected] = useControlledState(props.isSelected, props.defaultSelected || false, props.onChange);\n\n function updateSelected(value) {\n if (!isReadOnly) {\n setSelected(value);\n }\n }\n\n function toggleState() {\n if (!isReadOnly) {\n setSelected(!isSelected);\n }\n }\n\n return {\n isSelected,\n setSelected: updateSelected,\n toggle: toggleState\n };\n}\n"],"names":[],"version":3,"file":"useToggleState.main.js.map"}
@@ -0,0 +1,41 @@
'use strict';
const crypto = require('crypto');
const moduleRequire = require('eslint-module-utils/module-require').default;
const hashObject = require('eslint-module-utils/hash').hashObject;
const cache = new Map();
// must match ESLint default options or we'll miss the cache every time
const parserOptions = {
loc: true,
range: true,
raw: true,
tokens: true,
comment: true,
attachComment: true,
};
exports.parse = function parse(content, options) {
options = { ...options, ...parserOptions };
if (!options.filePath) {
throw new Error('no file path provided!');
}
const keyHash = crypto.createHash('sha256');
keyHash.update(content);
hashObject(options, keyHash);
const key = keyHash.digest('hex');
let ast = cache.get(key);
if (ast != null) { return ast; }
const realParser = moduleRequire(options.parser);
ast = realParser.parse(content, options);
cache.set(key, ast);
return ast;
};
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
set -e
mkdir -p .browser
echo
echo Preparing browser tests:
find spec -type f -name '*.spec.js' | \
xargs -I {} sh -c \
'export f="{}"; echo $f; browserify $f -t require-globify -t brfs -x ajv -u buffer -o $(echo $f | sed -e "s/spec/.browser/");'
@@ -0,0 +1,7 @@
import { TypeBoxError } from '../../type/error/index';
export declare class ValueHashError extends TypeBoxError {
readonly value: unknown;
constructor(value: unknown);
}
/** Creates a FNV1A-64 non cryptographic hash of the given value */
export declare function Hash(value: unknown): bigint;
@@ -0,0 +1,100 @@
import { BestFitMatcher } from './BestFitMatcher';
import { CanonicalizeUValue } from './CanonicalizeUValue';
import { InsertUnicodeExtensionAndCanonicalize } from './InsertUnicodeExtensionAndCanonicalize';
import { LookupMatcher } from './LookupMatcher';
import { UnicodeExtensionComponents } from './UnicodeExtensionComponents';
import { invariant } from './utils';
/**
* https://tc39.es/ecma402/#sec-resolvelocale
*/
export function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
var _a;
var matcher = options.localeMatcher;
var r;
if (matcher === 'lookup') {
r = LookupMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale);
}
else {
r = BestFitMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale);
}
if (r == null) {
r = {
locale: getDefaultLocale(),
extension: '',
};
}
var foundLocale = r.locale;
var foundLocaleData = localeData[foundLocale];
// TODO: We can't really guarantee that the locale data is available
// invariant(
// foundLocaleData !== undefined,
// `Missing locale data for ${foundLocale}`
// )
var result = { locale: 'en', dataLocale: foundLocale };
var components;
var keywords;
if (r.extension) {
components = UnicodeExtensionComponents(r.extension);
keywords = components.keywords;
}
else {
keywords = [];
}
var supportedKeywords = [];
var _loop_1 = function (key) {
// TODO: Shouldn't default to empty array, see TODO above
var keyLocaleData = (_a = foundLocaleData === null || foundLocaleData === void 0 ? void 0 : foundLocaleData[key]) !== null && _a !== void 0 ? _a : [];
invariant(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
var value = keyLocaleData[0];
invariant(value === undefined || typeof value === 'string', "value must be a string or undefined");
var supportedKeyword = void 0;
var entry = keywords.find(function (k) { return k.key === key; });
if (entry) {
var requestedValue = entry.value;
if (requestedValue !== '') {
if (keyLocaleData.indexOf(requestedValue) > -1) {
value = requestedValue;
supportedKeyword = {
key: key,
value: value,
};
}
}
else if (keyLocaleData.indexOf('true') > -1) {
value = 'true';
supportedKeyword = {
key: key,
value: value,
};
}
}
var optionsValue = options[key];
invariant(optionsValue == null || typeof optionsValue === 'string', "optionsValue must be a string or undefined");
if (typeof optionsValue === 'string') {
var ukey = key.toLowerCase();
optionsValue = CanonicalizeUValue(ukey, optionsValue);
if (optionsValue === '') {
optionsValue = 'true';
}
}
if (optionsValue !== value && keyLocaleData.indexOf(optionsValue) > -1) {
value = optionsValue;
supportedKeyword = undefined;
}
if (supportedKeyword) {
supportedKeywords.push(supportedKeyword);
}
result[key] = value;
};
for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
var key = relevantExtensionKeys_1[_i];
_loop_1(key);
}
var supportedAttributes = [];
if (supportedKeywords.length > 0) {
supportedAttributes = [];
foundLocale = InsertUnicodeExtensionAndCanonicalize(foundLocale, supportedAttributes, supportedKeywords);
}
result.locale = foundLocale;
return result;
}
@@ -0,0 +1,80 @@
import * as _heroui_system from '@heroui/system';
import { HTMLHeroUIProps, PropGetter } from '@heroui/system';
import * as react from 'react';
import { ReactNode, MouseEventHandler } from 'react';
import { PressEvents, FocusableProps } from '@react-types/shared';
import { SlotsToClasses, CardSlots, CardVariantProps, CardReturnType } from '@heroui/theme';
import { RippleProps } from '@heroui/ripple';
import { PressEvent } from '@react-aria/interactions';
import { ReactRef } from '@heroui/react-utils';
interface Props extends Omit<HTMLHeroUIProps<"div">, "onClick"> {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLDivElement | null>;
/**
* Usually the Card parts, `CardHeader`, `CardBody` and `CardFooter`.
*/
children?: ReactNode | ReactNode[];
/**
* Whether the card should show a ripple animation on press, this prop is ignored if `disableAnimation` is true or `isPressable` is false.
* @default false
*/
disableRipple?: boolean;
/**
* Whether the card should allow text selection on press. (only for pressable cards)
* @default true
*/
allowTextSelectionOnPress?: boolean;
/**
* The native button click event handler.
* use `onPress` instead.
* @deprecated
*/
onClick?: MouseEventHandler<HTMLButtonElement>;
/**
* Classname or List of classes to change the classNames of the element.
* if `className` is passed, it will be added to the base slot.
*
* @example
* ```ts
* <Card classNames={{
* base:"base-classes",
* header: "dot-classes",
* body: "content-classes",
* footer: "avatar-classes",
* }} />
* ```
*/
classNames?: SlotsToClasses<CardSlots>;
}
type UseCardProps = Props & PressEvents & FocusableProps & CardVariantProps;
type ContextType = {
slots: CardReturnType;
classNames?: SlotsToClasses<CardSlots>;
isDisabled?: CardVariantProps["isDisabled"];
isFooterBlurred?: CardVariantProps["isFooterBlurred"];
disableAnimation?: CardVariantProps["disableAnimation"];
fullWidth?: CardVariantProps["fullWidth"];
};
declare function useCard(originalProps: UseCardProps): {
context: ContextType;
domRef: react.RefObject<HTMLDivElement>;
Component: _heroui_system.As<any>;
classNames: SlotsToClasses<"base" | "body" | "footer" | "header"> | undefined;
children: ReactNode | ReactNode[];
isHovered: boolean;
isPressed: boolean;
disableAnimation: boolean;
isPressable: boolean | undefined;
isHoverable: boolean | undefined;
disableRipple: boolean;
handlePress: (e: PressEvent) => void;
isFocusVisible: boolean;
getCardProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getRippleProps: () => RippleProps;
};
type UseCardReturn = ReturnType<typeof useCard>;
export { ContextType, Props, UseCardProps, UseCardReturn, useCard };
@@ -0,0 +1,8 @@
'use strict';
module.exports = (flag, argv = process.argv) => {
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
const position = argv.indexOf(prefix + flag);
const terminatorPosition = argv.indexOf('--');
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
};
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('dropRight', require('../dropRight'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1 @@
module.exports={A:{D:{"1":"0 1 2 3 4 5 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B"},L:{"1":"I"},B:{"1":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC J ZB 0C 1C"},M:{"1":"MC"},A:{"2":"K D E F A B wC"},F:{"1":"0 1 2 3 4 5 pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB FD GD HD ID NC uC JD OC"},K:{"1":"H","2":"A B C NC uC OC"},E:{"2":"J ZB K D 2C ZC 3C 4C 5C ED","33":"E F A B C L M G 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD"},G:{"2":"ZC KD vC LD MD ND","33":"E OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB qD rD sD aC tD uD vD wD xD QC RC SC yD","2":"J oD pD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"}},B:6,C:"text-decoration shorthand property",D:undefined};
@@ -0,0 +1,48 @@
var baseLodash = require('./_baseLodash'),
wrapperClone = require('./_wrapperClone');
/**
* Creates a clone of the chain sequence planting `value` as the wrapped value.
*
* @name plant
* @memberOf _
* @since 3.2.0
* @category Seq
* @param {*} value The value to plant.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2]).map(square);
* var other = wrapped.plant([3, 4]);
*
* other.value();
* // => [9, 16]
*
* wrapped.value();
* // => [1, 4]
*/
function wrapperPlant(value) {
var result,
parent = this;
while (parent instanceof baseLodash) {
var clone = wrapperClone(parent);
clone.__index__ = 0;
clone.__values__ = undefined;
if (result) {
previous.__wrapped__ = clone;
} else {
result = clone;
}
var previous = clone;
parent = parent.__wrapped__;
}
previous.__wrapped__ = value;
return result;
}
module.exports = wrapperPlant;
@@ -0,0 +1,19 @@
Copyright (C) 2020 by Marijn Haverbeke <marijn@haverbeke.berlin>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,10 @@
'use strict';
var ToUint8 = require('./ToUint8');
// https://262.ecma-international.org/6.0/#sec-toint8
module.exports = function ToInt8(argument) {
var int8bit = ToUint8(argument);
return int8bit >= 0x80 ? int8bit - 0x100 : int8bit;
};
@@ -0,0 +1,52 @@
# napi-build-utils
[![npm](https://img.shields.io/npm/v/napi-build-utils.svg)](https://www.npmjs.com/package/napi-build-utils)
![Node version](https://img.shields.io/node/v/prebuild.svg)
![Build Status](https://github.com/inspiredware/napi-build-utils/actions/workflows/run-npm-tests.yml/badge.svg)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
A set of utilities to assist developers of tools that build [Node-API](https://nodejs.org/api/n-api.html#n_api_n_api) native add-ons.
## Background
This module is targeted to developers creating tools that build Node-API native add-ons.
It implements a set of functions that aid in determining the Node-API version supported by the currently running Node instance and the set of Node-API versions against which the Node-API native add-on is designed to be built. Other functions determine whether a particular Node-API version can be built and can issue console warnings for unsupported Node-API versions.
Unlike the modules this code is designed to facilitate building, this module is written entirely in JavaScript.
## Quick start
```bash
npm install napi-build-utils
```
The module exports a set of functions documented [here](./index.md). For example:
```javascript
var napiBuildUtils = require('napi-build-utils');
var napiVersion = napiBuildUtils.getNapiVersion(); // Node-API version supported by Node, or undefined.
```
## Declaring supported Node-API versions
Native modules that are designed to work with [Node-API](https://nodejs.org/api/n-api.html#n_api_n_api) must explicitly declare the Node-API version(s) against which they are coded to build. This is accomplished by including a `binary.napi_versions` property in the module's `package.json` file. For example:
```json
"binary": {
"napi_versions": [2,3]
}
```
In the absence of a need to compile against a specific Node-API version, the value `3` is a good choice as this is the Node-API version that was supported when Node-API left experimental status.
Modules that are built against a specific Node-API version will continue to operate indefinitely, even as later versions of Node-API are introduced.
## History
**v2.0.0** This version was introduced to address a limitation when the Node-API version reached `10` in NodeJS `v23.6.0`. There was no change in the API, but a SemVer bump to `2.0.0` was made out of an abundance of caution.
## Support
If you run into problems or limitations, please file an issue and we'll take a look. Pull requests are also welcome.
@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2014-2018 Douglas Christopher Wilson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FunctionTypeScope = void 0;
const ScopeBase_1 = require("./ScopeBase");
const ScopeType_1 = require("./ScopeType");
class FunctionTypeScope extends ScopeBase_1.ScopeBase {
constructor(scopeManager, upperScope, block) {
super(scopeManager, ScopeType_1.ScopeType.functionType, upperScope, block, false);
}
}
exports.FunctionTypeScope = FunctionTypeScope;
@@ -0,0 +1 @@
{"version":3,"names":["_context","require","_index","_t","_context2","VISITOR_KEYS","_visitPaths","ctx","paths","queue","priorityQueue","visited","Set","stop","visitIndex","length","path","resync","call","contexts","pushContext","key","node","has","add","_visit","i","popContext","_opts$denylist","opts","denylist","blacklist","includes","type","shouldSkip","shouldStop","_call","enter","_opts$node$type","_traverse","scope","state","skipKeys","exit","_opts$node$type2","visitSelf","keys","TraversalContext","parentKey","prop","Array","isArray","childPath","NodePath","get","parentPath","parent","container","listKey","push","traverseNode","context","visitQueue","visit"],"sources":["../src/traverse-node.ts"],"sourcesContent":["import TraversalContext from \"./context.ts\";\nimport type { ExplodedTraverseOptions } from \"./index.ts\";\nimport NodePath from \"./path/index.ts\";\nimport type Scope from \"./scope/index.ts\";\nimport type * as t from \"@babel/types\";\nimport { VISITOR_KEYS } from \"@babel/types\";\nimport { _call, popContext, pushContext, resync } from \"./path/context.ts\";\n\nfunction _visitPaths(ctx: TraversalContext, paths: NodePath[]): boolean {\n // set queue\n ctx.queue = paths;\n ctx.priorityQueue = [];\n\n const visited = new Set();\n let stop = false;\n let visitIndex = 0;\n\n for (; visitIndex < paths.length; ) {\n const path = paths[visitIndex];\n visitIndex++;\n\n resync.call(path);\n\n if (\n path.contexts.length === 0 ||\n path.contexts[path.contexts.length - 1] !== ctx\n ) {\n // The context might already have been pushed when this path was inserted and queued.\n // If we always re-pushed here, we could get duplicates and risk leaving contexts\n // on the stack after the traversal has completed, which could break things.\n pushContext.call(path, ctx);\n }\n\n // this path no longer belongs to the tree\n if (path.key === null) continue;\n\n // ensure we don't visit the same node twice\n const { node } = path;\n if (visited.has(node)) continue;\n if (node) visited.add(node);\n\n if (_visit(ctx, path)) {\n stop = true;\n break;\n }\n\n if (ctx.priorityQueue.length) {\n stop = _visitPaths(ctx, ctx.priorityQueue);\n ctx.priorityQueue = [];\n ctx.queue = paths;\n if (stop) break;\n }\n }\n\n // pop contexts\n for (let i = 0; i < visitIndex; i++) {\n popContext.call(paths[i]);\n }\n\n // clear queue\n ctx.queue = null;\n\n return stop;\n}\n\nfunction _visit(ctx: TraversalContext, path: NodePath) {\n const node = path.node;\n if (!node) {\n return false;\n }\n const opts = ctx.opts;\n\n // @ts-expect-error TODO(Babel 8): Remove blacklist\n const denylist = opts.denylist ?? opts.blacklist;\n if (denylist?.includes(node.type)) {\n return false;\n }\n\n if (opts.shouldSkip?.(path)) {\n return false;\n }\n\n // Note: We need to check \"this.shouldSkip\" first because\n // another visitor can set it to true. Usually .shouldSkip is false\n // before calling the enter visitor, but it can be true in case of\n // a requeued node (e.g. by .replaceWith()) that is then marked\n // with .skip().\n if (path.shouldSkip) return path.shouldStop;\n\n if (_call.call(path, opts.enter)) return path.shouldStop;\n if (path.node) {\n if (_call.call(path, opts[node.type]?.enter)) return path.shouldStop;\n }\n\n path.shouldStop = _traverse(\n path.node,\n opts,\n path.scope,\n ctx.state,\n path,\n path.skipKeys,\n );\n\n if (path.node) {\n if (_call.call(path, opts.exit)) return true;\n }\n if (path.node) {\n _call.call(path, opts[node.type]?.exit);\n }\n\n return path.shouldStop;\n}\n\nfunction _traverse<S>(\n node: t.Node,\n opts: ExplodedTraverseOptions<S>,\n scope?: Scope | null,\n state?: S,\n path?: NodePath,\n skipKeys?: Record<string, boolean> | null,\n visitSelf?: boolean,\n) {\n const keys = VISITOR_KEYS[node.type];\n if (!keys?.length) return false;\n\n const ctx = new TraversalContext(scope, opts, state, path);\n if (visitSelf) {\n if (skipKeys?.[path!.parentKey]) return false;\n return _visitPaths(ctx, [path!]);\n }\n\n for (const key of keys) {\n if (skipKeys?.[key]) continue;\n // @ts-expect-error key must present in node\n const prop = node[key];\n if (!prop) continue;\n\n if (Array.isArray(prop)) {\n if (!prop.length) continue;\n const paths = [];\n for (let i = 0; i < prop.length; i++) {\n const childPath = NodePath.get({\n parentPath: path,\n parent: node,\n container: prop,\n key: i,\n listKey: key,\n });\n paths.push(childPath);\n }\n if (_visitPaths(ctx, paths)) return true;\n } else {\n if (\n _visitPaths(ctx, [\n NodePath.get({\n parentPath: path,\n parent: node,\n container: node,\n key,\n listKey: null,\n Line truncated
@@ -0,0 +1,135 @@
"use client";
// src/use-modal.ts
import { useAriaModalOverlay } from "@heroui/use-aria-modal-overlay";
import { useCallback, useId, useRef, useState, useMemo } from "react";
import { modal } from "@heroui/theme";
import { mapPropsVariants, useProviderContext } from "@heroui/system";
import { useAriaButton } from "@heroui/use-aria-button";
import { useFocusRing } from "@react-aria/focus";
import { clsx, dataAttr, objectToDeps } from "@heroui/shared-utils";
import { useDOMRef } from "@heroui/react-utils";
import { useOverlayTriggerState } from "@react-stately/overlays";
import { mergeRefs, mergeProps } from "@react-aria/utils";
function useModal(originalProps) {
var _a, _b, _c;
const globalContext = useProviderContext();
const [props, variantProps] = mapPropsVariants(originalProps, modal.variantKeys);
const {
ref,
as,
className,
classNames,
isOpen,
defaultOpen,
onOpenChange,
motionProps,
closeButton,
isDismissable = true,
hideCloseButton = false,
shouldBlockScroll = true,
portalContainer,
isKeyboardDismissDisabled = false,
onClose,
...otherProps
} = props;
const Component = as || "section";
const domRef = useDOMRef(ref);
const closeButtonRef = useRef(null);
const [headerMounted, setHeaderMounted] = useState(false);
const [bodyMounted, setBodyMounted] = useState(false);
const disableAnimation = (_b = (_a = originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const dialogId = useId();
const headerId = useId();
const bodyId = useId();
const state = useOverlayTriggerState({
isOpen,
defaultOpen,
onOpenChange: (isOpen2) => {
onOpenChange == null ? void 0 : onOpenChange(isOpen2);
if (!isOpen2) {
onClose == null ? void 0 : onClose();
}
}
});
const { modalProps, underlayProps } = useAriaModalOverlay(
{
isDismissable,
shouldBlockScroll,
isKeyboardDismissDisabled
},
state,
domRef
);
const { buttonProps: closeButtonProps } = useAriaButton({ onPress: state.close }, closeButtonRef);
const { isFocusVisible: isCloseButtonFocusVisible, focusProps: closeButtonFocusProps } = useFocusRing();
const baseStyles = clsx(classNames == null ? void 0 : classNames.base, className);
const slots = useMemo(
() => modal({
...variantProps,
disableAnimation
}),
[objectToDeps(variantProps), disableAnimation]
);
const getDialogProps = (props2 = {}, ref2 = null) => {
var _a2;
return {
ref: mergeRefs(ref2, domRef),
...mergeProps(modalProps, otherProps, props2),
className: slots.base({ class: clsx(baseStyles, props2.className) }),
id: dialogId,
"data-open": dataAttr(state.isOpen),
"data-dismissable": dataAttr(isDismissable),
"aria-modal": dataAttr(true),
"data-placement": (_a2 = originalProps == null ? void 0 : originalProps.placement) != null ? _a2 : "right",
"aria-labelledby": headerMounted ? headerId : void 0,
"aria-describedby": bodyMounted ? bodyId : void 0
};
};
const getBackdropProps = useCallback(
(props2 = {}) => ({
className: slots.backdrop({ class: classNames == null ? void 0 : classNames.backdrop }),
onClick: () => state.close(),
...underlayProps,
...props2
}),
[slots, classNames, underlayProps]
);
const getCloseButtonProps = () => {
return {
role: "button",
tabIndex: 0,
"aria-label": "Close",
"data-focus-visible": dataAttr(isCloseButtonFocusVisible),
className: slots.closeButton({ class: classNames == null ? void 0 : classNames.closeButton }),
...mergeProps(closeButtonProps, closeButtonFocusProps)
};
};
return {
Component,
slots,
domRef,
headerId,
bodyId,
motionProps,
classNames,
isDismissable,
closeButton,
hideCloseButton,
portalContainer,
shouldBlockScroll,
backdrop: (_c = originalProps.backdrop) != null ? _c : "opaque",
isOpen: state.isOpen,
onClose: state.close,
disableAnimation,
setBodyMounted,
setHeaderMounted,
getDialogProps,
getBackdropProps,
getCloseButtonProps
};
}
export {
useModal
};
@@ -0,0 +1,86 @@
import {getChildNodes as $7nPCv$getChildNodes, getLastItem as $7nPCv$getLastItem, getFirstItem as $7nPCv$getFirstItem} from "@react-stately/collections";
import {useMultipleSelectionState as $7nPCv$useMultipleSelectionState, SelectionManager as $7nPCv$SelectionManager} from "@react-stately/selection";
import {useMemo as $7nPCv$useMemo, useRef as $7nPCv$useRef, useEffect as $7nPCv$useEffect} from "react";
function $62967d126f3aa823$export$4007ac09ff9c68ed(props) {
let { collection: collection, focusMode: focusMode } = props;
// eslint-disable-next-line react-hooks/rules-of-hooks
let selectionState = props.UNSAFE_selectionState || (0, $7nPCv$useMultipleSelectionState)(props);
let disabledKeys = (0, $7nPCv$useMemo)(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set(), [
props.disabledKeys
]);
let setFocusedKey = selectionState.setFocusedKey;
selectionState.setFocusedKey = (key, child)=>{
// If focusMode is cell and an item is focused, focus a child cell instead.
if (focusMode === 'cell' && key != null) {
let item = collection.getItem(key);
if ((item === null || item === void 0 ? void 0 : item.type) === 'item') {
var _getLastItem, _getFirstItem;
let children = (0, $7nPCv$getChildNodes)(item, collection);
var _getLastItem_key, _getFirstItem_key;
if (child === 'last') key = (_getLastItem_key = (_getLastItem = (0, $7nPCv$getLastItem)(children)) === null || _getLastItem === void 0 ? void 0 : _getLastItem.key) !== null && _getLastItem_key !== void 0 ? _getLastItem_key : null;
else key = (_getFirstItem_key = (_getFirstItem = (0, $7nPCv$getFirstItem)(children)) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key) !== null && _getFirstItem_key !== void 0 ? _getFirstItem_key : null;
}
}
setFocusedKey(key, child);
};
let selectionManager = (0, $7nPCv$useMemo)(()=>new (0, $7nPCv$SelectionManager)(collection, selectionState), [
collection,
selectionState
]);
// Reset focused key if that item is deleted from the collection.
const cachedCollection = (0, $7nPCv$useRef)(null);
(0, $7nPCv$useEffect)(()=>{
if (selectionState.focusedKey != null && cachedCollection.current && !collection.getItem(selectionState.focusedKey)) {
const node = cachedCollection.current.getItem(selectionState.focusedKey);
const parentNode = (node === null || node === void 0 ? void 0 : node.parentKey) != null && (node.type === 'cell' || node.type === 'rowheader' || node.type === 'column') ? cachedCollection.current.getItem(node.parentKey) : node;
if (!parentNode) {
selectionState.setFocusedKey(null);
return;
}
const cachedRows = cachedCollection.current.rows;
const rows = collection.rows;
const diff = cachedRows.length - rows.length;
let index = Math.min(diff > 1 ? Math.max(parentNode.index - diff + 1, 0) : parentNode.index, rows.length - 1);
let newRow = null;
while(index >= 0){
if (!selectionManager.isDisabled(rows[index].key) && rows[index].type !== 'headerrow') {
newRow = rows[index];
break;
}
// Find next, not disabled row.
if (index < rows.length - 1) index++;
else {
if (index > parentNode.index) index = parentNode.index;
index--;
}
}
if (newRow) {
const childNodes = newRow.hasChildNodes ? [
...(0, $7nPCv$getChildNodes)(newRow, collection)
] : [];
const keyToFocus = newRow.hasChildNodes && parentNode !== node && node && node.index < childNodes.length ? childNodes[node.index].key : newRow.key;
selectionState.setFocusedKey(keyToFocus);
} else selectionState.setFocusedKey(null);
}
cachedCollection.current = collection;
}, [
collection,
selectionManager,
selectionState,
selectionState.focusedKey
]);
return {
collection: collection,
disabledKeys: disabledKeys,
isKeyboardNavigationDisabled: false,
selectionManager: selectionManager
};
}
export {$62967d126f3aa823$export$4007ac09ff9c68ed as useGridState};
//# sourceMappingURL=useGridState.module.js.map
@@ -0,0 +1,7 @@
function fillWildcards(keyframes) {
for (let i = 1; i < keyframes.length; i++) {
keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);
}
}
export { fillWildcards };
@@ -0,0 +1 @@
{"version":3,"names":["_isNode","require","assertNode","node","isNode","_node$type","type","JSON","stringify","TypeError"],"sources":["../../src/asserts/assertNode.ts"],"sourcesContent":["import isNode from \"../validators/isNode.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function assertNode(node?: any): asserts node is t.Node {\n if (!isNode(node)) {\n const type = node?.type ?? JSON.stringify(node);\n throw new TypeError(`Not a valid node of type \"${type}\"`);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAGe,SAASC,UAAUA,CAACC,IAAU,EAA0B;EACrE,IAAI,CAAC,IAAAC,eAAM,EAACD,IAAI,CAAC,EAAE;IAAA,IAAAE,UAAA;IACjB,MAAMC,IAAI,IAAAD,UAAA,GAAGF,IAAI,oBAAJA,IAAI,CAAEG,IAAI,YAAAD,UAAA,GAAIE,IAAI,CAACC,SAAS,CAACL,IAAI,CAAC;IAC/C,MAAM,IAAIM,SAAS,CAAC,6BAA6BH,IAAI,GAAG,CAAC;EAC3D;AACF","ignoreList":[]}
@@ -0,0 +1,64 @@
var baseTrim = require('./_baseTrim'),
isObject = require('./isObject'),
isSymbol = require('./isSymbol');
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = baseTrim(value);
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
module.exports = toNumber;
@@ -0,0 +1 @@
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAuCM,SAAS,0CAAoB,KAAuB;IACzD,IAAI,sBAAsB,CAAA,GAAA,6BAAqB,EAAE;IACjD,IAAI,CAAC,eAAe,iBAAiB,GAAG,CAAA,GAAA,eAAO,EAAwB;IACvE,IAAI,CAAC,mBAAmB,qBAAqB,GAAG,CAAA,GAAA,eAAO,EAAS,EAAE;IAElE,IAAI,WAAW;QACb,qBAAqB,EAAE;QACvB,oBAAoB,KAAK;IAC3B;IAEA,IAAI,cAAc,CAAC,YAAiB;QAClC,qBAAqB,CAAA;YACnB,IAAI,QAAQ,SAAS,MAAM,EACzB,OAAO;YAGT,OAAO;mBAAI,SAAS,KAAK,CAAC,GAAG;gBAAQ;aAAW;QAClD;IACF;IAEA,IAAI,eAAe,CAAC,YAAiB;QACnC,qBAAqB,CAAA;YACnB,IAAI,MAAM,QAAQ,CAAC,MAAM;YACzB,IAAI,QAAQ,YACV,OAAO,SAAS,KAAK,CAAC,GAAG;iBAEzB,OAAO;QAEX;IACF;IAEA,OAAO;uBACL;QACA,GAAG,mBAAmB;QACtB,MAAK,gBAAsC,IAAI;YAC7C,iBAAiB;YACjB,oBAAoB,IAAI;QAC1B;QACA,QAAO,gBAAsC,IAAI;YAC/C,iBAAiB;YACjB,oBAAoB,MAAM;QAC5B;QACA;YACE;QACF;2BACA;qBACA;sBACA;IACF;AACF","sources":["packages/@react-stately/menu/src/useMenuTriggerState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusStrategy, Key} from '@react-types/shared';\nimport {MenuTriggerProps} from '@react-types/menu';\nimport {OverlayTriggerState, useOverlayTriggerState} from '@react-stately/overlays';\nimport {useState} from 'react';\n\nexport interface MenuTriggerState extends OverlayTriggerState {\n /** Controls which item will be auto focused when the menu opens. */\n readonly focusStrategy: FocusStrategy | null,\n\n /** Opens the menu. */\n open(focusStrategy?: FocusStrategy | null): void,\n\n /** Toggles the menu. */\n toggle(focusStrategy?: FocusStrategy | null): void\n}\n\nexport interface RootMenuTriggerState extends MenuTriggerState {\n /** Opens a specific submenu tied to a specific menu item at a specific level. */\n openSubmenu: (triggerKey: Key, level: number) => void,\n\n /** Closes a specific submenu tied to a specific menu item at a specific level. */\n closeSubmenu: (triggerKey: Key, level: number) => void,\n\n /** An array of open submenu trigger keys within the menu tree.\n * The index of key within array matches the submenu level in the tree.\n */\n expandedKeysStack: Key[],\n\n /** Closes the menu and all submenus in the menu tree. */\n close: () => void\n}\n\n/**\n * Manages state for a menu trigger. Tracks whether the menu is currently open,\n * and controls which item will receive focus when it opens. Also tracks the open submenus within\n * the menu tree via their trigger keys.\n */\nexport function useMenuTriggerState(props: MenuTriggerProps): RootMenuTriggerState {\n let overlayTriggerState = useOverlayTriggerState(props);\n let [focusStrategy, setFocusStrategy] = useState<FocusStrategy | null>(null);\n let [expandedKeysStack, setExpandedKeysStack] = useState<Key[]>([]);\n\n let closeAll = () => {\n setExpandedKeysStack([]);\n overlayTriggerState.close();\n };\n\n let openSubmenu = (triggerKey: Key, level: number) => {\n setExpandedKeysStack(oldStack => {\n if (level > oldStack.length) {\n return oldStack;\n }\n\n return [...oldStack.slice(0, level), triggerKey];\n });\n };\n\n let closeSubmenu = (triggerKey: Key, level: number) => {\n setExpandedKeysStack(oldStack => {\n let key = oldStack[level];\n if (key === triggerKey) {\n return oldStack.slice(0, level);\n } else {\n return oldStack;\n }\n });\n };\n\n return {\n focusStrategy,\n ...overlayTriggerState,\n open(focusStrategy: FocusStrategy | null = null) {\n setFocusStrategy(focusStrategy);\n overlayTriggerState.open();\n },\n toggle(focusStrategy: FocusStrategy | null = null) {\n setFocusStrategy(focusStrategy);\n overlayTriggerState.toggle();\n },\n close() {\n closeAll();\n },\n expandedKeysStack,\n openSubmenu,\n closeSubmenu\n };\n}\n"],"names":[],"version":3,"file":"useMenuTriggerState.module.js.map"}
@@ -0,0 +1,54 @@
{
"name": "@heroui/skeleton",
"version": "2.2.17",
"description": "Skeleton is used to display the loading state of some component.",
"keywords": [
"skeleton"
],
"author": "HeroUI <support@heroui.com>",
"homepage": "https://heroui.com",
"license": "MIT",
"main": "dist/index.js",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"directory": "packages/components/skeleton"
},
"bugs": {
"url": "https://github.com/heroui-inc/heroui/issues"
},
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"@heroui/theme": ">=2.4.17",
"@heroui/system": ">=2.4.18"
},
"dependencies": {
"@heroui/shared-utils": "2.1.12"
},
"clean-package": "../../../clean-package.config.json",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsup src --dts",
"build:fast": "tsup src",
"dev": "pnpm build:fast --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit"
}
}
@@ -0,0 +1,19 @@
Copyright Node.js contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _react = require("react");
var useUnmountedRef = function useUnmountedRef() {
var unmountedRef = (0, _react.useRef)(false);
(0, _react.useEffect)(function () {
unmountedRef.current = false;
return function () {
unmountedRef.current = true;
};
}, []);
return unmountedRef;
};
var _default = exports["default"] = useUnmountedRef;
@@ -0,0 +1,96 @@
var Transform = require('readable-stream').Transform
, inherits = require('util').inherits
, xtend = require('xtend')
function DestroyableTransform(opts) {
Transform.call(this, opts)
this._destroyed = false
}
inherits(DestroyableTransform, Transform)
DestroyableTransform.prototype.destroy = function(err) {
if (this._destroyed) return
this._destroyed = true
var self = this
process.nextTick(function() {
if (err)
self.emit('error', err)
self.emit('close')
})
}
// a noop _transform function
function noop (chunk, enc, callback) {
callback(null, chunk)
}
// create a new export function, used by both the main export and
// the .ctor export, contains common logic for dealing with arguments
function through2 (construct) {
return function (options, transform, flush) {
if (typeof options == 'function') {
flush = transform
transform = options
options = {}
}
if (typeof transform != 'function')
transform = noop
if (typeof flush != 'function')
flush = null
return construct(options, transform, flush)
}
}
// main export, just make me a transform stream!
module.exports = through2(function (options, transform, flush) {
var t2 = new DestroyableTransform(options)
t2._transform = transform
if (flush)
t2._flush = flush
return t2
})
// make me a reusable prototype that I can `new`, or implicitly `new`
// with a constructor call
module.exports.ctor = through2(function (options, transform, flush) {
function Through2 (override) {
if (!(this instanceof Through2))
return new Through2(override)
this.options = xtend(options, override)
DestroyableTransform.call(this, this.options)
}
inherits(Through2, DestroyableTransform)
Through2.prototype._transform = transform
if (flush)
Through2.prototype._flush = flush
return Through2
})
module.exports.obj = through2(function (options, transform, flush) {
var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options))
t2._transform = transform
if (flush)
t2._flush = flush
return t2
})
@@ -0,0 +1,502 @@
import { encode, decode } from '@jridgewell/sourcemap-codec';
import resolver from './resolve';
import maybeSort from './sort';
import buildBySources from './by-source';
import {
memoizedState,
memoizedBinarySearch,
upperBound,
lowerBound,
found as bsFound,
} from './binary-search';
import {
COLUMN,
SOURCES_INDEX,
SOURCE_LINE,
SOURCE_COLUMN,
NAMES_INDEX,
REV_GENERATED_LINE,
REV_GENERATED_COLUMN,
} from './sourcemap-segment';
import { parse } from './types';
import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';
import type {
SourceMapV3,
DecodedSourceMap,
EncodedSourceMap,
InvalidOriginalMapping,
OriginalMapping,
InvalidGeneratedMapping,
GeneratedMapping,
SourceMapInput,
Needle,
SourceNeedle,
SourceMap,
EachMapping,
Bias,
XInput,
SectionedSourceMap,
Ro,
} from './types';
import type { Source } from './by-source';
import type { MemoState } from './binary-search';
export type { SourceMapSegment } from './sourcemap-segment';
export type {
SourceMap,
DecodedSourceMap,
EncodedSourceMap,
Section,
SectionedSourceMap,
SourceMapV3,
Bias,
EachMapping,
GeneratedMapping,
InvalidGeneratedMapping,
InvalidOriginalMapping,
Needle,
OriginalMapping,
OriginalMapping as Mapping,
SectionedSourceMapInput,
SourceMapInput,
SourceNeedle,
XInput,
EncodedSourceMapXInput,
DecodedSourceMapXInput,
SectionedSourceMapXInput,
SectionXInput,
} from './types';
interface PublicMap {
_encoded: TraceMap['_encoded'];
_decoded: TraceMap['_decoded'];
_decodedMemo: TraceMap['_decodedMemo'];
_bySources: TraceMap['_bySources'];
_bySourceMemos: TraceMap['_bySourceMemos'];
}
const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';
const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';
export const LEAST_UPPER_BOUND = -1;
export const GREATEST_LOWER_BOUND = 1;
export { FlattenMap, FlattenMap as AnyMap } from './flatten-map';
export class TraceMap implements SourceMap {
declare version: SourceMapV3['version'];
declare file: SourceMapV3['file'];
declare names: SourceMapV3['names'];
declare sourceRoot: SourceMapV3['sourceRoot'];
declare sources: SourceMapV3['sources'];
declare sourcesContent: SourceMapV3['sourcesContent'];
declare ignoreList: SourceMapV3['ignoreList'];
declare resolvedSources: string[];
declare private _encoded: string | undefined;
declare private _decoded: SourceMapSegment[][] | undefined;
declare private _decodedMemo: MemoState;
declare private _bySources: Source[] | undefined;
declare private _bySourceMemos: MemoState[] | undefined;
constructor(map: Ro<SourceMapInput>, mapUrl?: string | null) {
const isString = typeof map === 'string';
if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap;
const parsed = parse(map as Exclude<SourceMapInput, TraceMap>);
const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
this.version = version;
this.file = file;
this.names = names || [];
this.sourceRoot = sourceRoot;
this.sources = sources;
this.sourcesContent = sourcesContent;
this.ignoreList = parsed.ignoreList || (parsed as XInput).x_google_ignoreList || undefined;
const resolve = resolver(mapUrl, sourceRoot);
this.resolvedSources = sources.map(resolve);
const { mappings } = parsed;
if (typeof mappings === 'string') {
this._encoded = mappings;
this._decoded = undefined;
} else if (Array.isArray(mappings)) {
this._encoded = undefined;
this._decoded = maybeSort(mappings, isString);
} else if ((parsed as unknown as SectionedSourceMap).sections) {
throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);
} else {
throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
}
this._decodedMemo = memoizedState();
this._bySources = undefined;
this._bySourceMemos = undefined;
}
}
/**
* Typescript doesn't allow friend access to private fields, so this just casts the map into a type
* with public access modifiers.
*/
function cast(map: unknown): PublicMap {
return map as any;
}
/**
* Returns the encoded (VLQ string) form of the SourceMap's mappings field.
*/
export function encodedMappings(map: TraceMap): EncodedSourceMap['mappings'] {
return (cast(map)._encoded ??= encode(cast(map)._decoded!));
}
/**
* Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.
*/
export function decodedMappings(map: TraceMap): Readonly<DecodedSourceMap['mappings']> {
return (cast(map)._decoded ||= decode(cast(map)._encoded!));
}
/**
* A low-level API to find the segment associated with a generated line/column (think, from a
* stack trace). Line and column here are 0-based, unlike `originalPositionFor`.
*/
export function traceSegment(
map: TraceMap,
line: number,
column: number,
): Readonly<SourceMapSegment> | null {
const decoded = decodedMappings(map);
// It's common for parent source maps to have pointers to lines that have no
// mapping (like a "//# sourceMappingURL=") at the end of the child file.
if (line >= decoded.length) return null;
const segments = decoded[line];
const index = traceSegmentInternal(
segments,
cast(map)._decodedMemo,
line,
column,
GREATEST_LOWER_BOUND,
);
return index === -1 ? null : segments[index];
}
/**
* A higher-level API to find the source/line/column associated with a generated line/column
* (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in
* `source-map` library.
*/
export function originalPositionFor(
map: TraceMap,
needle: Needle,
): OriginalMapping | InvalidOriginalMapping {
let { line, column, bias } = needle;
line--;
if (line < 0) throw new Error(LINE_GTR_ZERO);
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
const decoded = decodedMappings(map);
// It's common for parent source maps to have pointers to lines that have no
// mapping (like a "//# sourceMappingURL=") at the end of the child file.
if (line >= decoded.length) return OMapping(null, null, null, null);
const segments = decoded[line];
const index = traceSegmentInternal(
segments,
cast(map)._decodedMemo,
line,
column,
bias || GREATEST_LOWER_BOUND,
);
if (index === -1) return OMapping(null, null, null, null);
const segment = segments[index];
if (segment.length === 1) return OMapping(null, null, null, null);
const { names, resolvedSources } = map;
return OMapping(
resolvedSources[segment[SOURCES_INDEX]],
segment[SOURCE_LINE] + 1,
segment[SOURCE_COLUMN],
segment.length === 5 ? names[segment[NAMES_INDEX]] : null,
);
}
/**
* Finds the generated line/column position of the provided source/line/column source position.
*/
export function generatedPositionFor(
map: TraceMap,
needle: SourceNeedle,
): GeneratedMapping | InvalidGeneratedMapping {
const { source, line, column, bias } = needle;
return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);
}
/**
* Finds all generated line/column positions of the provided source/line/column source position.
*/
export function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[] {
const { source, line, column, bias } = needle;
// SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit.
return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);
}
/**
* Iterates each mapping in generated position order.
*/
export function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void {
const decoded = decodedMappings(map);
const { names, resolvedSources } = map;
for (let i = 0; i < decoded.length; i++) {
const line = decoded[i];
for (let j = 0; j < line.length; j++) {
const seg = line[j];
const generatedLine = i + 1;
const generatedColumn = seg[0];
let source = null;
let originalLine = null;
let originalColumn = null;
let name = null;
if (seg.length !== 1) {
source = resolvedSources[seg[1]];
originalLine = seg[2] + 1;
originalColumn = seg[3];
}
if (seg.length === 5) name = names[seg[4]];
cb({
generatedLine,
generatedColumn,
source,
originalLine,
originalColumn,
name,
} as EachMapping);
}
}
}
function sourceIndex(map: TraceMap, source: string): number {
const { sources, resolvedSources } = map;
let index = sources.indexOf(source);
if (index === -1) index = resolvedSources.indexOf(source);
return index;
}
/**
* Retrieves the source content for a particular source, if its found. Returns null if not.
*/
export function sourceContentFor(map: TraceMap, source: string): string | null {
const { sourcesContent } = map;
if (sourcesContent == null) return null;
const index = sourceIndex(map, source);
return index === -1 ? null : sourcesContent[index];
}
/**
* Determines if the source is marked to ignore by the source map.
*/
export function isIgnored(map: TraceMap, source: string): boolean {
const { ignoreList } = map;
if (ignoreList == null) return false;
const index = sourceIndex(map, source);
return index === -1 ? false : ignoreList.includes(index);
}
/**
* A helper that skips sorting of the input map's mappings array, which can be expensive for larger
* maps.
*/
export function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap {
const tracer = new TraceMap(clone(map, []), mapUrl);
cast(tracer)._decoded = map.mappings;
return tracer;
}
/**
* Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
* a sourcemap, or to JSON.stringify.
*/
export function decodedMap(
map: TraceMap,
): Omit<DecodedSourceMap, 'mappings'> & { mappings: readonly SourceMapSegment[][] } {
return clone(map, decodedMappings(map));
}
/**
* Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
* a sourcemap, or to JSON.stringify.
*/
export function encodedMap(map: TraceMap): EncodedSourceMap {
return clone(map, encodedMappings(map));
}
function clone<T extends string | readonly SourceMapSegment[][]>(
map: TraceMap | DecodedSourceMap,
mappings: T,
): T extends string ? EncodedSourceMap : DecodedSourceMap {
return {
version: map.version,
file: map.file,
names: map.names,
sourceRoot: map.sourceRoot,
sources: map.sources,
sourcesContent: map.sourcesContent,
mappings,
ignoreList: map.ignoreList || (map as XInput).x_google_ignoreList,
} as any;
}
function OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping;
function OMapping(
source: string,
line: number,
column: number,
name: string | null,
): OriginalMapping;
function OMapping(
source: string | null,
line: number | null,
column: number | null,
name: string | null,
): OriginalMapping | InvalidOriginalMapping {
return { source, line, column, name } as any;
}
function GMapping(line: null, column: null): InvalidGeneratedMapping;
function GMapping(line: number, column: number): GeneratedMapping;
function GMapping(
line: number | null,
column: number | null,
): GeneratedMapping | InvalidGeneratedMapping {
return { line, column } as any;
}
function traceSegmentInternal(
segments: SourceMapSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): number;
function traceSegmentInternal(
segments: ReverseSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): number;
function traceSegmentInternal(
segments: SourceMapSegment[] | ReverseSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): number {
let index = memoizedBinarySearch(segments, column, memo, line);
if (bsFound) {
index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
} else if (bias === LEAST_UPPER_BOUND) index++;
if (index === -1 || index === segments.length) return -1;
return index;
}
function sliceGeneratedPositions(
segments: ReverseSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): GeneratedMapping[] {
let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);
// We ignored the bias when tracing the segment so that we're guarnateed to find the first (in
// insertion order) segment that matched. Even if we did respect the bias when tracing, we would
// still need to call `lowerBound()` to find the first segment, which is slower than just looking
// for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the
// binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to
// match LEAST_UPPER_BOUND.
if (!bsFound && bias === LEAST_UPPER_BOUND) min++;
if (min === -1 || min === segments.length) return [];
// We may have found the segment that started at an earlier column. If this is the case, then we
// need to slice all generated segments that match _that_ column, because all such segments span
// to our desired column.
const matchedColumn = bsFound ? column : segments[min][COLUMN];
// The binary search is not guaranteed to find the lower bound when a match wasn't found.
if (!bsFound) min = lowerBound(segments, matchedColumn, min);
const max = upperBound(segments, matchedColumn, min);
const result = [];
for (; min <= max; min++) {
const segment = segments[min];
result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));
}
return result;
}
function generatedPosition(
map: TraceMap,
source: string,
line: number,
column: number,
bias: Bias,
all: false,
): GeneratedMapping | InvalidGeneratedMapping;
function generatedPosition(
map: TraceMap,
source: string,
line: number,
column: number,
bias: Bias,
all: true,
): GeneratedMapping[];
function generatedPosition(
map: TraceMap,
source: string,
line: number,
column: number,
bias: Bias,
all: boolean,
): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] {
line--;
if (line < 0) throw new Error(LINE_GTR_ZERO);
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
const { sources, resolvedSources } = map;
let sourceIndex = sources.indexOf(source);
if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source);
if (sourceIndex === -1) return all ? [] : GMapping(null, null);
const bySourceMemos = (cast(map)._bySourceMemos ||= sources.map(memoizedState));
const generated = (cast(map)._bySources ||= buildBySources(decodedMappings(map), bySourceMemos));
const segments = generated[sourceIndex][line];
if (segments == null) return all ? [] : GMapping(null, null);
const memo = bySourceMemos[sourceIndex];
if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);
const index = traceSegmentInternal(segments, memo, line, column, bias);
if (index === -1) return GMapping(null, null);
const segment = segments[index];
return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);
}
@@ -0,0 +1 @@
{"version":3,"file":"getDescription.spec.d.ts","sourceRoot":"","sources":["../../../../src/symbol/calculations/getDescription.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,269 @@
// Original source:
// - https://github.com/facebook/react/blob/0b974418c9a56f6c560298560265dcf4b65784bc/packages/react/src/ReactCache.js
import type {
AnyFunction,
DefaultMemoizeFields,
EqualityFn,
Simplify
} from './types'
class StrongRef<T> {
constructor(private value: T) {}
deref() {
return this.value
}
}
const Ref =
typeof WeakRef !== 'undefined'
? WeakRef
: (StrongRef as unknown as typeof WeakRef)
const UNTERMINATED = 0
const TERMINATED = 1
interface UnterminatedCacheNode<T> {
/**
* Status, represents whether the cached computation returned a value or threw an error.
*/
s: 0
/**
* Value, either the cached result or an error, depending on status.
*/
v: void
/**
* Object cache, a `WeakMap` where non-primitive arguments are stored.
*/
o: null | WeakMap<Function | Object, CacheNode<T>>
/**
* Primitive cache, a regular Map where primitive arguments are stored.
*/
p: null | Map<string | number | null | void | symbol | boolean, CacheNode<T>>
}
interface TerminatedCacheNode<T> {
/**
* Status, represents whether the cached computation returned a value or threw an error.
*/
s: 1
/**
* Value, either the cached result or an error, depending on status.
*/
v: T
/**
* Object cache, a `WeakMap` where non-primitive arguments are stored.
*/
o: null | WeakMap<Function | Object, CacheNode<T>>
/**
* Primitive cache, a regular `Map` where primitive arguments are stored.
*/
p: null | Map<string | number | null | void | symbol | boolean, CacheNode<T>>
}
type CacheNode<T> = TerminatedCacheNode<T> | UnterminatedCacheNode<T>
function createCacheNode<T>(): CacheNode<T> {
return {
s: UNTERMINATED,
v: undefined,
o: null,
p: null
}
}
/**
* Configuration options for a memoization function utilizing `WeakMap` for
* its caching mechanism.
*
* @template Result - The type of the return value of the memoized function.
*
* @since 5.0.0
* @public
*/
export interface WeakMapMemoizeOptions<Result = any> {
/**
* If provided, used to compare a newly generated output value against previous values in the cache.
* If a match is found, the old value is returned. This addresses the common
* ```ts
* todos.map(todo => todo.id)
* ```
* use case, where an update to another field in the original data causes a recalculation
* due to changed references, but the output is still effectively the same.
*
* @since 5.0.0
*/
resultEqualityCheck?: EqualityFn<Result>
}
/**
* Creates a tree of `WeakMap`-based cache nodes based on the identity of the
* arguments it's been called with (in this case, the extracted values from your input selectors).
* This allows `weakMapMemoize` to have an effectively infinite cache size.
* Cache results will be kept in memory as long as references to the arguments still exist,
* and then cleared out as the arguments are garbage-collected.
*
* __Design Tradeoffs for `weakMapMemoize`:__
* - Pros:
* - It has an effectively infinite cache size, but you have no control over
* how long values are kept in cache as it's based on garbage collection and `WeakMap`s.
* - Cons:
* - There's currently no way to alter the argument comparisons.
* They're based on strict reference equality.
* - It's roughly the same speed as `lruMemoize`, although likely a fraction slower.
*
* __Use Cases for `weakMapMemoize`:__
* - This memoizer is likely best used for cases where you need to call the
* same selector instance with many different arguments, such as a single
* selector instance that is used in a list item component and called with
* item IDs like:
* ```ts
* useSelector(state => selectSomeData(state, props.category))
* ```
* @param func - The function to be memoized.
* @returns A memoized function with a `.clearCache()` method attached.
*
* @example
* <caption>Using `createSelector`</caption>
* ```ts
* import { createSelector, weakMapMemoize } from 'reselect'
*
* interface RootState {
* items: { id: number; category: string; name: string }[]
* }
*
* const selectItemsByCategory = createSelector(
* [
* (state: RootState) => state.items,
* (state: RootState, category: string) => category
* ],
* (items, category) => items.filter(item => item.category === category),
* {
* memoize: weakMapMemoize,
* argsMemoize: weakMapMemoize
* }
* )
* ```
*
* @example
* <caption>Using `createSelectorCreator`</caption>
* ```ts
* import { createSelectorCreator, weakMapMemoize } from 'reselect'
*
* const createSelectorWeakMap = createSelectorCreator({ memoize: weakMapMemoize, argsMemoize: weakMapMemoize })
*
* const selectItemsByCategory = createSelectorWeakMap(
* [
* (state: RootState) => state.items,
* (state: RootState, category: string) => category
* ],
* (items, category) => items.filter(item => item.category === category)
* )
* ```
*
* @template Func - The type of the function that is memoized.
*
* @see {@link https://reselect.js.org/api/weakMapMemoize `weakMapMemoize`}
*
* @since 5.0.0
* @public
* @experimental
*/
export function weakMapMemoize<Func extends AnyFunction>(
func: Func,
options: WeakMapMemoizeOptions<ReturnType<Func>> = {}
) {
let fnNode = createCacheNode()
const { resultEqualityCheck } = options
let lastResult: WeakRef<object> | undefined
let resultsCount = 0
function memoized() {
let cacheNode = fnNode
const { length } = arguments
for (let i = 0, l = length; i < l; i++) {
const arg = arguments[i]
if (
typeof arg === 'function' ||
(typeof arg === 'object' && arg !== null)
) {
// Objects go into a WeakMap
let objectCache = cacheNode.o
if (objectCache === null) {
cacheNode.o = objectCache = new WeakMap()
}
const objectNode = objectCache.get(arg)
if (objectNode === undefined) {
cacheNode = createCacheNode()
objectCache.set(arg, cacheNode)
} else {
cacheNode = objectNode
}
} else {
// Primitives go into a regular Map
let primitiveCache = cacheNode.p
if (primitiveCache === null) {
cacheNode.p = primitiveCache = new Map()
}
const primitiveNode = primitiveCache.get(arg)
if (primitiveNode === undefined) {
cacheNode = createCacheNode()
primitiveCache.set(arg, cacheNode)
} else {
cacheNode = primitiveNode
}
}
}
const terminatedNode = cacheNode as unknown as TerminatedCacheNode<any>
let result
if (cacheNode.s === TERMINATED) {
result = cacheNode.v
} else {
// Allow errors to propagate
result = func.apply(null, arguments as unknown as any[])
resultsCount++
if (resultEqualityCheck) {
const lastResultValue = lastResult?.deref?.() ?? lastResult
if (
lastResultValue != null &&
resultEqualityCheck(lastResultValue as ReturnType<Func>, result)
) {
result = lastResultValue
resultsCount !== 0 && resultsCount--
}
const needsWeakRef =
(typeof result === 'object' && result !== null) ||
typeof result === 'function'
lastResult = needsWeakRef ? new Ref(result) : result
}
}
terminatedNode.s = TERMINATED
terminatedNode.v = result
return result
}
memoized.clearCache = () => {
fnNode = createCacheNode()
memoized.resetResultsCount()
}
memoized.resultsCount = () => resultsCount
memoized.resetResultsCount = () => {
resultsCount = 0
}
return memoized as Func & Simplify<DefaultMemoizeFields>
}
@@ -0,0 +1,200 @@
import * as _vitest_spy from '@vitest/spy';
import vm from 'node:vm';
import * as viteModuleRunner from 'vite/module-runner';
import { ModuleEvaluator, ModuleRunnerImportMeta, ModuleRunnerContext, EvaluatedModuleNode, FetchFunction, EvaluatedModules } from 'vite/module-runner';
import { R as RuntimeRPC, e as ResolveFunctionResult, W as WorkerGlobalState } from './worker.d.ZGohxCEd.js';
import { MockedModule, MockedModuleType } from '@vitest/mocker';
import { P as PendingSuiteMock, b as MockFactory, a as MockOptions } from './mocker.d.BE_2ls6u.js';
declare class FileMap {
private fsCache;
private fsBufferCache;
readFileAsync(path: string): Promise<string>;
readFile(path: string): string;
readBuffer(path: string): Buffer<ArrayBuffer>;
}
interface ModuleEvaluateOptions {
timeout?: vm.RunningScriptOptions["timeout"] | undefined;
breakOnSigint?: vm.RunningScriptOptions["breakOnSigint"] | undefined;
}
type ModuleLinker = (specifier: string, referencingModule: VMModule, extra: {
assert: object;
}) => VMModule | Promise<VMModule>;
type ModuleStatus = "unlinked" | "linking" | "linked" | "evaluating" | "evaluated" | "errored";
declare class VMModule {
dependencySpecifiers: readonly string[];
error: any;
identifier: string;
context: vm.Context;
namespace: object;
status: ModuleStatus;
evaluate(options?: ModuleEvaluateOptions): Promise<void>;
link(linker: ModuleLinker): Promise<void>;
}
interface ExternalModulesExecutorOptions {
context: vm.Context;
fileMap: FileMap;
packageCache: Map<string, any>;
transform: RuntimeRPC["transform"];
interopDefault?: boolean;
viteClientModule: Record<string, unknown>;
}
declare class ExternalModulesExecutor {
#private;
private options;
private cjs;
private esm;
private vite;
private context;
private fs;
private resolvers;
constructor(options: ExternalModulesExecutorOptions);
import(identifier: string): Promise<object>;
require(identifier: string): any;
createRequire(identifier: string): NodeJS.Require;
importModuleDynamically: (specifier: string, referencer: VMModule) => Promise<VMModule>;
resolveModule: (specifier: string, referencer: string) => Promise<VMModule>;
resolve(specifier: string, parent: string): string;
private getModuleInformation;
private createModule;
private get isNetworkSupported();
}
type ModuleExecutionInfo = Map<string, ModuleExecutionInfoEntry>;
interface ModuleExecutionInfoEntry {
startOffset: number;
/** The duration that was spent executing the module. */
duration: number;
/** The time that was spent executing the module itself and externalized imports. */
selfTime: number;
}
interface VitestModuleEvaluatorOptions {
interopDefault?: boolean | undefined;
moduleExecutionInfo?: ModuleExecutionInfo;
getCurrentTestFilepath?: () => string | undefined;
compiledFunctionArgumentsNames?: string[];
compiledFunctionArgumentsValues?: unknown[];
}
declare class VitestModuleEvaluator implements ModuleEvaluator {
private options;
stubs: Record<string, any>;
env: ModuleRunnerImportMeta["env"];
private vm;
private compiledFunctionArgumentsNames?;
private compiledFunctionArgumentsValues;
private primitives;
private debug;
constructor(vmOptions?: VitestVmOptions | undefined, options?: VitestModuleEvaluatorOptions);
private convertIdToImportUrl;
runExternalModule(id: string): Promise<any>;
runInlinedModule(context: ModuleRunnerContext, code: string, module: Readonly<EvaluatedModuleNode>): Promise<any>;
private createRequire;
private shouldInterop;
}
declare function createImportMetaEnvProxy(): ModuleRunnerImportMeta["env"];
declare function getDefaultRequestStubs(context?: vm.Context): Record<string, any>;
declare function isPrimitive(v: any): boolean;
declare function wrapId(id: string): string;
declare function unwrapId(id: string): string;
interface VitestTransportOptions {
fetchModule: FetchFunction;
resolveId: (id: string, importer?: string) => Promise<ResolveFunctionResult | null>;
}
interface MockContext {
/**
* When mocking with a factory, this refers to the module that imported the mock.
*/
callstack: null | string[];
}
interface VitestMockerOptions {
context?: vm.Context;
spyModule?: typeof _vitest_spy;
root: string;
moduleDirectories: string[];
resolveId: (id: string, importer?: string) => Promise<{
id: string;
file: string;
url: string;
} | null>;
getCurrentTestFilepath: () => string | undefined;
}
declare class VitestMocker {
moduleRunner: VitestModuleRunner;
private options;
static pendingIds: PendingSuiteMock[];
private spyModule?;
private primitives;
private filterPublicKeys;
private registries;
private mockContext;
constructor(moduleRunner: VitestModuleRunner, options: VitestMockerOptions);
private get root();
private get evaluatedModules();
private get moduleDirectories();
initializeSpyModule(): Promise<void>;
private getMockerRegistry;
reset(): void;
private invalidateModuleById;
private isModuleDirectory;
getSuiteFilepath(): string;
private createError;
resolveId(rawId: string, importer?: string): Promise<{
id: string;
url: string;
external: string | null;
}>;
resolveMocks(): Promise<void>;
private ensureModule;
private callFunctionMock;
getMockContext(): MockContext;
getMockPath(dep: string): string;
getDependencyMock(id: string): MockedModule | undefined;
findMockRedirect(mockPath: string, external: string | null): string | null;
mockObject(object: Record<string | symbol, any>, mockExports?: Record<string | symbol, any>, behavior?: "automock" | "autospy"): Record<string | symbol, any>;
unmockPath(id: string): void;
mockPath(originalId: string, id: string, url: string, external: string | null, mockType: MockedModuleType | undefined, factory: MockFactory | undefined): void;
importActual<T>(rawId: string, importer: string, callstack?: string[] | null): Promise<T>;
importMock(rawId: string, importer: string): Promise<any>;
requestWithMockedModule(url: string, evaluatedNode: EvaluatedModuleNode, callstack: string[], mock: MockedModule): Promise<any>;
mockedRequest(url: string, evaluatedNode: EvaluatedModuleNode, callstack: string[]): Promise<any>;
queueMock(id: string, importer: string, factoryOrOptions?: MockFactory | MockOptions): void;
queueUnmock(id: string, importer: string): void;
}
declare module "vite/module-runner" {
interface EvaluatedModuleNode {
mockedExports?: Record<string, any>;
}
}
type CreateImportMeta = NonNullable<viteModuleRunner.ModuleRunnerOptions["createImportMeta"]>;
declare class VitestModuleRunner extends viteModuleRunner.ModuleRunner {
private vitestOptions;
mocker: VitestMocker;
moduleExecutionInfo: ModuleExecutionInfo;
constructor(vitestOptions: VitestModuleRunnerOptions);
import(rawId: string): Promise<any>;
fetchModule(url: string, importer?: string): Promise<EvaluatedModuleNode>;
private _cachedRequest;
}
interface VitestModuleRunnerOptions {
transport: VitestTransportOptions;
evaluator: VitestModuleEvaluator;
evaluatedModules: EvaluatedModules;
getWorkerState: () => WorkerGlobalState;
mocker?: VitestMocker;
vm?: VitestVmOptions;
spyModule?: typeof _vitest_spy;
createImportMeta?: CreateImportMeta;
}
interface VitestVmOptions {
context: vm.Context;
externalModulesExecutor: ExternalModulesExecutor;
}
export { VitestModuleRunner as V, VitestModuleEvaluator as b, createImportMetaEnvProxy as c, getDefaultRequestStubs as g, isPrimitive as i, unwrapId as u, wrapId as w };
export type { VitestModuleEvaluatorOptions as a };
@@ -0,0 +1 @@
{"name":"compressing","version":"1.10.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532099579,"integrity":"sha512-aCFM213omrKW2buyYtaDr82XkHUgYdNflN3vTLE0z8yhzVvcUyQDqPm7dPwRPitMWC2FIqsl9LZ6BWF5rCN3Tw==","mode":420,"size":1100},"lib/base_stream.js":{"checkedAt":1794532099579,"integrity":"sha512-r2RVeICE4Ck7i+2HifVf6hRws3yOtXjd0pW3wr5WNf3wK8SFM+B49muvnWlpQmGgwessDKqnry+Qc30VucBmGA==","mode":420,"size":454},"lib/base_write_stream.js":{"checkedAt":1794532099580,"integrity":"sha512-9ugJ3/e5mievM/D5rRuxD4f39ty4cygAQG0o792Esp8GWqVDFEoxO1FEdMCa3QduUr51NNvtsr0LJJy6WbV9kw==","mode":420,"size":369},"lib/gzip/file_stream.js":{"checkedAt":1794532099580,"integrity":"sha512-bpmdwe6T9tObI7IuGXw8B76GltfDatLyxL55urcAU/ghV52beCEI5K4kieqHpL1+lZReCwsjnHqea8/qaSs4oQ==","mode":420,"size":946},"lib/tar/file_stream.js":{"checkedAt":1794532099580,"integrity":"sha512-szbwSeZCe7VLWTIkFA5czuXUGE/beg3/BhLmKHnnzYloHUnEOk0MljTf2pNPeVMAqZdHS5B3/kJZGP3VFnJW7A==","mode":420,"size":2748},"lib/tgz/file_stream.js":{"checkedAt":1794532099580,"integrity":"sha512-V7dTP2Xc1gHEWcj4upe6UWdvUGrEQRDoQlQJZDQos6nP0gb8WBHkL2HWBi39trDtuaWOpuPI4Dy/xLxJBMZAXQ==","mode":420,"size":1205},"lib/zip/file_stream.js":{"checkedAt":1794532099580,"integrity":"sha512-OpIqRhD2ICojlFT4fQf7g5os9DAf7Rn414WdqOKo2H4Hr7Dpsl/ZZX0Tmgvl4cfj/ZZoZRi7FGmGlB0QZ7LXZA==","mode":420,"size":1667},"index.js":{"checkedAt":1794532099581,"integrity":"sha512-eAU8A3Qz7k5g9yOXUm2NORJYnUgl8S9SdXKLcSCi1Ttx4vcqKe1iQIqccjGq+g7f9Ga4aY+yl3ieoxv08tCJPA==","mode":420,"size":161},"lib/gzip/index.js":{"checkedAt":1794532099581,"integrity":"sha512-blTIGn8y40KruziLlUseevPxgHP8CBq9a/d8rgAyvPosUGPpD2SJ315yXbw9BsQ/epM1RZgUAeUixCyCFm0QPA==","mode":420,"size":447},"lib/tar/index.js":{"checkedAt":1794532099581,"integrity":"sha512-JUyhLW5HkQ/mtTA9YSSej/M27Vg4PyxfvVS4JRavYz7XW+smGO6AMqf9VTK8w2NT8iD5IHPOGvMjh7ZrKV/lBw==","mode":420,"size":563},"lib/tgz/index.js":{"checkedAt":1794532099581,"integrity":"sha512-AwIZk9K7HZvF9T2pHO/qZB/hb3rfQzAYIMLdTJbaRIwbQ07eKXE3tuvQotlTP+Q5Vzv/oEe2/zpqeVLnNaRyyA==","mode":420,"size":563},"lib/zip/index.js":{"checkedAt":1794532099581,"integrity":"sha512-lCUrR+ijL34Tqve+7rdvaYUcabVo6KG40FScd0Y4b5mC+F/gT8KpA2VWkOKOpzRy6UOCLl1+lqAqGK/8vhXoEg==","mode":420,"size":563},"lib/tar/stream.js":{"checkedAt":1794532099582,"integrity":"sha512-1U4SJ5LLIZvZgQps2DoQkSvDwQHY8XoKpjE3WGObN1SSX7kP/Pj52iIjHk6zuPzOp6Du7LQtFCn0UXZU/v3oGw==","mode":420,"size":4408},"lib/tgz/stream.js":{"checkedAt":1794532099582,"integrity":"sha512-JCiLb0fPuwkgoKIHdCuCwf10+K23gSqJMB+eL3AZQKIK3k9QBbVmSYRT+FoOsPsDCKO/8MdJcHXuI94IR1UGSA==","mode":420,"size":672},"lib/zip/stream.js":{"checkedAt":1794532099582,"integrity":"sha512-nAPheDwCbtlh6OFb7ZV/gHMZq9ZZKc0znr+/n6IPtkJg9JOo/evH037n8Fflf3hCUi24F1vOeqXyFvwfdtSxgQ==","mode":420,"size":1195},"lib/gzip/uncompress_stream.js":{"checkedAt":1794532099582,"integrity":"sha512-v+PaeZkzsWA7phkfMJqDdJYjYnjSL0TFytWRiceAL0kHw4ig1waEtpV1DpYrMi7D2RlVNDIeXdT3p7xufeKQOg==","mode":420,"size":958},"lib/tar/uncompress_stream.js":{"checkedAt":1794532099582,"integrity":"sha512-e/Qdh6NNz4yh1zq+G6cfWQ1mLl8FvN0dt4Vy2MVD4MPRYoYWoctvShahZXImTL5skX6fw0LfFhacLr9Ol8dSdQ==","mode":420,"size":976},"lib/tgz/uncompress_stream.js":{"checkedAt":1794532099582,"integrity":"sha512-tIFoN7kkkC/rgjoSzQpZLBje4Ekioeyaso/htD4VvZMGcQeXOYnj5eJYnWdYMoDXhaT9a34GCh+Y37pP76VhSg==","mode":420,"size":1783},"lib/zip/uncompress_stream.js":{"checkedAt":1794532099582,"integrity":"sha512-JItEjuOTqQI/JRDX7aa0zwIexxg6jEUiC3n/RDFc/BJcUsUhmCr4gOmAJPOiNY/oxyyLrGvouhLqmTvrzDIsew==","mode":420,"size":4243},"lib/utils.js":{"checkedAt":1794532099583,"integrity":"sha512-d2vMHm0w17fGaInoGvgDgvnhBJipb6I6V90y3SwGWixKp73slBVfkt/bdwkzFjBcWauJviaUNCxWSmh0OvprbQ==","mode":420,"size":6608},"package.json":{"checkedAt":1794532099583,"integrity":"sha512-WlZJ53mrLX/OPRD05SwzoU/jYMk6j7zC2zi70XpL7sOmfauC6usLWEpiro0OruPYrmZFv3BiaHDniil26jUPAg==","mode":420,"size":1598},"README.md":{"checkedAt":1794532099583,"integrity":"sha512-Y8T/hBvpbiLW61/QsILaC/GbNu8LRCMWv0WRxiHypT29uTnT0z5DTWCW5eltEUCsA74B11omerF6VbFGC8v0FA==","mode":420,"size":12893},"index.d.ts":{"checkedAt":1794532099583,"integrity":"sha512-k6Fz2p3Dk8ApbBt8FXrj9Kt0uTgJWhq5uK6v1kow5U19Dl7AcCx+2wvMISGientvHRYO1BSd6KJbgxLNdC4HCQ==","mode":420,"size":4952}}}
@@ -0,0 +1,42 @@
"use strict"
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Intl.ListFormat` object.",
category: "ES2021-Intl-API",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-intl-listformat.html",
},
fixable: null,
messages: {
forbidden: "ES2021 Intl API '{{name}}' object is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"(program) {
const sourceCode = getSourceCode(context)
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences({
Intl: {
ListFormat: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1 @@
{"name":"pend","version":"1.2.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532099627,"integrity":"sha512-VVOn7n5+Z2nxSCPf1VbEDXCMeBhTo5fqO4Wso4Mpdane5KHvX6je6NPfu9Ls2Jm1N6yAOhKpaKYqO638w6e6GA==","mode":436,"size":410},"README.md":{"checkedAt":1794532099627,"integrity":"sha512-B5eqMJbz0G3GXsIs33zLUatziNbOhVQ8TOCZsRdJ6CRchGxaLb/9AmzdcL3HQCvXfCP4fSFzpZqePSFBtsOfjA==","mode":436,"size":973},"LICENSE":{"checkedAt":1794532099628,"integrity":"sha512-RHTsEagUhUT3foeF7sS661cGrHdn4JMzFWrhe2aaXyomJ61dT3eQwRGj/PXnWqNdpCXoUiANsFc1V8ssWX8ydw==","mode":436,"size":1082},"index.js":{"checkedAt":1794532099628,"integrity":"sha512-e1xLTS99rvbpkDjcN4Wf7dSwWTQMrCWM6mKwr1TRb/1n4RfQKM00zE8idCZ0pYPamKV2D3LoZ6ZElNBksadLXQ==","mode":436,"size":1101},"test.js":{"checkedAt":1794532099628,"integrity":"sha512-QLylbGpD6zgZB60QQKzimfJaPOn7xRlsSC1uPqCsZOo3yaml+Jv5Y8cgFsxEHl1OllHSlUgqw5MpP5fOgo3SxQ==","mode":436,"size":2449}}}
@@ -0,0 +1,25 @@
'use strict';
var gOPD = require('gopd');
var bind = require('function-bind');
var unbound = gOPD && gOPD(function () {}, 'length');
// @ts-expect-error ts(2555) TS is overly strict with .call
var bound = gOPD && gOPD(bind.call(function () {}), 'length');
var functionsHaveConfigurableLengths = !!(unbound && unbound.configurable);
var functionsHaveWritableLengths = !!(unbound && unbound.writable);
var boundFnsHaveConfigurableLengths = !!(bound && bound.configurable);
var boundFnsHaveWritableLengths = !!(bound && bound.writable);
/** @type {import('./env')} */
module.exports = {
__proto__: null,
boundFnsHaveConfigurableLengths: boundFnsHaveConfigurableLengths,
boundFnsHaveWritableLengths: boundFnsHaveWritableLengths,
functionsHaveConfigurableLengths: functionsHaveConfigurableLengths,
functionsHaveWritableLengths: functionsHaveWritableLengths
};
@@ -0,0 +1,42 @@
'use strict';
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
var IsExtensible = require('./IsExtensible');
var isPropertyKey = require('../helpers/isPropertyKey');
// https://262.ecma-international.org/13.0/#sec-definemethodproperty
module.exports = function DefineMethodProperty(homeObject, key, closure, enumerable) {
if (!isObject(homeObject)) {
throw new $TypeError('Assertion failed: `homeObject` is not an Object');
}
if (!isPropertyKey(key)) {
throw new $TypeError('Assertion failed: `key` is not a Property Key or a Private Name');
}
if (typeof closure !== 'function') {
throw new $TypeError('Assertion failed: `closure` is not a function');
}
if (typeof enumerable !== 'boolean') {
throw new $TypeError('Assertion failed: `enumerable` is not a Boolean');
}
// 1. Assert: homeObject is an ordinary, extensible object with no non-configurable properties.
if (!IsExtensible(homeObject)) {
throw new $TypeError('Assertion failed: `homeObject` is not an ordinary, extensible object, with no non-configurable properties');
}
// 2. If key is a Private Name, then
// a. Return PrivateElement { [[Key]]: key, [[Kind]]: method, [[Value]]: closure }.
// 3. Else,
var desc = { // step 3.a
'[[Value]]': closure,
'[[Writable]]': true,
'[[Enumerable]]': enumerable,
'[[Configurable]]': true
};
DefinePropertyOrThrow(homeObject, key, desc); // step 3.b
};
@@ -0,0 +1,21 @@
import Agent from './agent'
import Dispatcher from './dispatcher'
export default EnvHttpProxyAgent
declare class EnvHttpProxyAgent extends Dispatcher {
constructor(opts?: EnvHttpProxyAgent.Options)
dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
}
declare namespace EnvHttpProxyAgent {
export interface Options extends Agent.Options {
/** Overrides the value of the HTTP_PROXY environment variable */
httpProxy?: string;
/** Overrides the value of the HTTPS_PROXY environment variable */
httpsProxy?: string;
/** Overrides the value of the NO_PROXY environment variable */
noProxy?: string;
}
}
@@ -0,0 +1,118 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "знаци", verb: "да имаат" },
file: { unit: "бајти", verb: "да имаат" },
array: { unit: "ставки", verb: "да имаат" },
set: { unit: "ставки", verb: "да имаат" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "број";
}
case "object": {
if (Array.isArray(data)) {
return "низа";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "внес",
email: "адреса на е-пошта",
url: "URL",
emoji: "емоџи",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO датум и време",
date: "ISO датум",
time: "ISO време",
duration: "ISO времетраење",
ipv4: "IPv4 адреса",
ipv6: "IPv6 адреса",
cidrv4: "IPv4 опсег",
cidrv6: "IPv6 опсег",
base64: "base64-енкодирана низа",
base64url: "base64url-енкодирана низа",
json_string: "JSON низа",
e164: "E.164 број",
jwt: "JWT",
template_literal: "внес",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Грешен внес: се очекува ${issue.expected}, примено ${parsedType(issue.input)}`;
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;
return `Грешана опција: се очекува една ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да има ${adj}${issue.maximum.toString()} ${sizing.unit ?? "елементи"}`;
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да биде ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Премногу мал: се очекува ${issue.origin} да има ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Премногу мал: се очекува ${issue.origin} да биде ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Неважечка низа: мора да започнува со "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Неважечка низа: мора да завршува со "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Неважечка низа: мора да вклучува "${_issue.includes}"`;
if (_issue.format === "regex")
return `Неважечка низа: мора да одгоара на патернот ${_issue.pattern}`;
return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Грешен број: мора да биде делив со ${issue.divisor}`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Непрепознаени клучеви" : "Непрепознаен клуч"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Грешен клуч во ${issue.origin}`;
case "invalid_union":
return "Грешен внес";
case "invalid_element":
return `Грешна вредност во ${issue.origin}`;
default:
return `Грешен внес`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,17 @@
"use strict";
var Attributes_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Attributes = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const asn1_x509_1 = require("@peculiar/asn1-x509");
let Attributes = Attributes_1 = class Attributes extends asn1_schema_1.AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, Attributes_1.prototype);
}
};
exports.Attributes = Attributes;
exports.Attributes = Attributes = Attributes_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: asn1_x509_1.Attribute })
], Attributes);
@@ -0,0 +1,15 @@
"use strict";
/*
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
Copyrights licensed under the New BSD License.
See the accompanying LICENSE file for terms.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.IntlMessageFormat = void 0;
var tslib_1 = require("tslib");
var core_1 = require("./src/core");
Object.defineProperty(exports, "IntlMessageFormat", { enumerable: true, get: function () { return core_1.IntlMessageFormat; } });
tslib_1.__exportStar(require("./src/core"), exports);
tslib_1.__exportStar(require("./src/error"), exports);
tslib_1.__exportStar(require("./src/formatters"), exports);
exports.default = core_1.IntlMessageFormat;
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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 truncated
@@ -0,0 +1,98 @@
#!/usr/bin/env python3
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
class TestFindCycles(unittest.TestCase):
def setUp(self):
self.nodes = {}
for x in ("a", "b", "c", "d", "e"):
self.nodes[x] = gyp.input.DependencyGraphNode(x)
def _create_dependency(self, dependent, dependency):
dependent.dependencies.append(dependency)
dependency.dependents.append(dependent)
def test_no_cycle_empty_graph(self):
for label, node in self.nodes.items():
self.assertEqual([], node.FindCycles())
def test_no_cycle_line(self):
self._create_dependency(self.nodes["a"], self.nodes["b"])
self._create_dependency(self.nodes["b"], self.nodes["c"])
self._create_dependency(self.nodes["c"], self.nodes["d"])
for label, node in self.nodes.items():
self.assertEqual([], node.FindCycles())
def test_no_cycle_dag(self):
self._create_dependency(self.nodes["a"], self.nodes["b"])
self._create_dependency(self.nodes["a"], self.nodes["c"])
self._create_dependency(self.nodes["b"], self.nodes["c"])
for label, node in self.nodes.items():
self.assertEqual([], node.FindCycles())
def test_cycle_self_reference(self):
self._create_dependency(self.nodes["a"], self.nodes["a"])
self.assertEqual(
[[self.nodes["a"], self.nodes["a"]]], self.nodes["a"].FindCycles()
)
def test_cycle_two_nodes(self):
self._create_dependency(self.nodes["a"], self.nodes["b"])
self._create_dependency(self.nodes["b"], self.nodes["a"])
self.assertEqual(
[[self.nodes["a"], self.nodes["b"], self.nodes["a"]]],
self.nodes["a"].FindCycles(),
)
self.assertEqual(
[[self.nodes["b"], self.nodes["a"], self.nodes["b"]]],
self.nodes["b"].FindCycles(),
)
def test_two_cycles(self):
self._create_dependency(self.nodes["a"], self.nodes["b"])
self._create_dependency(self.nodes["b"], self.nodes["a"])
self._create_dependency(self.nodes["b"], self.nodes["c"])
self._create_dependency(self.nodes["c"], self.nodes["b"])
cycles = self.nodes["a"].FindCycles()
self.assertTrue([self.nodes["a"], self.nodes["b"], self.nodes["a"]] in cycles)
self.assertTrue([self.nodes["b"], self.nodes["c"], self.nodes["b"]] in cycles)
self.assertEqual(2, len(cycles))
def test_big_cycle(self):
self._create_dependency(self.nodes["a"], self.nodes["b"])
self._create_dependency(self.nodes["b"], self.nodes["c"])
self._create_dependency(self.nodes["c"], self.nodes["d"])
self._create_dependency(self.nodes["d"], self.nodes["e"])
self._create_dependency(self.nodes["e"], self.nodes["a"])
self.assertEqual(
[
[
self.nodes["a"],
self.nodes["b"],
self.nodes["c"],
self.nodes["d"],
self.nodes["e"],
self.nodes["a"],
]
],
self.nodes["a"].FindCycles(),
)
if __name__ == "__main__":
unittest.main()
@@ -0,0 +1,9 @@
<svg viewbox="0 0 18 18">
<g class="ql-fill ql-stroke ql-thin ql-transparent">
<rect height="3" rx="0.5" ry="0.5" width="7" x="4.5" y="2.5"></rect>
<rect height="3" rx="0.5" ry="0.5" width="7" x="4.5" y="12.5"></rect>
</g>
<rect class="ql-fill ql-stroke ql-thin" height="3" rx="0.5" ry="0.5" width="7" x="8.5" y="7.5"></rect>
<polygon class="ql-fill ql-stroke ql-thin" points="4.5 11 2.5 9 4.5 7 4.5 11"></polygon>
<line class="ql-stroke" x1="6" x2="4" y1="9" y2="9"></line>
</svg>

After

Width:  |  Height:  |  Size: 499 B

@@ -0,0 +1,6 @@
var diagnostics = require('./');
//
// No way to override `debug` with `diagnostics` in the browser.
//
module.exports = diagnostics;
@@ -0,0 +1,68 @@
'use strict';
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var Call = require('./Call');
var CreateDataProperty = require('./CreateDataProperty');
var EnumerableOwnPropertyNames = require('./EnumerableOwnPropertyNames');
var Get = require('./Get');
var IsArray = require('./IsArray');
var ToLength = require('./ToLength');
var ToString = require('./ToString');
var forEach = require('../helpers/forEach');
// https://262.ecma-international.org/9.0/#sec-internalizejsonproperty
// note: `reviver` was implicitly closed-over until ES2020, where it becomes a third argument
module.exports = function InternalizeJSONProperty(holder, name, reviver) {
if (!isObject(holder)) {
throw new $TypeError('Assertion failed: `holder` is not an Object');
}
if (typeof name !== 'string') {
throw new $TypeError('Assertion failed: `name` is not a String');
}
if (typeof reviver !== 'function') {
throw new $TypeError('Assertion failed: `reviver` is not a Function');
}
var val = Get(holder, name); // step 1
if (isObject(val)) { // step 2
var isArray = IsArray(val); // step 2.a
if (isArray) { // step 2.b
var I = 0; // step 2.b.i
var len = ToLength(Get(val, 'length')); // step 2.b.ii
while (I < len) { // step 2.b.iii
var newElement = InternalizeJSONProperty(val, ToString(I), reviver); // step 2.b.iv.1
if (typeof newElement === 'undefined') { // step 2.b.iii.2
delete val[ToString(I)]; // step 2.b.iii.2.a
} else { // step 2.b.iii.3
CreateDataProperty(val, ToString(I), newElement); // step 2.b.iii.3.a
}
I += 1; // step 2.b.iii.4
}
} else { // step 2.c
var keys = EnumerableOwnPropertyNames(val, 'key'); // step 2.c.i
forEach(keys, function (P) { // step 2.c.ii
// eslint-disable-next-line no-shadow
var newElement = InternalizeJSONProperty(val, P, reviver); // step 2.c.ii.1
if (typeof newElement === 'undefined') { // step 2.c.ii.2
delete val[P]; // step 2.c.ii.2.a
} else { // step 2.c.ii.3
CreateDataProperty(val, P, newElement); // step 2.c.ii.3.a
}
});
}
}
return Call(reviver, holder, [name, val]); // step 3
};
@@ -0,0 +1,60 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZodMiniISODuration = exports.ZodMiniISOTime = exports.ZodMiniISODate = exports.ZodMiniISODateTime = void 0;
exports.datetime = datetime;
exports.date = date;
exports.time = time;
exports.duration = duration;
const core = __importStar(require("../core/index.cjs"));
const schemas = __importStar(require("./schemas.cjs"));
exports.ZodMiniISODateTime = core.$constructor("$ZodISODateTime", (inst, def) => {
core.$ZodISODateTime.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
function datetime(params) {
return core._isoDateTime(exports.ZodMiniISODateTime, params);
}
exports.ZodMiniISODate = core.$constructor("$ZodISODate", (inst, def) => {
core.$ZodISODate.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
function date(params) {
return core._isoDate(exports.ZodMiniISODate, params);
}
exports.ZodMiniISOTime = core.$constructor("$ZodISOTime", (inst, def) => {
core.$ZodISOTime.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
function time(params) {
return core._isoTime(exports.ZodMiniISOTime, params);
}
exports.ZodMiniISODuration = core.$constructor("$ZodISODuration", (inst, def) => {
core.$ZodISODuration.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
function duration(params) {
return core._isoDuration(exports.ZodMiniISODuration, params);
}
@@ -0,0 +1,6 @@
<svg viewbox="0 0 18 18">
<polyline class="ql-stroke" points="3.5 14 7 4 10.5 14"></polyline>
<line class="ql-stroke" x1="9.45" x2="4.55" y1="11" y2="11"></line>
<path class="ql-fill" d="M12.09,7.55l1.7-1.473a0.337,0.337,0,0,1,.429,0l1.7,1.473A0.261,0.261,0,0,1,15.7,8H12.3A0.261,0.261,0,0,1,12.09,7.55Z"></path>
<path class="ql-fill" d="M12.09,10.45l1.7,1.473a0.337,0.337,0,0,0,.429,0l1.7-1.473A0.261,0.261,0,0,0,15.7,10H12.3A0.261,0.261,0,0,0,12.09,10.45Z"></path>
</svg>

After

Width:  |  Height:  |  Size: 481 B

@@ -0,0 +1,47 @@
export * from './CanonicalizeLocaleList';
export * from './CanonicalizeTimeZoneName';
export * from './CoerceOptionsToObject';
export * from './GetNumberOption';
export * from './GetOption';
export * from './GetOptionsObject';
export * from './GetStringOrBooleanOption';
export * from './IsSanctionedSimpleUnitIdentifier';
export * from './IsValidTimeZoneName';
export * from './IsWellFormedCurrencyCode';
export * from './IsWellFormedUnitIdentifier';
export * from './NumberFormat/ApplyUnsignedRoundingMode';
export * from './NumberFormat/CollapseNumberRange';
export * from './NumberFormat/ComputeExponent';
export * from './NumberFormat/ComputeExponentForMagnitude';
export * from './NumberFormat/CurrencyDigits';
export { default as _formatToParts } from './NumberFormat/format_to_parts';
export * from './NumberFormat/FormatApproximately';
export * from './NumberFormat/FormatNumeric';
export * from './NumberFormat/FormatNumericRange';
export * from './NumberFormat/FormatNumericRangeToParts';
export * from './NumberFormat/FormatNumericToParts';
export * from './NumberFormat/FormatNumericToString';
export * from './NumberFormat/GetUnsignedRoundingMode';
export * from './NumberFormat/InitializeNumberFormat';
export * from './NumberFormat/PartitionNumberPattern';
export * from './NumberFormat/PartitionNumberRangePattern';
export * from './NumberFormat/SetNumberFormatDigitOptions';
export * from './NumberFormat/SetNumberFormatUnitOptions';
export * from './NumberFormat/ToRawFixed';
export * from './NumberFormat/ToRawPrecision';
export * from './PartitionPattern';
export * from './SupportedLocales';
export { createDataProperty, defineProperty, getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, } from './utils';
export type { LiteralPart } from './utils';
export * from './262';
export { isMissingLocaleDataError } from './data';
export type { LocaleData } from './types/core';
export * from './types/date-time';
export * from './types/displaynames';
export * from './types/list';
export * from './types/number';
export * from './types/plural-rules';
export * from './types/relative-time';
export { createMemoizedDateTimeFormat, createMemoizedListFormat, createMemoizedLocale, createMemoizedNumberFormat, createMemoizedPluralRules, invariant, } from './utils';
export { ZERO } from './constants';
export { ToIntlMathematicalValue } from './ToIntlMathematicalValue';
@@ -0,0 +1,3 @@
declare const _exports: import('eslint').Rule.RuleModule;
export = _exports;
//# sourceMappingURL=jsx-sort-props.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"no-named-as-default-member.js","sourceRoot":"","sources":["../../src/rules/no-named-as-default-member.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) Elan Shanker and Node.js contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
@@ -0,0 +1 @@
{"mappings":"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","sources":["packages/@internationalized/date/src/calendars/JapaneseCalendar.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from the TC39 Temporal proposal.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate} from '../types';\nimport {CalendarDate} from '../CalendarDate';\nimport {GregorianCalendar} from './GregorianCalendar';\nimport {Mutable} from '../utils';\n\nconst ERA_START_DATES = [[1868, 9, 8], [1912, 7, 30], [1926, 12, 25], [1989, 1, 8], [2019, 5, 1]];\nconst ERA_END_DATES = [[1912, 7, 29], [1926, 12, 24], [1989, 1, 7], [2019, 4, 30]];\nconst ERA_ADDENDS = [1867, 1911, 1925, 1988, 2018];\nconst ERA_NAMES = ['meiji', 'taisho', 'showa', 'heisei', 'reiwa'];\n\nfunction findEraFromGregorianDate(date: AnyCalendarDate) {\n const idx = ERA_START_DATES.findIndex(([year, month, day]) => {\n if (date.year < year) {\n return true;\n }\n\n if (date.year === year && date.month < month) {\n return true;\n }\n\n if (date.year === year && date.month === month && date.day < day) {\n return true;\n }\n\n return false;\n });\n\n if (idx === -1) {\n return ERA_START_DATES.length - 1;\n }\n\n if (idx === 0) {\n returLine truncated
@@ -0,0 +1,446 @@
/**
* @fileoverview Rule to flag use of variables before they are defined
* @author Ilya Volodin
*/
"use strict";
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const SENTINEL_TYPE =
/^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u;
const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u;
/**
* Parses a given value as options.
* @param {any} options A value to parse.
* @returns {Object} The parsed options.
*/
function parseOptions(options) {
if (typeof options === "object" && options !== null) {
return options;
}
const functions = typeof options === "string" ? options !== "nofunc" : true;
return {
functions,
classes: true,
variables: true,
allowNamedExports: false,
enums: true,
typedefs: true,
ignoreTypeReferences: true,
};
}
/**
* Checks whether or not a given location is inside of the range of a given node.
* @param {ASTNode} node An node to check.
* @param {number} location A location to check.
* @returns {boolean} `true` if the location is inside of the range of the node.
*/
function isInRange(node, location) {
return node && node.range[0] <= location && location <= node.range[1];
}
/**
* Checks whether or not a given location is inside of the range of a class static initializer.
* Static initializers are static blocks and initializers of static fields.
* @param {ASTNode} node `ClassBody` node to check static initializers.
* @param {number} location A location to check.
* @returns {boolean} `true` if the location is inside of a class static initializer.
*/
function isInClassStaticInitializerRange(node, location) {
return node.body.some(
classMember =>
(classMember.type === "StaticBlock" &&
isInRange(classMember, location)) ||
(classMember.type === "PropertyDefinition" &&
classMember.static &&
classMember.value &&
isInRange(classMember.value, location)),
);
}
/**
* Checks whether a given scope is the scope of a class static initializer.
* Static initializers are static blocks and initializers of static fields.
* @param {eslint-scope.Scope} scope A scope to check.
* @returns {boolean} `true` if the scope is a class static initializer scope.
*/
function isClassStaticInitializerScope(scope) {
if (scope.type === "class-static-block") {
return true;
}
if (scope.type === "class-field-initializer") {
// `scope.block` is PropertyDefinition#value node
const propertyDefinition = scope.block.parent;
return propertyDefinition.static;
}
return false;
}
/**
* Checks whether a given reference is evaluated in an execution context
* that isn't the one where the variable it refers to is defined.
* Execution contexts are:
* - top-level
* - functions
* - class field initializers (implicit functions)
* - class static blocks (implicit functions)
* Static class field initializers and class static blocks are automatically run during the class definition evaluation,
* and therefore we'll consider them as a part of the parent execution context.
* Example:
*
* const x = 1;
*
* x; // returns `false`
* () => x; // returns `true`
*
* class C {
* field = x; // returns `true`
* static field = x; // returns `false`
*
* method() {
* x; // returns `true`
* }
*
* static method() {
* x; // returns `true`
* }
*
* static {
* x; // returns `false`
* }
* }
* @param {eslint-scope.Reference} reference A reference to check.
* @returns {boolean} `true` if the reference is from a separate execution context.
*/
function isFromSeparateExecutionContext(reference) {
const variable = reference.resolved;
let scope = reference.from;
// Scope#variableScope represents execution context
while (variable.scope.variableScope !== scope.variableScope) {
if (isClassStaticInitializerScope(scope.variableScope)) {
scope = scope.variableScope.upper;
} else {
return true;
}
}
return false;
}
/**
* Checks whether or not a given reference is evaluated during the initialization of its variable.
*
* This returns `true` in the following cases:
*
* var a = a
* var [a = a] = list
* var {a = a} = obj
* for (var a in a) {}
* for (var a of a) {}
* var C = class { [C]; };
* var C = class { static foo = C; };
* var C = class { static { foo = C; } };
* class C extends C {}
* class C extends (class { static foo = C; }) {}
* class C { [C]; }
* @param {Reference} reference A reference to check.
* @returns {boolean} `true` if the reference is evaluated during the initialization.
*/
function isEvaluatedDuringInitialization(reference) {
if (isFromSeparateExecutionContext(reference)) {
/*
* Even if the reference appears in the initializer, it isn't evaluated during the initialization.
* For example, `const x = () => x;` is valid.
*/
return false;
}
const location = reference.identifier.range[1];
const definition = reference.resolved.defs[0];
if (definition.type === "ClassName") {
// `ClassDeclaration` or `ClassExpression`
const classDefinition = definition.node;
return (
isInRange(classDefinition, location) &&
/*
* Class binding is initialized before running static initializers.
* For example, `class C { static foo = C; static { bar = C; } }` is valid.
*/
!isInClassStaticInitializerRange(classDefinition.body, location)
);
}
let node = definition.name.parent;
while (node) {
if (node.type === "VariableDeclarator") {
if (isInRange(node.init, location)) {
return true;
}
if (
FOR_IN_OF_TYPE.test(node.parent.parent.type) &&
isInRange(node.parent.parent.right, location)
) {
return true;
}
break;
} else if (node.type === "AssignmentPattern") {
if (isInRange(node.right, location)) {
return true;
}
} else if (SENTINEL_TYPE.test(node.type)) {
break;
}
node = node.parent;
}
return false;
}
/**
* check whether the reference contains a type query.
* @param {ASTNode} node Identifier node to check.
* @returns {boolean} true if reference contains type query.
*/
function referenceContainsTypeQuery(node) {
switch (node.type) {
case "TSTypeQuery":
return true;
case "TSQualifiedName":
case "Identifier":
return referenceContainsTypeQuery(node.parent);
default:
// if we find a different node, there's no chance that we're in a TSTypeQuery
return false;
}
}
/**
* Decorators are transpiled such that the decorator is placed after the class declaration
* So it is considered safe
* @param {Variable} variable The variable to check.
* @param {Reference} reference The reference to check.
* @returns {boolean} `true` if the reference is in a class decorator.
*/
function isClassRefInClassDecorator(variable, reference) {
if (variable.defs[0].type !== "ClassName") {
return false;
}
if (
!variable.defs[0].node.decorators ||
variable.defs[0].node.decorators.length === 0
) {
return false;
}
for (const deco of variable.defs[0].node.decorators) {
if (
reference.identifier.range[0] >= deco.range[0] &&
reference.identifier.range[1] <= deco.range[1]
) {
return true;
}
}
return false;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
dialects: ["javascript", "typescript"],
language: "javascript",
type: "problem",
docs: {
description:
"Disallow the use of variables before they are defined",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-use-before-define",
},
schema: [
{
oneOf: [
{
enum: ["nofunc"],
},
{
type: "object",
properties: {
functions: { type: "boolean" },
classes: { type: "boolean" },
variables: { type: "boolean" },
allowNamedExports: { type: "boolean" },
enums: { type: "boolean" },
typedefs: { type: "boolean" },
ignoreTypeReferences: { type: "boolean" },
},
additionalProperties: false,
},
],
},
],
defaultOptions: [
{
classes: true,
functions: true,
variables: true,
allowNamedExports: false,
enums: true,
typedefs: true,
ignoreTypeReferences: true,
},
],
messages: {
usedBeforeDefined: "'{{name}}' was used before it was defined.",
},
},
create(context) {
const options = parseOptions(context.options[0]);
const sourceCode = context.sourceCode;
/**
* Determines whether a given reference should be checked.
*
* Returns `false` if the reference is:
* - initialization's (e.g., `let a = 1`).
* - referring to an undefined variable (i.e., if it's an unresolved reference).
* - referring to a variable that is defined, but not in the given source code
* (e.g., global environment variable or `arguments` in functions).
* - allowed by options.
* @param {eslint-scope.Reference} reference The reference
* @returns {boolean} `true` if the reference should be checked
*/
function shouldCheck(reference) {
if (reference.init) {
return false;
}
const { identifier } = reference;
if (
options.allowNamedExports &&
identifier.parent.type === "ExportSpecifier" &&
identifier.parent.local === identifier
) {
return false;
}
const variable = reference.resolved;
if (!variable || variable.defs.length === 0) {
return false;
}
const definitionType = variable.defs[0].type;
if (!options.functions && definitionType === "FunctionName") {
return false;
}
if (
((!options.variables && definitionType === "Variable") ||
(!options.classes && definitionType === "ClassName")) &&
// don't skip checking the reference if it's in the same execution context, because of TDZ
isFromSeparateExecutionContext(reference)
) {
return false;
}
if (!options.enums && definitionType === "TSEnumName") {
return false;
}
if (!options.typedefs && definitionType === "Type") {
return false;
}
if (
options.ignoreTypeReferences &&
(referenceContainsTypeQuery(identifier) ||
identifier.parent.type === "TSTypeReference")
) {
return false;
}
// skip nested namespace aliases as variable references
if (identifier.parent.type === "TSQualifiedName") {
let currentNode = identifier.parent;
while (currentNode.type === "TSQualifiedName") {
currentNode = currentNode.left;
}
if (currentNode === identifier) {
return true;
}
return false;
}
if (isClassRefInClassDecorator(variable, reference)) {
return false;
}
return true;
}
/**
* Finds and validates all references in a given scope and its child scopes.
* @param {eslint-scope.Scope} scope The scope object.
* @returns {void}
*/
function checkReferencesInScope(scope) {
scope.references.filter(shouldCheck).forEach(reference => {
const variable = reference.resolved;
const definitionIdentifier = variable.defs[0].name;
if (
reference.identifier.range[1] <
definitionIdentifier.range[1] ||
(isEvaluatedDuringInitialization(reference) &&
reference.identifier.parent.type !== "TSTypeReference")
) {
context.report({
node: reference.identifier,
messageId: "usedBeforeDefined",
data: reference.identifier,
});
}
});
scope.childScopes.forEach(checkReferencesInScope);
}
return {
Program(node) {
checkReferencesInScope(sourceCode.getScope(node));
},
};
},
};
@@ -0,0 +1,53 @@
// Copyright (c) 2011-2015 Ryan Prichard
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
#ifndef UNIX_ADAPTER_OUTPUT_HANDLER_H
#define UNIX_ADAPTER_OUTPUT_HANDLER_H
#include <windows.h>
#include <pthread.h>
#include <signal.h>
#include "WakeupFd.h"
// Connect winpty CONOUT/CONERR to a Cygwin blocking fd.
class OutputHandler {
public:
OutputHandler(HANDLE conout, int outputfd, WakeupFd &completionWakeup);
~OutputHandler() { shutdown(); }
bool isComplete() { return m_threadCompleted; }
void shutdown();
private:
static void *threadProcS(void *pvthis) {
reinterpret_cast<OutputHandler*>(pvthis)->threadProc();
return NULL;
}
void threadProc();
HANDLE m_conout;
int m_outputfd;
pthread_t m_thread;
WakeupFd &m_completionWakeup;
bool m_threadHasBeenJoined;
volatile sig_atomic_t m_threadCompleted;
};
#endif // UNIX_ADAPTER_OUTPUT_HANDLER_H
@@ -0,0 +1,747 @@
export default `flf2a$ 7 6 100 15 31 1
Jerusalem by Gedaliah Friedenberg - based on Standard by G. Chappell & Ian Chai
Questions and comments regarding jerusalem.flf to gfrieden@nyx.cs.du.edu
Modified for figlet 2.1 by Glenn Chappell 16 Dec 1993
Date: 13 Feb 1994
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be \`a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
7 - height of a character
6 - height of a character, not including descenders
100 - max line length (excluding comment lines) + a fudge factor
15 - default smushmode for this font
31 - number of comment lines
1 - print right-to-left (figlet 2.1 or later only)
Hebrew keyboard maps:
All capital letters print the english character for that key. All numbers
and symbols are the same in in Hebrew/English except for those shown here.
The * symbol prints as a Jewish star (Star of David).
While in figlet, type ~ on a line by itself to see this list:
aleph = t | zayin = z | lamed = k | ayin = g | shin/sin = a
bet/vet = c | chet = j | mem = n | pey/fey = p | taf/saf = ,
gimmel = d | tet = y | final " = o | final " = ; | ,(comma) = '
daled = s | yud = h | nun = b | tzaadi = m | .(period) = /
hay = v | kaf/chaf = f | final " = i | final " = . | ; = \`
vav = u | final " = l | samekh = x | kuf = e | / = q
The asterisk (*) is a Star of David | resh = r | '(apost.) = w
$@
$@
$@
$@
$@
$@
$@@
@
_ @
| |@
| |@
|_|@
(_)@
@@
@
_ _ @
( | )@
V V @
$ @
$ @
@@
@
_ _ @
_| || |_ @
|_ .. _|@
|_ _|@
|_||_| @
@@
@
_ @
| | @
/ __)@
\\__ \\@
( /@
|_| @@
@
_ __@
(_)/ /@
/ / @
/ /_ @
/_/(_)@
@@
@
___ @
( _ ) @
/ _ \\/\\@
| (_> <@
\\___/\\/@
@@
@
@
@
@
_ @
( )@
|/ @@
@
__@
/ /@
| | @
| | @
| | @
\\_\\@@
@
__ @
\\ \\ @
| |@
| |@
| |@
/_/ @@
@
@
__/\\__@
\\ /@
/_ _\\@
\\/ @
@@
@
@
_ @
_| |_ @
|_ _|@
|_| @
@@
@
______ @
| __ |@
| | | |@
_| | | |@
|___| |_|@
@@
@
@
@
_____ @
|_____|@
$ @
@@
@
__ _ @
|. | | |@
| | // @
| |// @
| | @
|_| @@
@
@
@
@
_ @
(_)@
@@
@
___ @
/ _ \\ @
| | | |@
| |_| |@
\\___/ @
@@
@
_ @
/ |@
| |@
| |@
|_|@
@@
@
____ @
|___ \\ @
__) |@
/ __/ @
|_____|@
@@
@
_____ @
|___ / @
|_ \\ @
___) |@
|____/ @
@@
@
_ _ @
| || | @
| || |_ @
|__ _|@
|_| @
@@
@
____ @
| ___| @
|___ \\ @
___) |@
|____/ @
@@
@
__ @
/ /_ @
| '_ \\ @
| (_) |@
\\___/ @
@@
@
_____ @
|___ |@
/ / @
/ / @
/_/ @
@@
@
___ @
( _ ) @
/ _ \\ @
| (_) |@
\\___/ @
@@
@
___ @
/ _ \\ @
| (_) |@
\\__, |@
/_/ @
@@
@
@
_ @
(_)@
_ @
(_)@
@@
@
______ @
| __ |@
| |_ | |@
|___|| |@
| |@
|_|@@
@
__@
/ /@
/ / @
\\ \\ @
\\_\\@
@@
@
@
_____ @
|_____|@
|_____|@
$ @
@@
@
__ @
\\ \\ @
\\ \\@
/ /@
/_/ @
@@
@
___ @
|__ \\@
/ /@
|_| @
(_) @
@@
@
____ @
/ __ \\ @
/ / _\` |@
| | (_| |@
\\ \\__,_|@
\\____/ @@
@
_ @
/ \\ @
/ _ \\ @
/ ___ \\ @
/_/ \\_\\@
@@
@
____ @
| __ ) @
| _ \\ @
| |_) |@
|____/ @
@@
@
____ @
/ ___|@
| | @
| |___ @
\\____|@
@@
@
____ @
| _ \\ @
| | | |@
| |_| |@
|____/ @
@@
@
_____ @
| ____|@
| _| @
| |___ @
|_____|@
@@
@
_____ @
| ___|@
| |_ @
| _| @
|_| @
@@
@
____ @
/ ___|@
| | _ @
| |_| |@
\\____|@
@@
@
_ _ @
| | | |@
| |_| |@
| _ |@
|_| |_|@
@@
@
___ @
|_ _|@
| | @
| | @
|___|@
@@
@
_ @
| |@
_ | |@
| |_| |@
\\___/ @
@@
@
_ __@
| |/ /@
| ' / @
| . \\ @
|_|\\_\\@
@@
@
_ @
| | @
| | @
| |___ @
|_____|@
@@
@
__ __ @
| \\/ |@
| |\\/| |@
| | | |@
|_| |_|@
@@
@
_ _ @
| \\ | |@
| \\| |@
| |\\ |@
|_| \\_|@
@@
@
___ @
/ _ \\ @
| | | |@
| |_| |@
\\___/ @
@@
@
____ @
| _ \\ @
| |_) |@
| __/ @
|_| @
@@
@
___ @
/ _ \\ @
| | | |@
| |_| |@
\\__\\_\\@
@@
@
____ @
| _ \\ @
| |_) |@
| _ < @
|_| \\_\\@
@@
@
____ @
/ ___| @
\\___ \\ @
___) |@
|____/ @
@@
@
_____ @
|_ _|@
| | @
| | @
|_| @
@@
@
_ _ @
| | | |@
| | | |@
| |_| |@
\\___/ @
@@
@
__ __@
\\ \\ / /@
\\ \\ / / @
\\ V / @
\\_/ @
@@
@
__ __@
\\ \\ / /@
\\ \\ /\\ / / @
\\ V V / @
\\_/\\_/ @
@@
@
__ __@
\\ \\/ /@
\\ / @
/ \\ @
/_/\\_\\@
@@
@
__ __@
\\ \\ / /@
\\ V / @
| | @
|_| @
@@
@
_____@
|__ /@
/ / @
/ /_ @
/____|@
@@
@
__ @
| _|@
| | @
| | @
| | @
|__|@@
@
__ @
\\ \\ @
\\ \\ @
\\ \\ @
\\_\\@
@@
@
__ @
|_ |@
| |@
| |@
| |@
|__|@@
@
/\\ @
|/\\|@
$ @
$ @
$ @
@@
@
@
@
@
@
_____ @
|_____|@@
@
@
_ @
(_)@
_ @
( )@
|/ @@
@
_ _ _ @
| | | | | |@
| | | | | |@
| |/ /_/ / @
|_______/ @
@@
@
___ @
|_ |@
| |@
__| |@
|____|@
@@
@
______ @
|____ | @
| | @
_____| |_@
/________/@
@@
@
____ @
|__ | @
| | @
____| | @
/____/\\_\\@
@@
@
______ @
|____ |@
_ | |@
| | |_|@
| | @
|_| @@
@
_____ @
|____ \\ @
| |@
____| |@
|_____/ @
@@
@
__ _ @
\\ \\ | |@
\\ \\| |@
__\\ \` |@
|______|@
@@
@
___ @
|_ |@
|_|@
$ @
$ @
@@
@
___ @
|_ |@
| |@
| |@
| |@
|_|@@
@
_______ @
|. __ |@
| | | |@
| | | |@
|_| |_|@
@@
_ @
| |____ @
|____ |@
/ / @
/ / @
/_/ @
@@
@
_______ @
|____ .|@
| | @
| | @
| | @
|_| @@
@
__ __.@
\\ \\ / / @
\\ V / @
___\\ \\ @
|______| @
@@
@
_______ @
|. __ |@
| | | |@
| | _| |@
|_||___|@
@@
@
________ @
|. ___ |@
| | | |@
| |___| |@
|_______|@
@@
@
_______ @
| ___ |@
\\_\\ | |@
_____| |@
|_______|@
@@
@
__@
/ /@
/ / @
/ / @
/_/ @
@@
@
______ @
|____ |@
| |@
| |@
|_|@
@@
@
_______ @
|____ |@
| | @
| | @
|_| @
@@
@
__ __@
\\ \\ / /@
| V / @
| |\\ \\ @
|_| \\_\\@
@@
@
___ @
|_ |@
| |@
| |@
|_|@
@@
@
_______ @
|_____ |@
_ | |@
| | | |@
|_| |_|@
@@
@
_ @
( )@
|/ @
$ @
$ @
@@
@
_______ @
|. __ |@
| | | |@
| |__/ |@
|_____/ @
@@
@
__ ___ @
|. | /_ |@
| | | |@
| |___| |@
|_______|@
@@
@
________ @
\\__ __\\@
| | @
| | @
|_| @
@@
@
__@
/ /@
| | @
< < @
| | @
\\_\\@@
@
_ @
| |@
| |@
| |@
| |@
|_|@@
@
__ @
\\ \\ @
| | @
> >@
| | @
/_/ @@
aleph = t | zayin = z | lamed = k | ayin = g | shin/sin = a@
bet/vet = c | chet = j | mem = n | pey/fey = p | taf/saf = ,@
gimmel = d | tet = y | final " = o | final " = ; | ,(comma) = '@
daled = s | yud = h | nun = b | tzaadi = m | .(period) = /@
hay = v | kaf/chaf = f | final " = i | final " = . | ; = \`@
vav = u | final " = l | samekh = x | kuf = e | / = q@
The asterisk (*) is a Star of David | resh = r | '(apost.) = w@@
@
_ _ @
(_)_(_)@
/_\\ @
/ _ \\ @
/_/ \\_\\@
@@
@
_ _ @
(_)_(_)@
/ _ \\ @
| |_| |@
\\___/ @
@@
@
_ _ @
(_) (_)@
| | | |@
| |_| |@
\\___/ @
@@
@
_ _ @
(_)_(_)@
/ _\` |@
| (_| |@
\\__,_|@
@@
@
_ _ @
(_)_(_)@
/ _ \\ @
| (_) |@
\\___/ @
@@
@
_ _ @
(_) (_)@
| | | |@
| |_| |@
\\__,_|@
@@
@
___ @
/ _ \\@
| |/ /@
| |\\ \\@
| ||_/@
|_| @@
`
@@ -0,0 +1,17 @@
// src/colors/zinc.ts
var zinc = {
"50": "#fafafa",
"100": "#f4f4f5",
"200": "#e4e4e7",
"300": "#d4d4d8",
"400": "#a1a1aa",
"500": "#71717a",
"600": "#52525b",
"700": "#3f3f46",
"800": "#27272a",
"900": "#18181b"
};
export {
zinc
};
@@ -0,0 +1,159 @@
import type {
Action,
ThunkAction,
TypedAddListener,
TypedRemoveListener,
TypedStartListening,
TypedStopListening,
} from '@reduxjs/toolkit'
import {
addListener,
configureStore,
createAsyncThunk,
createListenerMiddleware,
createSlice,
removeListener,
} from '@reduxjs/toolkit'
import { describe, expectTypeOf, test } from 'vitest'
export interface CounterState {
counter: number
}
const initialState: CounterState = {
counter: 0,
}
export const counterSlice = createSlice({
name: 'counter',
initialState,
reducers: {
increment(state) {
state.counter++
},
},
})
export function fetchCount(amount = 1) {
return new Promise<{ data: number }>((resolve) =>
setTimeout(() => resolve({ data: amount }), 500),
)
}
export const incrementAsync = createAsyncThunk(
'counter/fetchCount',
async (amount: number) => {
const response = await fetchCount(amount)
// The value we return becomes the `fulfilled` action payload
return response.data
},
)
const { increment } = counterSlice.actions
const store = configureStore({
reducer: counterSlice.reducer,
})
type AppStore = typeof store
type AppDispatch = typeof store.dispatch
type RootState = ReturnType<typeof store.getState>
type AppThunk<ThunkReturnType = void> = ThunkAction<
ThunkReturnType,
RootState,
unknown,
Action
>
type ExtraArgument = { foo: string }
describe('listenerMiddleware.withTypes<RootState, AppDispatch>()', () => {
const listenerMiddleware = createListenerMiddleware()
let timeout: number | undefined = undefined
let done = false
type ExpectedTakeResultType =
| [ReturnType<typeof increment>, RootState, RootState]
| null
test('startListening.withTypes', () => {
const startAppListening = listenerMiddleware.startListening.withTypes<
RootState,
AppDispatch,
ExtraArgument
>()
expectTypeOf(startAppListening).toEqualTypeOf<
TypedStartListening<RootState, AppDispatch, ExtraArgument>
>()
startAppListening({
predicate: increment.match,
effect: async (action, listenerApi) => {
const stateBefore = listenerApi.getState()
expectTypeOf(increment).returns.toEqualTypeOf(action)
expectTypeOf(listenerApi.dispatch).toEqualTypeOf<AppDispatch>()
expectTypeOf(stateBefore).toEqualTypeOf<RootState>()
let takeResult = await listenerApi.take(increment.match, timeout)
const stateCurrent = listenerApi.getState()
expectTypeOf(takeResult).toEqualTypeOf<ExpectedTakeResultType>()
expectTypeOf(stateCurrent).toEqualTypeOf<RootState>()
expectTypeOf(listenerApi.extra).toEqualTypeOf<ExtraArgument>()
timeout = 1
takeResult = await listenerApi.take(increment.match, timeout)
done = true
},
})
})
test('addListener.withTypes', () => {
const addAppListener = addListener.withTypes<RootState, AppDispatch, ExtraArgument>()
expectTypeOf(addAppListener).toEqualTypeOf<
TypedAddListener<RootState, AppDispatch, ExtraArgument>
>()
store.dispatch(
addAppListener({
matcher: increment.match,
effect: (action, listenerApi) => {
const state = listenerApi.getState()
expectTypeOf(state).toEqualTypeOf<RootState>()
expectTypeOf(listenerApi.dispatch).toEqualTypeOf<AppDispatch>()
expectTypeOf(listenerApi.extra).toEqualTypeOf<ExtraArgument>()
},
}),
)
})
test('removeListener.withTypes', () => {
const removeAppListener = removeListener.withTypes<RootState, AppDispatch, ExtraArgument>()
expectTypeOf(removeAppListener).toEqualTypeOf<
TypedRemoveListener<RootState, AppDispatch, ExtraArgument>
>()
})
test('stopListening.withTypes', () => {
const stopAppListening = listenerMiddleware.stopListening.withTypes<
RootState,
AppDispatch,
ExtraArgument
>()
expectTypeOf(stopAppListening).toEqualTypeOf<
TypedStopListening<RootState, AppDispatch, ExtraArgument>
>()
})
})
@@ -0,0 +1,15 @@
'use strict';
var $TypeError = require('es-errors/type');
var NumberAdd = require('./add');
var NumberUnaryMinus = require('./unaryMinus');
// https://262.ecma-international.org/12.0/#sec-numeric-types-number-subtract
module.exports = function NumberSubtract(x, y) {
if (typeof x !== 'number' || typeof y !== 'number') {
throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
}
return NumberAdd(x, NumberUnaryMinus(y));
};
@@ -0,0 +1,5 @@
function mixImmediate(a, b) {
return (p) => (p > 0 ? b : a);
}
export { mixImmediate };
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClassScope = void 0;
const ScopeBase_1 = require("./ScopeBase");
const ScopeType_1 = require("./ScopeType");
class ClassScope extends ScopeBase_1.ScopeBase {
constructor(scopeManager, upperScope, block) {
super(scopeManager, ScopeType_1.ScopeType.class, upperScope, block, false);
}
}
exports.ClassScope = ClassScope;
@@ -0,0 +1,41 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _consoleFunc = require('./internal/consoleFunc.js');
var _consoleFunc2 = _interopRequireDefault(_consoleFunc);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Logs the result of an `async` function to the `console`. Only works in
* Node.js or in browsers that support `console.log` and `console.error` (such
* as FF and Chrome). If multiple arguments are returned from the async
* function, `console.log` is called on each argument in order.
*
* @name log
* @static
* @memberOf module:Utils
* @method
* @category Util
* @param {AsyncFunction} function - The function you want to eventually apply
* all arguments to.
* @param {...*} arguments... - Any number of arguments to apply to the function.
* @example
*
* // in a module
* var hello = function(name, callback) {
* setTimeout(function() {
* callback(null, 'hello ' + name);
* }, 1000);
* };
*
* // in the node repl
* node> async.log(hello, 'world');
* 'hello world'
*/
exports.default = (0, _consoleFunc2.default)('log');
module.exports = exports.default;
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Lifecycle;
(function (Lifecycle) {
Lifecycle[Lifecycle["Transient"] = 0] = "Transient";
Lifecycle[Lifecycle["Singleton"] = 1] = "Singleton";
Lifecycle[Lifecycle["ResolutionScoped"] = 2] = "ResolutionScoped";
Lifecycle[Lifecycle["ContainerScoped"] = 3] = "ContainerScoped";
})(Lifecycle || (Lifecycle = {}));
exports.default = Lifecycle;
@@ -0,0 +1,13 @@
/**
* Checks if a `cache` value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
module.exports = cacheHas;
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./encrypted_private_key_info"), exports);
tslib_1.__exportStar(require("./private_key_info"), exports);
@@ -0,0 +1,35 @@
import * as _heroui_system_rsc from '@heroui/system-rsc';
import { HTMLHeroUIProps, PropGetter } from '@heroui/system-rsc';
import { SpacerVariantProps } from '@heroui/theme';
import { ReactRef } from '@heroui/react-utils';
import { Space } from './utils.mjs';
interface Props extends HTMLHeroUIProps<"span"> {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLElement | null>;
/**
* The x-axis margin.
* @default 1
*
* @see https://tailwindcss.com/docs/customizing-spacing#default-spacing-scale
*/
x?: Space;
/**
* The y-axis margin.
* @default 1
*
* @see https://tailwindcss.com/docs/customizing-spacing#default-spacing-scale
*/
y?: Space;
}
type UseSpacerProps = Props & SpacerVariantProps;
declare const getMargin: (value: Space) => string;
declare function useSpacer(originalProps: UseSpacerProps): {
Component: _heroui_system_rsc.As<any>;
getSpacerProps: PropGetter;
};
type UseSpacerReturn = ReturnType<typeof useSpacer>;
export { type UseSpacerProps, type UseSpacerReturn, getMargin, useSpacer };
@@ -0,0 +1,4 @@
function _tdzError(e) {
throw new ReferenceError(e + " is not defined - temporal dead zone");
}
module.exports = _tdzError, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,28 @@
var baseDelay = require('./_baseDelay'),
baseRest = require('./_baseRest'),
toNumber = require('./toNumber');
/**
* Invokes `func` after `wait` milliseconds. Any additional arguments are
* provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.delay(function(text) {
* console.log(text);
* }, 1000, 'later');
* // => Logs 'later' after one second.
*/
var delay = baseRest(function(func, wait, args) {
return baseDelay(func, toNumber(wait) || 0, args);
});
module.exports = delay;
@@ -0,0 +1,2 @@
export declare function updateOwnReflectMetadata<TMetadata>(target: object, metadataKey: unknown, buildDefaultValue: () => TMetadata, callback: (metadata: TMetadata) => TMetadata, propertyKey?: string | symbol): void;
//# sourceMappingURL=updateOwnReflectMetadata.d.ts.map
@@ -0,0 +1,9 @@
import type { TSESTree } from '@typescript-eslint/types';
import type { ScopeManager } from '../ScopeManager';
import type { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
export declare class FunctionExpressionNameScope extends ScopeBase<ScopeType.functionExpressionName, TSESTree.FunctionExpression, Scope> {
readonly functionExpressionScope: true;
constructor(scopeManager: ScopeManager, upperScope: FunctionExpressionNameScope['upper'], block: FunctionExpressionNameScope['block']);
}
@@ -0,0 +1,16 @@
import getMapData from './_getMapData.js';
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
export default mapCacheHas;
@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-import-type-side-effects',
meta: {
type: 'problem',
docs: {
description: 'Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers',
},
fixable: 'code',
messages: {
useTopLevelQualifier: 'TypeScript will only remove the inline type specifiers which will leave behind a side effect import at runtime. Convert this to a top-level type qualifier to properly remove the entire import.',
},
schema: [],
},
defaultOptions: [],
create(context) {
return {
'ImportDeclaration[importKind!="type"]'(node) {
if (node.specifiers.length === 0) {
return;
}
const specifiers = [];
for (const specifier of node.specifiers) {
if (specifier.type !== utils_1.AST_NODE_TYPES.ImportSpecifier ||
specifier.importKind !== 'type') {
return;
}
specifiers.push(specifier);
}
context.report({
node,
messageId: 'useTopLevelQualifier',
fix(fixer) {
const fixes = [];
for (const specifier of specifiers) {
const qualifier = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(specifier, util_1.isTypeKeyword), util_1.NullThrowsReasons.MissingToken('type keyword', 'import specifier'));
fixes.push(fixer.removeRange([
qualifier.range[0],
specifier.imported.range[0],
]));
}
const importKeyword = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isImportKeyword), util_1.NullThrowsReasons.MissingToken('import keyword', 'import'));
fixes.push(fixer.insertTextAfter(importKeyword, ' type'));
return fixes;
},
});
},
};
},
});
@@ -0,0 +1,42 @@
import Stack from './_Stack.js';
import assignMergeValue from './_assignMergeValue.js';
import baseFor from './_baseFor.js';
import baseMergeDeep from './_baseMergeDeep.js';
import isObject from './isObject.js';
import keysIn from './keysIn.js';
import safeGet from './_safeGet.js';
/**
* The base implementation of `_.merge` without support for multiple sources.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {number} srcIndex The index of `source`.
* @param {Function} [customizer] The function to customize merged values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMerge(object, source, srcIndex, customizer, stack) {
if (object === source) {
return;
}
baseFor(source, function(srcValue, key) {
stack || (stack = new Stack);
if (isObject(srcValue)) {
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
}
else {
var newValue = customizer
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
: undefined;
if (newValue === undefined) {
newValue = srcValue;
}
assignMergeValue(object, key, newValue);
}
}, keysIn);
}
export default baseMerge;
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 ECMAScript Shims
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more