Changeset 79a0317 for imaps-frontend/node_modules/side-channel
- Timestamp:
- 01/21/25 03:08:24 (3 days ago)
- Branches:
- main
- Parents:
- 0c6b92a
- Location:
- imaps-frontend/node_modules/side-channel
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/side-channel/.eslintrc
r0c6b92a r79a0317 5 5 6 6 "rules": { 7 "id-length": 0, 7 8 "max-lines-per-function": 0, 8 9 "multiline-comment-style": 1, -
imaps-frontend/node_modules/side-channel/CHANGELOG.md
r0c6b92a r79a0317 5 5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) 6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 8 ## [v1.1.0](https://github.com/ljharb/side-channel/compare/v1.0.6...v1.1.0) - 2024-12-11 9 10 ### Commits 11 12 - [Refactor] extract implementations to `side-channel-weakmap`, `side-channel-map`, `side-channel-list` [`ada5955`](https://github.com/ljharb/side-channel/commit/ada595549a5c4c6c853756d598846b180941c6da) 13 - [New] add `channel.delete` [`c01d2d3`](https://github.com/ljharb/side-channel/commit/c01d2d3fd51dbb1ce6da72ad7916e61bd6172aad) 14 - [types] improve types [`0c54356`](https://github.com/ljharb/side-channel/commit/0c5435651417df41b8cc1a5f7cdce8bffae68cde) 15 - [readme] add content [`be24868`](https://github.com/ljharb/side-channel/commit/be248682ac294b0e22c883092c45985aa91c490a) 16 - [actions] split out node 10-20, and 20+ [`c4488e2`](https://github.com/ljharb/side-channel/commit/c4488e241ef3d49a19fe266ac830a2e644305911) 17 - [types] use shared tsconfig [`0e0d57c`](https://github.com/ljharb/side-channel/commit/0e0d57c2ff17c7b45c6cbd43ebcf553edc9e3adc) 18 - [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/get-intrinsic`, `@types/object-inspect`, `@types/tape`, `auto-changelog`, `tape` [`fb4f622`](https://github.com/ljharb/side-channel/commit/fb4f622e64a99a1e40b6e5cd7691674a9dc429e4) 19 - [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`b78336b`](https://github.com/ljharb/side-channel/commit/b78336b886172d1b457d414ac9e28de8c5fecc78) 20 - [Tests] replace `aud` with `npm audit` [`ee3ab46`](https://github.com/ljharb/side-channel/commit/ee3ab4690d954311c35115651bcfd45edd205aa1) 21 - [Dev Deps] add missing peer dep [`c03e21a`](https://github.com/ljharb/side-channel/commit/c03e21a7def3b67cdc15ae22316884fefcb2f6a8) 7 22 8 23 ## [v1.0.6](https://github.com/ljharb/side-channel/compare/v1.0.5...v1.0.6) - 2024-02-29 -
imaps-frontend/node_modules/side-channel/README.md
r0c6b92a r79a0317 1 # side-channel 1 # side-channel <sup>[![Version Badge][npm-version-svg]][package-url]</sup> 2 3 [![github actions][actions-image]][actions-url] 4 [![coverage][codecov-image]][codecov-url] 5 [![License][license-image]][license-url] 6 [![Downloads][downloads-image]][downloads-url] 7 8 [![npm badge][npm-badge-png]][package-url] 9 2 10 Store information about any JS value in a side channel. Uses WeakMap if available. 11 12 Warning: in an environment that lacks `WeakMap`, this implementation will leak memory until you `delete` the `key`. 13 14 ## Getting started 15 16 ```sh 17 npm install --save side-channel 18 ``` 19 20 ## Usage/Examples 21 22 ```js 23 const assert = require('assert'); 24 const getSideChannel = require('side-channel'); 25 26 const channel = getSideChannel(); 27 28 const key = {}; 29 assert.equal(channel.has(key), false); 30 assert.throws(() => channel.assert(key), TypeError); 31 32 channel.set(key, 42); 33 34 channel.assert(key); // does not throw 35 assert.equal(channel.has(key), true); 36 assert.equal(channel.get(key), 42); 37 38 channel.delete(key); 39 assert.equal(channel.has(key), false); 40 assert.throws(() => channel.assert(key), TypeError); 41 ``` 42 43 ## Tests 44 45 Clone the repo, `npm install`, and run `npm test` 46 47 [package-url]: https://npmjs.org/package/side-channel 48 [npm-version-svg]: https://versionbadg.es/ljharb/side-channel.svg 49 [deps-svg]: https://david-dm.org/ljharb/side-channel.svg 50 [deps-url]: https://david-dm.org/ljharb/side-channel 51 [dev-deps-svg]: https://david-dm.org/ljharb/side-channel/dev-status.svg 52 [dev-deps-url]: https://david-dm.org/ljharb/side-channel#info=devDependencies 53 [npm-badge-png]: https://nodei.co/npm/side-channel.png?downloads=true&stars=true 54 [license-image]: https://img.shields.io/npm/l/side-channel.svg 55 [license-url]: LICENSE 56 [downloads-image]: https://img.shields.io/npm/dm/side-channel.svg 57 [downloads-url]: https://npm-stat.com/charts.html?package=side-channel 58 [codecov-image]: https://codecov.io/gh/ljharb/side-channel/branch/main/graphs/badge.svg 59 [codecov-url]: https://app.codecov.io/gh/ljharb/side-channel/ 60 [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel 61 [actions-url]: https://github.com/ljharb/side-channel/actions -
imaps-frontend/node_modules/side-channel/index.d.ts
r0c6b92a r79a0317 1 import getSideChannelList from 'side-channel-list'; 2 import getSideChannelMap from 'side-channel-map'; 3 import getSideChannelWeakMap from 'side-channel-weakmap'; 4 1 5 declare namespace getSideChannel { 2 type Key = unknown; 3 type ListNode<T> = { 4 key: Key; 5 next: ListNode<T>; 6 value: T; 7 }; 8 type RootNode<T> = { 9 key: object; 10 next: null | ListNode<T>; 11 }; 12 function listGetNode<T>(list: RootNode<T>, key: ListNode<T>['key']): ListNode<T> | void; 13 function listGet<T>(objects: RootNode<T>, key: ListNode<T>['key']): T | void; 14 function listSet<T>(objects: RootNode<T>, key: ListNode<T>['key'], value: T): void; 15 function listHas<T>(objects: RootNode<T>, key: ListNode<T>['key']): boolean; 16 17 type Channel = { 18 assert: (key: Key) => void; 19 has: (key: Key) => boolean; 20 get: <T>(key: Key) => T; 21 set: <T>(key: Key, value: T) => void; 22 } 6 type Channel<K, V> = 7 | getSideChannelList.Channel<K, V> 8 | ReturnType<Exclude<typeof getSideChannelMap<K, V>, false>> 9 | ReturnType<Exclude<typeof getSideChannelWeakMap<K, V>, false>>; 23 10 } 24 11 25 declare function getSideChannel (): getSideChannel.Channel;12 declare function getSideChannel<K, V>(): getSideChannel.Channel<K, V>; 26 13 27 14 export = getSideChannel; -
imaps-frontend/node_modules/side-channel/index.js
r0c6b92a r79a0317 1 1 'use strict'; 2 2 3 var GetIntrinsic = require('get-intrinsic'); 4 var callBound = require('call-bind/callBound'); 3 var $TypeError = require('es-errors/type'); 5 4 var inspect = require('object-inspect'); 5 var getSideChannelList = require('side-channel-list'); 6 var getSideChannelMap = require('side-channel-map'); 7 var getSideChannelWeakMap = require('side-channel-weakmap'); 6 8 7 var $TypeError = require('es-errors/type'); 8 var $WeakMap = GetIntrinsic('%WeakMap%', true); 9 var $Map = GetIntrinsic('%Map%', true); 10 11 var $weakMapGet = callBound('WeakMap.prototype.get', true); 12 var $weakMapSet = callBound('WeakMap.prototype.set', true); 13 var $weakMapHas = callBound('WeakMap.prototype.has', true); 14 var $mapGet = callBound('Map.prototype.get', true); 15 var $mapSet = callBound('Map.prototype.set', true); 16 var $mapHas = callBound('Map.prototype.has', true); 17 18 /* 19 * This function traverses the list returning the node corresponding to the given key. 20 * 21 * That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly. 22 */ 23 /** @type {import('.').listGetNode} */ 24 var listGetNode = function (list, key) { // eslint-disable-line consistent-return 25 /** @type {typeof list | NonNullable<(typeof list)['next']>} */ 26 var prev = list; 27 /** @type {(typeof list)['next']} */ 28 var curr; 29 for (; (curr = prev.next) !== null; prev = curr) { 30 if (curr.key === key) { 31 prev.next = curr.next; 32 // eslint-disable-next-line no-extra-parens 33 curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next); 34 list.next = curr; // eslint-disable-line no-param-reassign 35 return curr; 36 } 37 } 38 }; 39 40 /** @type {import('.').listGet} */ 41 var listGet = function (objects, key) { 42 var node = listGetNode(objects, key); 43 return node && node.value; 44 }; 45 /** @type {import('.').listSet} */ 46 var listSet = function (objects, key, value) { 47 var node = listGetNode(objects, key); 48 if (node) { 49 node.value = value; 50 } else { 51 // Prepend the new node to the beginning of the list 52 objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens 53 key: key, 54 next: objects.next, 55 value: value 56 }); 57 } 58 }; 59 /** @type {import('.').listHas} */ 60 var listHas = function (objects, key) { 61 return !!listGetNode(objects, key); 62 }; 9 var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; 63 10 64 11 /** @type {import('.')} */ 65 12 module.exports = function getSideChannel() { 66 /** @type {WeakMap<object, unknown>} */ var $wm; 67 /** @type {Map<object, unknown>} */ var $m; 68 /** @type {import('.').RootNode<unknown>} */ var $o; 13 /** @typedef {ReturnType<typeof getSideChannel>} Channel */ 69 14 70 /** @type {import('.').Channel} */ 15 /** @type {Channel | undefined} */ var $channelData; 16 17 /** @type {Channel} */ 71 18 var channel = { 72 19 assert: function (key) { … … 75 22 } 76 23 }, 77 get: function (key) { // eslint-disable-line consistent-return 78 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 79 if ($wm) { 80 return $weakMapGet($wm, key); 81 } 82 } else if ($Map) { 83 if ($m) { 84 return $mapGet($m, key); 85 } 86 } else { 87 if ($o) { // eslint-disable-line no-lonely-if 88 return listGet($o, key); 89 } 90 } 24 'delete': function (key) { 25 return !!$channelData && $channelData['delete'](key); 26 }, 27 get: function (key) { 28 return $channelData && $channelData.get(key); 91 29 }, 92 30 has: function (key) { 93 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 94 if ($wm) { 95 return $weakMapHas($wm, key); 96 } 97 } else if ($Map) { 98 if ($m) { 99 return $mapHas($m, key); 100 } 101 } else { 102 if ($o) { // eslint-disable-line no-lonely-if 103 return listHas($o, key); 104 } 105 } 106 return false; 31 return !!$channelData && $channelData.has(key); 107 32 }, 108 33 set: function (key, value) { 109 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 110 if (!$wm) { 111 $wm = new $WeakMap(); 112 } 113 $weakMapSet($wm, key, value); 114 } else if ($Map) { 115 if (!$m) { 116 $m = new $Map(); 117 } 118 $mapSet($m, key, value); 119 } else { 120 if (!$o) { 121 // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head 122 $o = { key: {}, next: null }; 123 } 124 listSet($o, key, value); 34 if (!$channelData) { 35 $channelData = makeChannel(); 125 36 } 37 38 $channelData.set(key, value); 126 39 } 127 40 }; 41 // @ts-expect-error TODO: figure out why this is erroring 128 42 return channel; 129 43 }; -
imaps-frontend/node_modules/side-channel/package.json
r0c6b92a r79a0317 1 1 { 2 "name": "side-channel", 3 "version": "1.0.6", 4 "description": "Store information about any JS value in a side channel. Uses WeakMap if available.", 5 "main": "index.js", 6 "exports": { 7 "./package.json": "./package.json", 8 ".": "./index.js" 9 }, 10 "types": "./index.d.ts", 11 "scripts": { 12 "prepack": "npmignore --auto --commentLines=autogenerated", 13 "prepublishOnly": "safe-publish-latest", 14 "prepublish": "not-in-publish || npm run prepublishOnly", 15 "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", 16 "lint": "eslint --ext=js,mjs .", 17 "postlint": "tsc -p .", 18 "pretest": "npm run lint", 19 "tests-only": "nyc tape 'test/**/*.js'", 20 "test": "npm run tests-only", 21 "posttest": "aud --production", 22 "version": "auto-changelog && git add CHANGELOG.md", 23 "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" 24 }, 25 "repository": { 26 "type": "git", 27 "url": "git+https://github.com/ljharb/side-channel.git" 28 }, 29 "keywords": [ 30 "weakmap", 31 "map", 32 "side", 33 "channel", 34 "metadata" 35 ], 36 "author": "Jordan Harband <ljharb@gmail.com>", 37 "funding": { 38 "url": "https://github.com/sponsors/ljharb" 39 }, 40 "license": "MIT", 41 "bugs": { 42 "url": "https://github.com/ljharb/side-channel/issues" 43 }, 44 "homepage": "https://github.com/ljharb/side-channel#readme", 45 "devDependencies": { 46 "@ljharb/eslint-config": "^21.1.0", 47 "@types/call-bind": "^1.0.5", 48 "@types/get-intrinsic": "^1.2.2", 49 "@types/object-inspect": "^1.8.4", 50 "@types/tape": "^5.6.4", 51 "aud": "^2.0.4", 52 "auto-changelog": "^2.4.0", 53 "eclint": "^2.8.1", 54 "eslint": "=8.8.0", 55 "in-publish": "^2.0.1", 56 "npmignore": "^0.3.1", 57 "nyc": "^10.3.2", 58 "safe-publish-latest": "^2.0.0", 59 "tape": "^5.7.5", 60 "typescript": "next" 61 }, 62 "dependencies": { 63 "call-bind": "^1.0.7", 64 "es-errors": "^1.3.0", 65 "get-intrinsic": "^1.2.4", 66 "object-inspect": "^1.13.1" 67 }, 68 "auto-changelog": { 69 "output": "CHANGELOG.md", 70 "template": "keepachangelog", 71 "unreleased": false, 72 "commitLimit": false, 73 "backfillLimit": false, 74 "hideCredit": true 75 }, 76 "publishConfig": { 77 "ignore": [ 78 ".github/workflows" 79 ] 80 }, 81 "engines": { 82 "node": ">= 0.4" 83 } 2 "_from": "side-channel@^1.1.0", 3 "_id": "side-channel@1.1.0", 4 "_inBundle": false, 5 "_integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", 6 "_location": "/side-channel", 7 "_phantomChildren": {}, 8 "_requested": { 9 "type": "range", 10 "registry": true, 11 "raw": "side-channel@^1.1.0", 12 "name": "side-channel", 13 "escapedName": "side-channel", 14 "rawSpec": "^1.1.0", 15 "saveSpec": null, 16 "fetchSpec": "^1.1.0" 17 }, 18 "_requiredBy": [ 19 "/internal-slot", 20 "/string.prototype.matchall" 21 ], 22 "_resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", 23 "_shasum": "c3fcff9c4da932784873335ec9765fa94ff66bc9", 24 "_spec": "side-channel@^1.1.0", 25 "_where": "/home/stevetosak/Proekt/IMaps/imaps-frontend/node_modules/internal-slot", 26 "author": { 27 "name": "Jordan Harband", 28 "email": "ljharb@gmail.com" 29 }, 30 "auto-changelog": { 31 "output": "CHANGELOG.md", 32 "template": "keepachangelog", 33 "unreleased": false, 34 "commitLimit": false, 35 "backfillLimit": false, 36 "hideCredit": true 37 }, 38 "bugs": { 39 "url": "https://github.com/ljharb/side-channel/issues" 40 }, 41 "bundleDependencies": false, 42 "dependencies": { 43 "es-errors": "^1.3.0", 44 "object-inspect": "^1.13.3", 45 "side-channel-list": "^1.0.0", 46 "side-channel-map": "^1.0.1", 47 "side-channel-weakmap": "^1.0.2" 48 }, 49 "deprecated": false, 50 "description": "Store information about any JS value in a side channel. Uses WeakMap if available.", 51 "devDependencies": { 52 "@arethetypeswrong/cli": "^0.17.1", 53 "@ljharb/eslint-config": "^21.1.1", 54 "@ljharb/tsconfig": "^0.2.2", 55 "@types/object-inspect": "^1.13.0", 56 "@types/tape": "^5.6.5", 57 "auto-changelog": "^2.5.0", 58 "eclint": "^2.8.1", 59 "encoding": "^0.1.13", 60 "eslint": "=8.8.0", 61 "in-publish": "^2.0.1", 62 "npmignore": "^0.3.1", 63 "nyc": "^10.3.2", 64 "safe-publish-latest": "^2.0.0", 65 "tape": "^5.9.0", 66 "typescript": "next" 67 }, 68 "engines": { 69 "node": ">= 0.4" 70 }, 71 "exports": { 72 ".": "./index.js", 73 "./package.json": "./package.json" 74 }, 75 "funding": { 76 "url": "https://github.com/sponsors/ljharb" 77 }, 78 "homepage": "https://github.com/ljharb/side-channel#readme", 79 "keywords": [ 80 "weakmap", 81 "map", 82 "side", 83 "channel", 84 "metadata" 85 ], 86 "license": "MIT", 87 "main": "index.js", 88 "name": "side-channel", 89 "publishConfig": { 90 "ignore": [ 91 ".github/workflows" 92 ] 93 }, 94 "repository": { 95 "type": "git", 96 "url": "git+https://github.com/ljharb/side-channel.git" 97 }, 98 "scripts": { 99 "lint": "eslint --ext=js,mjs .", 100 "postlint": "tsc -p . && attw -P", 101 "posttest": "npx npm@'>=10.2' audit --production", 102 "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", 103 "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", 104 "prepack": "npmignore --auto --commentLines=autogenerated", 105 "prepublish": "not-in-publish || npm run prepublishOnly", 106 "prepublishOnly": "safe-publish-latest", 107 "pretest": "npm run lint", 108 "test": "npm run tests-only", 109 "tests-only": "nyc tape 'test/**/*.js'", 110 "version": "auto-changelog && git add CHANGELOG.md" 111 }, 112 "types": "./index.d.ts", 113 "version": "1.1.0" 84 114 } -
imaps-frontend/node_modules/side-channel/test/index.js
r0c6b92a r79a0317 5 5 var getSideChannel = require('../'); 6 6 7 test(' export', function (t) {8 t. equal(typeof getSideChannel, 'function', 'is a function');9 t.equal(getSideChannel.length, 0, 'takes no arguments');7 test('getSideChannel', function (t) { 8 t.test('export', function (st) { 9 st.equal(typeof getSideChannel, 'function', 'is a function'); 10 10 11 var channel = getSideChannel(); 12 t.ok(channel, 'is truthy'); 13 t.equal(typeof channel, 'object', 'is an object'); 11 st.equal(getSideChannel.length, 0, 'takes no arguments'); 12 13 var channel = getSideChannel(); 14 st.ok(channel, 'is truthy'); 15 st.equal(typeof channel, 'object', 'is an object'); 16 st.end(); 17 }); 18 19 t.test('assert', function (st) { 20 var channel = getSideChannel(); 21 st['throws']( 22 function () { channel.assert({}); }, 23 TypeError, 24 'nonexistent value throws' 25 ); 26 27 var o = {}; 28 channel.set(o, 'data'); 29 st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); 30 31 st.end(); 32 }); 33 34 t.test('has', function (st) { 35 var channel = getSideChannel(); 36 /** @type {unknown[]} */ var o = []; 37 38 st.equal(channel.has(o), false, 'nonexistent value yields false'); 39 40 channel.set(o, 'foo'); 41 st.equal(channel.has(o), true, 'existent value yields true'); 42 43 st.equal(channel.has('abc'), false, 'non object value non existent yields false'); 44 45 channel.set('abc', 'foo'); 46 st.equal(channel.has('abc'), true, 'non object value that exists yields true'); 47 48 st.end(); 49 }); 50 51 t.test('get', function (st) { 52 var channel = getSideChannel(); 53 var o = {}; 54 st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); 55 56 var data = {}; 57 channel.set(o, data); 58 st.equal(channel.get(o), data, '"get" yields data set by "set"'); 59 60 st.end(); 61 }); 62 63 t.test('set', function (st) { 64 var channel = getSideChannel(); 65 var o = function () {}; 66 st.equal(channel.get(o), undefined, 'value not set'); 67 68 channel.set(o, 42); 69 st.equal(channel.get(o), 42, 'value was set'); 70 71 channel.set(o, Infinity); 72 st.equal(channel.get(o), Infinity, 'value was set again'); 73 74 var o2 = {}; 75 channel.set(o2, 17); 76 st.equal(channel.get(o), Infinity, 'o is not modified'); 77 st.equal(channel.get(o2), 17, 'o2 is set'); 78 79 channel.set(o, 14); 80 st.equal(channel.get(o), 14, 'o is modified'); 81 st.equal(channel.get(o2), 17, 'o2 is not modified'); 82 83 st.end(); 84 }); 85 86 t.test('delete', function (st) { 87 var channel = getSideChannel(); 88 var o = {}; 89 st.equal(channel['delete']({}), false, 'nonexistent value yields false'); 90 91 channel.set(o, 42); 92 st.equal(channel.has(o), true, 'value is set'); 93 94 st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); 95 96 st.equal(channel['delete'](o), true, 'deleted value yields true'); 97 98 st.equal(channel.has(o), false, 'value is no longer set'); 99 100 st.end(); 101 }); 14 102 15 103 t.end(); 16 104 }); 17 18 test('assert', function (t) {19 var channel = getSideChannel();20 t['throws'](21 function () { channel.assert({}); },22 TypeError,23 'nonexistent value throws'24 );25 26 var o = {};27 channel.set(o, 'data');28 t.doesNotThrow(function () { channel.assert(o); }, 'existent value noops');29 30 t.end();31 });32 33 test('has', function (t) {34 var channel = getSideChannel();35 /** @type {unknown[]} */ var o = [];36 37 t.equal(channel.has(o), false, 'nonexistent value yields false');38 39 channel.set(o, 'foo');40 t.equal(channel.has(o), true, 'existent value yields true');41 42 t.equal(channel.has('abc'), false, 'non object value non existent yields false');43 44 channel.set('abc', 'foo');45 t.equal(channel.has('abc'), true, 'non object value that exists yields true');46 47 t.end();48 });49 50 test('get', function (t) {51 var channel = getSideChannel();52 var o = {};53 t.equal(channel.get(o), undefined, 'nonexistent value yields undefined');54 55 var data = {};56 channel.set(o, data);57 t.equal(channel.get(o), data, '"get" yields data set by "set"');58 59 t.end();60 });61 62 test('set', function (t) {63 var channel = getSideChannel();64 var o = function () {};65 t.equal(channel.get(o), undefined, 'value not set');66 67 channel.set(o, 42);68 t.equal(channel.get(o), 42, 'value was set');69 70 channel.set(o, Infinity);71 t.equal(channel.get(o), Infinity, 'value was set again');72 73 var o2 = {};74 channel.set(o2, 17);75 t.equal(channel.get(o), Infinity, 'o is not modified');76 t.equal(channel.get(o2), 17, 'o2 is set');77 78 channel.set(o, 14);79 t.equal(channel.get(o), 14, 'o is modified');80 t.equal(channel.get(o2), 17, 'o2 is not modified');81 82 t.end();83 }); -
imaps-frontend/node_modules/side-channel/tsconfig.json
r0c6b92a r79a0317 1 1 { 2 "extends": "@ljharb/tsconfig", 2 3 "compilerOptions": { 3 /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 5 /* Projects */ 6 7 /* Language and Environment */ 8 "target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 9 // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 10 // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 11 "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 12 // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 13 14 /* Modules */ 15 "module": "commonjs", /* Specify what module code is generated. */ 16 // "rootDir": "./", /* Specify the root folder within your source files. */ 17 // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ 18 // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 19 // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 20 // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 21 // "typeRoots": ["types"], /* Specify multiple folders that act like `./node_modules/@types`. */ 22 "resolveJsonModule": true, /* Enable importing .json files. */ 23 // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ 24 25 /* JavaScript Support */ 26 "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ 27 "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 28 "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ 29 30 /* Emit */ 31 "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 32 "declarationMap": true, /* Create sourcemaps for d.ts files. */ 33 "noEmit": true, /* Disable emitting files from a compilation. */ 34 35 /* Interop Constraints */ 36 "allowSyntheticDefaultImports": true, /* Allow `import x from y` when a module doesn't have a default export. */ 37 "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ 38 "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 39 40 /* Type Checking */ 41 "strict": true, /* Enable all strict type-checking options. */ 42 43 /* Completeness */ 44 // "skipLibCheck": true /* Skip type checking all .d.ts files. */ 4 "target": "es2021", 45 5 }, 46 6 "exclude": [ 47 7 "coverage", 48 "test/list-exports"49 8 ], 50 9 }
Note:
See TracChangeset
for help on using the changeset viewer.