Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

Location:
imaps-frontend/node_modules/which-builtin-type
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/which-builtin-type/CHANGELOG.md

    rd565449 r0c6b92a  
    55The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    66and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
     7
     8## [v1.2.0](https://github.com/inspect-js/which-builtin-type/compare/v1.1.4...v1.2.0) - 2024-11-23
     9
     10### Commits
     11
     12- [New] add types [`d4aa2db`](https://github.com/inspect-js/which-builtin-type/commit/d4aa2db289a8d97c6917c0edb1edcb32001488a8)
     13- [actions] split out node 10-20, and 20+ [`7b3d28b`](https://github.com/inspect-js/which-builtin-type/commit/7b3d28bcb1258cdfd5a7df5606622351596fb442)
     14- [Refactor] use `callBound` to cache Promise#then [`a000377`](https://github.com/inspect-js/which-builtin-type/commit/a0003772dabdd5fd4b84c2ed8e139df008a437e8)
     15- [Dev Deps] update `auto-changelog`, `object-inspect`, `tape` [`37062d2`](https://github.com/inspect-js/which-builtin-type/commit/37062d280a8c36c1bd96b6cfbe053f10cf8d71b6)
     16- [Tests] replace `aud` with `npm audit` [`337aac1`](https://github.com/inspect-js/which-builtin-type/commit/337aac1d88fc63d935bd15a97926e9b0b462a735)
     17- [Deps] update `is-finalizationregistry` [`4ef8763`](https://github.com/inspect-js/which-builtin-type/commit/4ef8763a19709df7ad50d790bd2b724f531a65d9)
     18- [Dev Deps] add missing peer dep [`1cb2842`](https://github.com/inspect-js/which-builtin-type/commit/1cb28421438eb4ee8f0f284b535f1cfc6b9c9757)
    719
    820## [v1.1.4](https://github.com/inspect-js/which-builtin-type/compare/v1.1.3...v1.1.4) - 2024-07-29
  • imaps-frontend/node_modules/which-builtin-type/index.js

    rd565449 r0c6b92a  
    1212var isGeneratorFunction = require('is-generator-function');
    1313var isAsyncFunction = require('is-async-function');
     14var callBound = require('call-bind/callBound');
    1415var hasToStringTag = require('has-tostringtag/shams')();
    1516var toStringTag = hasToStringTag && Symbol.toStringTag;
     
    1718var $Object = Object;
    1819
    19 var promiseThen = typeof Promise === 'function' && Promise.prototype.then;
     20/** @type {undefined | ((value: ThisParameterType<typeof Promise.prototype.then>, ...args: Parameters<typeof Promise.prototype.then>) => ReturnType<typeof Promise.prototype.then>)} */
     21var promiseThen = callBound('Promise.prototype.then', true);
     22/** @type {<T = unknown>(value: unknown) => value is Promise<T>} */
    2023var isPromise = function isPromise(value) {
    2124        if (!value || typeof value !== 'object' || !promiseThen) {
     
    2326        }
    2427        try {
    25                 promiseThen.call(value, null, function () {});
     28                promiseThen(value, null, function () {});
    2629                return true;
    2730        } catch (e) {}
     
    2932};
    3033
     34/** @type {(builtinName: unknown) => boolean} */
    3135var isKnownBuiltin = function isKnownBuiltin(builtinName) {
    32         return builtinName
     36        return !!builtinName
    3337                // primitives
    3438                && builtinName !== 'BigInt'
     
    7478};
    7579
     80/** @type {import('.')} */
    7681module.exports = function whichBuiltinType(value) {
    7782        if (value == null) {
     
    110115                return 'Promise';
    111116        }
     117        // @ts-expect-error TS can't figure out that `value` is an `object` after the `which` check above
    112118        if (toStringTag && toStringTag in value) {
    113119                var tag = value[toStringTag];
     
    117123        }
    118124        if (typeof value.constructor === 'function') {
    119                 var constructorName = name(value.constructor);
     125                // eslint-disable-next-line no-extra-parens
     126                var constructorName = name(/** @type {Parameters<name>[0]} */ (value.constructor));
    120127                if (isKnownBuiltin(constructorName)) {
    121128                        return constructorName;
  • imaps-frontend/node_modules/which-builtin-type/package.json

    rd565449 r0c6b92a  
    11{
    22        "name": "which-builtin-type",
    3         "version": "1.1.4",
     3        "version": "1.2.0",
    44        "description": "What is the type of this builtin JS value?",
    55        "main": "index.js",
     6        "types": "index.d.ts",
    67        "exports": {
    78                ".": "./index.js",
     
    1516                "prelint": "evalmd README.md",
    1617                "lint": "eslint --ext=js,mjs .",
     18                "postlint": "tsc -P . && attw -P",
    1719                "pretest": "npm run lint",
    1820                "tests-only": "nyc tape 'test/**/*.js'",
    1921                "test": "npm run tests-only",
    20                 "posttest": "aud --production",
     22                "posttest": "npx npm@'>=10.2' audit --production",
    2123                "version": "auto-changelog && git add CHANGELOG.md",
    2224                "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
     
    4446        },
    4547        "devDependencies": {
     48                "@arethetypeswrong/cli": "^0.17.0",
    4649                "@ljharb/eslint-config": "^21.1.1",
    47                 "aud": "^2.0.4",
    48                 "auto-changelog": "^2.4.0",
     50                "@ljharb/tsconfig": "^0.2.0",
     51                "@types/call-bind": "^1.0.5",
     52                "@types/for-each": "^0.3.3",
     53                "@types/function.prototype.name": "^1.1.3",
     54                "@types/has-symbols": "^1.0.2",
     55                "@types/is-async-function": "^2.0.3",
     56                "@types/is-date-object": "^1.0.4",
     57                "@types/is-generator-function": "^1.0.3",
     58                "@types/is-regex": "^1.0.2",
     59                "@types/is-weakref": "^1.0.0",
     60                "@types/make-arrow-function": "^1.2.2",
     61                "@types/make-async-function": "^1.0.2",
     62                "@types/object-inspect": "^1.13.0",
     63                "@types/object.assign": "^4.1.0",
     64                "@types/tape": "^5.6.4",
     65                "@types/which-boxed-primitive": "^1.0.3",
     66                "auto-changelog": "^2.5.0",
    4967                "available-typed-arrays": "^1.0.7",
     68                "encoding": "^0.1.13",
    5069                "eslint": "=8.8.0",
    5170                "evalmd": "^0.0.19",
     
    5978                "npmignore": "^0.3.1",
    6079                "nyc": "^10.3.2",
    61                 "object-inspect": "^1.13.2",
     80                "object-inspect": "^1.13.3",
    6281                "object.assign": "^4.1.5",
    6382                "safe-publish-latest": "^2.0.0",
    64                 "tape": "^5.8.1"
     83                "tape": "^5.9.0",
     84                "typescript": "next"
    6585        },
    6686        "auto-changelog": {
     
    7393        },
    7494        "dependencies": {
     95                "call-bind": "^1.0.7",
    7596                "function.prototype.name": "^1.1.6",
    7697                "has-tostringtag": "^1.0.2",
    7798                "is-async-function": "^2.0.0",
    7899                "is-date-object": "^1.0.5",
    79                 "is-finalizationregistry": "^1.0.2",
     100                "is-finalizationregistry": "^1.1.0",
    80101                "is-generator-function": "^1.0.10",
    81102                "is-regex": "^1.1.4",
  • imaps-frontend/node_modules/which-builtin-type/test/index.js

    rd565449 r0c6b92a  
    2222        t.equal(which(null), null, 'null is null');
    2323        t.equal(which(undefined), undefined, 'undefined is undefined');
     24        // @ts-expect-error
    2425        t.equal(which(), undefined, 'absent is undefined');
    2526
     
    2829
    2930test('non-nullish', function (t) {
     31        /** @constructor */
    3032        var F = function Foo() {};
    3133
     
    7072                GeneratorFunction: generators,
    7173                AsyncFunction: asyncs,
    72                 Object: [
     74                // eslint-disable-next-line no-extra-parens
     75                Object: /** @type {object[]} */ ([
    7376                        {},
    7477                        { constructor: null },
    7578                        Math
    76                 ],
     79                ]),
    7780                Symbol: hasSymbols ? [
    7881                        Symbol.iterator,
     
    121124        };
    122125        forEach(availableTypedArrays(), function (TypedArray) {
     126                // @ts-expect-error not sure how to infer this as being spreaded into the above object literal
    123127                tests[TypedArray] = [
    124128                        new global[TypedArray](0),
     
    138142                        ) {
    139143                                if (hasToStringTag) {
     144                                        /** @type {{ [k in typeof Symbol.toStringTag]?: string }} */
    140145                                        var fakerTag = {};
    141146                                        fakerTag[Symbol.toStringTag] = expected;
     
    147152                                }
    148153
    149                                 var fakerConstructor = { constructor: global[expected] };
     154                                /** @typedef {Exclude<typeof expected, 'GeneratorFunction' | 'AsyncFunction' | 'Foo'>} GlobalKey */
     155
     156                                var fakerConstructor = {
     157                                        // eslint-disable-next-line no-extra-parens
     158                                        constructor: global[/** @type {GlobalKey} */ (expected)] || tests[expected]
     159                                };
    150160                                t.equal(
    151161                                        which(fakerConstructor),
     
    155165
    156166                                if (hasToStringTag) {
    157                                         var fakerConstructorTag = { constructor: global[expected] };
     167                                        /** @type {{ constructor: Function } & { [k in typeof Symbol.toStringTag]?: string }} */
     168                                        var fakerConstructorTag = {
     169                                                // eslint-disable-next-line no-extra-parens
     170                                                constructor: global[/** @type {GlobalKey} */ (expected)] || tests[expected]
     171                                        };
    158172                                        fakerConstructorTag[Symbol.toStringTag] = expected;
    159173                                        t.equal(
Note: See TracChangeset for help on using the changeset viewer.