text
stringlengths
55
456k
metadata
dict
# gopd <sup>[![Version Badge][npm-version-svg]][package-url]</sup> [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][npm-badge-png]][package-url] `Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation. ## Usage ```javascript var gOPD = require('gopd'); var assert = require('assert'); if (gOPD) { assert.equal(typeof gOPD, 'function', 'descriptors supported'); // use gOPD like Object.getOwnPropertyDescriptor here } else { assert.ok(!gOPD, 'descriptors not supported'); } ``` [package-url]: https://npmjs.org/package/gopd [npm-version-svg]: https://versionbadg.es/ljharb/gopd.svg [deps-svg]: https://david-dm.org/ljharb/gopd.svg [deps-url]: https://david-dm.org/ljharb/gopd [dev-deps-svg]: https://david-dm.org/ljharb/gopd/dev-status.svg [dev-deps-url]: https://david-dm.org/ljharb/gopd#info=devDependencies [npm-badge-png]: https://nodei.co/npm/gopd.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/gopd.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/gopd.svg [downloads-url]: https://npm-stat.com/charts.html?package=gopd [codecov-image]: https://codecov.io/gh/ljharb/gopd/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/ljharb/gopd/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/gopd [actions-url]: https://github.com/ljharb/gopd/actions
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/gopd/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/gopd/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1561 }
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [v1.0.2](https://github.com/inspect-js/has-property-descriptors/compare/v1.0.1...v1.0.2) - 2024-02-12 ### Commits - [Refactor] use `es-define-property` [`f93a8c8`](https://github.com/inspect-js/has-property-descriptors/commit/f93a8c85eba70cbceab500f2619fb5cce73a1805) - [Dev Deps] update `aud`, `npmignore`, `tape` [`42b0c9d`](https://github.com/inspect-js/has-property-descriptors/commit/42b0c9d1c23e747755f0f2924923c418ea34a9ee) - [Deps] update `get-intrinsic` [`35e9b46`](https://github.com/inspect-js/has-property-descriptors/commit/35e9b46a7f14331bf0de98b644dd803676746037) ## [v1.0.1](https://github.com/inspect-js/has-property-descriptors/compare/v1.0.0...v1.0.1) - 2023-10-20 ### Commits - [meta] use `npmignore` to autogenerate an npmignore file [`5bbf4da`](https://github.com/inspect-js/has-property-descriptors/commit/5bbf4dae1b58950d87bb3af508bee7513e640868) - [actions] update rebase action to use reusable workflow [`3a5585b`](https://github.com/inspect-js/has-property-descriptors/commit/3a5585bf74988f71a8f59e67a07d594e62c51fd8) - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`e5c1212`](https://github.com/inspect-js/has-property-descriptors/commit/e5c1212048a8fda549794c47863724ca60b89cae) - [Dev Deps] update `aud`, `tape` [`e942917`](https://github.com/inspect-js/has-property-descriptors/commit/e942917b6c2f7c090d5623048989cf20d0834ebf) - [Deps] update `get-intrinsic` [`f4a44ec`](https://github.com/inspect-js/has-property-descriptors/commit/f4a44ec6d94146fa6c550d3c15c31a2062c83ef4) - [Deps] update `get-intrinsic` [`eeb275b`](https://github.com/inspect-js/has-property-descriptors/commit/eeb275b473e5d72ca843b61ca25cfcb06a5d4300) ## v1.0.0 - 2022-04-14 ### Commits - Initial implementation, tests [`303559f`](https://github.com/inspect-js/has-property-descriptors/commit/303559f2a72dfe7111573a1aec475ed4a184c35a) - Initial commit [`3a7ca2d`](https://github.com/inspect-js/has-property-descriptors/commit/3a7ca2dc49f1fff0279a28bb16265e7615e14749) - read me [`dd73dce`](https://github.com/inspect-js/has-property-descriptors/commit/dd73dce09d89d0f7a4a6e3b1e562a506f979a767) - npm init [`c1e6557`](https://github.com/inspect-js/has-property-descriptors/commit/c1e655779de632d68cb944c50da6b71bcb7b8c85) - Only apps should have lockfiles [`e72f7c6`](https://github.com/inspect-js/has-property-descriptors/commit/e72f7c68de534b2d273ee665f8b18d4ecc7f70b0)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/has-property-descriptors/CHANGELOG.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/has-property-descriptors/CHANGELOG.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2647 }
# has-property-descriptors <sup>[![Version Badge][npm-version-svg]][package-url]</sup> [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][deps-svg]][deps-url] [![dev dependency status][dev-deps-svg]][dev-deps-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][npm-badge-png]][package-url] Does the environment have full property descriptor support? Handles IE 8's broken defineProperty/gOPD. ## Example ```js var hasPropertyDescriptors = require('has-property-descriptors'); var assert = require('assert'); assert.equal(hasPropertyDescriptors(), true); // will be `false` in IE 6-8, and ES5 engines // Arrays can not have their length `[[Defined]]` in some engines assert.equal(hasPropertyDescriptors.hasArrayLengthDefineBug(), false); // will be `true` in Firefox 4-22, and node v0.6 ``` ## Tests Simply clone the repo, `npm install`, and run `npm test` [package-url]: https://npmjs.org/package/has-property-descriptors [npm-version-svg]: https://versionbadg.es/inspect-js/has-property-descriptors.svg [deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors.svg [deps-url]: https://david-dm.org/inspect-js/has-property-descriptors [dev-deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors/dev-status.svg [dev-deps-url]: https://david-dm.org/inspect-js/has-property-descriptors#info=devDependencies [npm-badge-png]: https://nodei.co/npm/has-property-descriptors.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/has-property-descriptors.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/has-property-descriptors.svg [downloads-url]: https://npm-stat.com/charts.html?package=has-property-descriptors [codecov-image]: https://codecov.io/gh/inspect-js/has-property-descriptors/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/inspect-js/has-property-descriptors/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-property-descriptors [actions-url]: https://github.com/inspect-js/has-property-descriptors/actions
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/has-property-descriptors/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/has-property-descriptors/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2205 }
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [v1.0.3](https://github.com/inspect-js/has-proto/compare/v1.0.2...v1.0.3) - 2024-02-19 ### Commits - [types] add missing declaration file [`26ecade`](https://github.com/inspect-js/has-proto/commit/26ecade05d253bb5dc376945ee3186d1fbe334f8) ## [v1.0.2](https://github.com/inspect-js/has-proto/compare/v1.0.1...v1.0.2) - 2024-02-19 ### Commits - add types [`6435262`](https://github.com/inspect-js/has-proto/commit/64352626cf511c0276d5f4bb6be770a0bf0f8524) - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `tape` [`f16a5e4`](https://github.com/inspect-js/has-proto/commit/f16a5e4121651e551271419f9d60fdd3561fd82c) - [Refactor] tiny cleanup [`d1f1a4b`](https://github.com/inspect-js/has-proto/commit/d1f1a4bdc135f115a10f148ce302676224534702) - [meta] add `sideEffects` flag [`e7ab1a6`](https://github.com/inspect-js/has-proto/commit/e7ab1a6f153b3e80dee68d1748b71e46767a0531) ## [v1.0.1](https://github.com/inspect-js/has-proto/compare/v1.0.0...v1.0.1) - 2022-12-21 ### Commits - [meta] correct URLs and description [`ef34483`](https://github.com/inspect-js/has-proto/commit/ef34483ca0d35680f271b6b96e35526151b25dfc) - [patch] add an additional criteria [`e81959e`](https://github.com/inspect-js/has-proto/commit/e81959ed7c7a77fbf459f00cb4ef824f1099497f) - [Dev Deps] update `aud` [`2bec2c4`](https://github.com/inspect-js/has-proto/commit/2bec2c47b072b122ff5443fba0263f6dc649531f) ## v1.0.0 - 2022-12-12 ### Commits - Initial implementation, tests, readme [`6886fea`](https://github.com/inspect-js/has-proto/commit/6886fea578f67daf69a7920b2eb7637ea6ebb0bc) - Initial commit [`99129c8`](https://github.com/inspect-js/has-proto/commit/99129c8f42471ac89cb681ba9cb9d52a583eb94f) - npm init [`2844ad8`](https://github.com/inspect-js/has-proto/commit/2844ad8e75b84d66a46765b3bab9d2e8ea692e10) - Only apps should have lockfiles [`c65bc5e`](https://github.com/inspect-js/has-proto/commit/c65bc5e40b9004463f7336d47c67245fb139a36a)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/has-proto/CHANGELOG.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/has-proto/CHANGELOG.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2199 }
# has-proto <sup>[![Version Badge][npm-version-svg]][package-url]</sup> [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][npm-badge-png]][package-url] Does this environment have the ability to set the [[Prototype]] of an object on creation with `__proto__`? ## Example ```js var hasProto = require('has-proto'); var assert = require('assert'); assert.equal(typeof hasProto(), 'boolean'); ``` ## Tests Simply clone the repo, `npm install`, and run `npm test` [package-url]: https://npmjs.org/package/has-proto [npm-version-svg]: https://versionbadg.es/inspect-js/has-proto.svg [deps-svg]: https://david-dm.org/inspect-js/has-proto.svg [deps-url]: https://david-dm.org/inspect-js/has-proto [dev-deps-svg]: https://david-dm.org/inspect-js/has-proto/dev-status.svg [dev-deps-url]: https://david-dm.org/inspect-js/has-proto#info=devDependencies [npm-badge-png]: https://nodei.co/npm/has-proto.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/has-proto.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/has-proto.svg [downloads-url]: https://npm-stat.com/charts.html?package=has-proto [codecov-image]: https://codecov.io/gh/inspect-js/has-proto/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/inspect-js/has-proto/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-proto [actions-url]: https://github.com/inspect-js/has-proto/actions
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/has-proto/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/has-proto/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1622 }
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [v1.0.3](https://github.com/inspect-js/has-symbols/compare/v1.0.2...v1.0.3) - 2022-03-01 ### Commits - [actions] use `node/install` instead of `node/run`; use `codecov` action [`518b28f`](https://github.com/inspect-js/has-symbols/commit/518b28f6c5a516cbccae30794e40aa9f738b1693) - [meta] add `bugs` and `homepage` fields; reorder package.json [`c480b13`](https://github.com/inspect-js/has-symbols/commit/c480b13fd6802b557e1cef9749872cb5fdeef744) - [actions] reuse common workflows [`01d0ee0`](https://github.com/inspect-js/has-symbols/commit/01d0ee0a8d97c0947f5edb73eb722027a77b2b07) - [actions] update codecov uploader [`6424ebe`](https://github.com/inspect-js/has-symbols/commit/6424ebe86b2c9c7c3d2e9bd4413a4e4f168cb275) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`dfa7e7f`](https://github.com/inspect-js/has-symbols/commit/dfa7e7ff38b594645d8c8222aab895157fa7e282) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`0c8d436`](https://github.com/inspect-js/has-symbols/commit/0c8d43685c45189cea9018191d4fd7eca91c9d02) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`9026554`](https://github.com/inspect-js/has-symbols/commit/902655442a1bf88e72b42345494ef0c60f5d36ab) - [readme] add actions and codecov badges [`eaa9682`](https://github.com/inspect-js/has-symbols/commit/eaa9682f990f481d3acf7a1c7600bec36f7b3adc) - [Dev Deps] update `eslint`, `tape` [`bc7a3ba`](https://github.com/inspect-js/has-symbols/commit/bc7a3ba46f27b7743f8a2579732d59d1b9ac791e) - [Dev Deps] update `eslint`, `auto-changelog` [`0ace00a`](https://github.com/inspect-js/has-symbols/commit/0ace00af08a88cdd1e6ce0d60357d941c60c2d9f) - [meta] use `prepublishOnly` script for npm 7+ [`093f72b`](https://github.com/inspect-js/has-symbols/commit/093f72bc2b0ed00c781f444922a5034257bf561d) - [Tests] test on all 16 minors [`9b80d3d`](https://github.com/inspect-js/has-symbols/commit/9b80d3d9102529f04c20ec5b1fcc6e38426c6b03) ## [v1.0.2](https://github.com/inspect-js/has-symbols/compare/v1.0.1...v1.0.2) - 2021-02-27 ### Fixed - [Fix] use a universal way to get the original Symbol [`#11`](https://github.com/inspect-js/has-symbols/issues/11) ### Commits - [Tests] migrate tests to Github Actions [`90ae798`](https://github.com/inspect-js/has-symbols/commit/90ae79820bdfe7bc703d67f5f3c5e205f98556d3) - [meta] do not publish github action workflow files [`29e60a1`](https://github.com/inspect-js/has-symbols/commit/29e60a1b7c25c7f1acf7acff4a9320d0d10c49b4) - [Tests] run `nyc` on all tests [`8476b91`](https://github.com/inspect-js/has-symbols/commit/8476b915650d360915abe2522505abf4b0e8f0ae) - [readme] fix repo URLs, remove defunct badges [`126288e`](https://github.com/inspect-js/has-symbols/commit/126288ecc1797c0a40247a6b78bcb2e0bc5d7036) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `core-js`, `get-own-property-symbols` [`d84bdfa`](https://github.com/inspect-js/has-symbols/commit/d84bdfa48ac5188abbb4904b42614cd6c030940a) - [Tests] fix linting errors [`0df3070`](https://github.com/inspect-js/has-symbols/commit/0df3070b981b6c9f2ee530c09189a7f5c6def839) - [actions] add "Allow Edits" workflow [`1e6bc29`](https://github.com/inspect-js/has-symbols/commit/1e6bc29b188f32b9648657b07eda08504be5aa9c) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`36cea2a`](https://github.com/inspect-js/has-symbols/commit/36cea2addd4e6ec435f35a2656b4e9ef82498e9b) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`1278338`](https://github.com/inspect-js/has-symbols/commit/127833801865fbc2cc8979beb9ca869c7bfe8222) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`1493254`](https://github.com/inspect-js/has-symbols/commit/1493254eda13db5fb8fc5e4a3e8324b3d196029d) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js` [`b090bf2`](https://github.com/inspect-js/has-symbols/commit/b090bf214d3679a30edc1e2d729d466ab5183e1d) - [actions] switch Automatic Rebase workflow to `pull_request_target` event [`4addb7a`](https://github.com/inspect-js/has-symbols/commit/4addb7ab4dc73f927ae99928d68817554fc21dc0) - [Dev Deps] update `auto-changelog`, `tape` [`81d0baf`](https://github.com/inspect-js/has-symbols/commit/81d0baf3816096a89a8558e8043895f7a7d10d8b) - [Dev Deps] update `auto-changelog`; add `aud` [`1a4e561`](https://github.com/inspect-js/has-symbols/commit/1a4e5612c25d91c3a03d509721d02630bc4fe3da) - [readme] remove unused testling URLs [`3000941`](https://github.com/inspect-js/has-symbols/commit/3000941f958046e923ed8152edb1ef4a599e6fcc) - [Tests] only audit prod deps [`692e974`](https://github.com/inspect-js/has-symbols/commit/692e9743c912410e9440207631a643a34b4741a1) - [Dev Deps] update `@ljharb/eslint-config` [`51c946c`](https://github.com/inspect-js/has-symbols/commit/51c946c7f6baa793ec5390bb5a45cdce16b4ba76) ## [v1.0.1](https://github.com/inspect-js/has-symbols/compare/v1.0.0...v1.0.1) - 2019-11-16 ### Commits - [Tests] use shared travis-ci configs [`ce396c9`](https://github.com/inspect-js/has-symbols/commit/ce396c9419ff11c43d0da5d05cdbb79f7fb42229) - [Tests] up to `node` `v12.4`, `v11.15`, `v10.15`, `v9.11`, `v8.15`, `v7.10`, `v6.17`, `v4.9`; use `nvm install-latest-npm` [`0690732`](https://github.com/inspect-js/has-symbols/commit/0690732801f47ab429f39ba1962f522d5c462d6b) - [meta] add `auto-changelog` [`2163d0b`](https://github.com/inspect-js/has-symbols/commit/2163d0b7f36343076b8f947cd1667dd1750f26fc) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `safe-publish-latest`, `tape` [`8e0951f`](https://github.com/inspect-js/has-symbols/commit/8e0951f1a7a2e52068222b7bb73511761e6e4d9c) - [actions] add automatic rebasing / merge commit blocking [`b09cdb7`](https://github.com/inspect-js/has-symbols/commit/b09cdb7cd7ee39e7a769878f56e2d6066f5ccd1d) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `core-js`, `get-own-property-symbols`, `tape` [`1dd42cd`](https://github.com/inspect-js/has-symbols/commit/1dd42cd86183ed0c50f99b1062345c458babca91) - [meta] create FUNDING.yml [`aa57a17`](https://github.com/inspect-js/has-symbols/commit/aa57a17b19708906d1927f821ea8e73394d84ca4) - Only apps should have lockfiles [`a2d8bea`](https://github.com/inspect-js/has-symbols/commit/a2d8bea23a97d15c09eaf60f5b107fcf9a4d57aa) - [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`9e96cb7`](https://github.com/inspect-js/has-symbols/commit/9e96cb783746cbed0c10ef78e599a8eaa7ebe193) - [meta] add `funding` field [`a0b32cf`](https://github.com/inspect-js/has-symbols/commit/a0b32cf68e803f963c1639b6d47b0a9d6440bab0) - [Dev Deps] update `safe-publish-latest` [`cb9f0a5`](https://github.com/inspect-js/has-symbols/commit/cb9f0a521a3a1790f1064d437edd33bb6c3d6af0) ## v1.0.0 - 2016-09-19 ### Commits - Tests. [`ecb6eb9`](https://github.com/inspect-js/has-symbols/commit/ecb6eb934e4883137f3f93b965ba5e0a98df430d) - package.json [`88a337c`](https://github.com/inspect-js/has-symbols/commit/88a337cee0864a0da35f5d19e69ff0ef0150e46a) - Initial commit [`42e1e55`](https://github.com/inspect-js/has-symbols/commit/42e1e5502536a2b8ac529c9443984acd14836b1c) - Initial implementation. [`33f5cc6`](https://github.com/inspect-js/has-symbols/commit/33f5cc6cdff86e2194b081ee842bfdc63caf43fb) - read me [`01f1170`](https://github.com/inspect-js/has-symbols/commit/01f1170188ff7cb1558aa297f6ba5b516c6d7b0c)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/has-symbols/CHANGELOG.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/has-symbols/CHANGELOG.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 7689 }
# has-symbols <sup>[![Version Badge][2]][1]</sup> [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][5]][6] [![dev dependency status][7]][8] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][11]][1] Determine if the JS environment has Symbol support. Supports spec, or shams. ## Example ```js var hasSymbols = require('has-symbols'); hasSymbols() === true; // if the environment has native Symbol support. Not polyfillable, not forgeable. var hasSymbolsKinda = require('has-symbols/shams'); hasSymbolsKinda() === true; // if the environment has a Symbol sham that mostly follows the spec. ``` ## Supported Symbol shams - get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols) - core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js) ## Tests Simply clone the repo, `npm install`, and run `npm test` [1]: https://npmjs.org/package/has-symbols [2]: https://versionbadg.es/inspect-js/has-symbols.svg [5]: https://david-dm.org/inspect-js/has-symbols.svg [6]: https://david-dm.org/inspect-js/has-symbols [7]: https://david-dm.org/inspect-js/has-symbols/dev-status.svg [8]: https://david-dm.org/inspect-js/has-symbols#info=devDependencies [11]: https://nodei.co/npm/has-symbols.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/has-symbols.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/has-symbols.svg [downloads-url]: https://npm-stat.com/charts.html?package=has-symbols [codecov-image]: https://codecov.io/gh/inspect-js/has-symbols/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/inspect-js/has-symbols/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-symbols [actions-url]: https://github.com/inspect-js/has-symbols/actions
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/has-symbols/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/has-symbols/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2043 }
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [v2.0.2](https://github.com/inspect-js/hasOwn/compare/v2.0.1...v2.0.2) - 2024-03-10 ### Commits - [types] use shared config [`68e9d4d`](https://github.com/inspect-js/hasOwn/commit/68e9d4dab6facb4f05f02c6baea94a3f2a4e44b2) - [actions] remove redundant finisher; use reusable workflow [`241a68e`](https://github.com/inspect-js/hasOwn/commit/241a68e13ea1fe52bec5ba7f74144befc31fae7b) - [Tests] increase coverage [`4125c0d`](https://github.com/inspect-js/hasOwn/commit/4125c0d6121db56ae30e38346dfb0c000b04f0a7) - [Tests] skip `npm ls` in old node due to TS [`01b9282`](https://github.com/inspect-js/hasOwn/commit/01b92822f9971dea031eafdd14767df41d61c202) - [types] improve predicate type [`d340f85`](https://github.com/inspect-js/hasOwn/commit/d340f85ce02e286ef61096cbbb6697081d40a12b) - [Dev Deps] update `tape` [`70089fc`](https://github.com/inspect-js/hasOwn/commit/70089fcf544e64acc024cbe60f5a9b00acad86de) - [Tests] use `@arethetypeswrong/cli` [`50b272c`](https://github.com/inspect-js/hasOwn/commit/50b272c829f40d053a3dd91c9796e0ac0b2af084) ## [v2.0.1](https://github.com/inspect-js/hasOwn/compare/v2.0.0...v2.0.1) - 2024-02-10 ### Commits - [types] use a handwritten d.ts file; fix exported type [`012b989`](https://github.com/inspect-js/hasOwn/commit/012b9898ccf91dc441e2ebf594ff70270a5fda58) - [Dev Deps] update `@types/function-bind`, `@types/mock-property`, `@types/tape`, `aud`, `mock-property`, `npmignore`, `tape`, `typescript` [`977a56f`](https://github.com/inspect-js/hasOwn/commit/977a56f51a1f8b20566f3c471612137894644025) - [meta] add `sideEffects` flag [`3a60b7b`](https://github.com/inspect-js/hasOwn/commit/3a60b7bf42fccd8c605e5f145a6fcc83b13cb46f) ## [v2.0.0](https://github.com/inspect-js/hasOwn/compare/v1.0.1...v2.0.0) - 2023-10-19 ### Commits - revamped implementation, tests, readme [`72bf8b3`](https://github.com/inspect-js/hasOwn/commit/72bf8b338e77a638f0a290c63ffaed18339c36b4) - [meta] revamp package.json [`079775f`](https://github.com/inspect-js/hasOwn/commit/079775fb1ec72c1c6334069593617a0be3847458) - Only apps should have lockfiles [`6640e23`](https://github.com/inspect-js/hasOwn/commit/6640e233d1bb8b65260880f90787637db157d215) ## v1.0.1 - 2023-10-10 ### Commits - Initial commit [`8dbfde6`](https://github.com/inspect-js/hasOwn/commit/8dbfde6e8fb0ebb076fab38d138f2984eb340a62)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/hasown/CHANGELOG.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/hasown/CHANGELOG.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2578 }
# hasown <sup>[![Version Badge][npm-version-svg]][package-url]</sup> [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][npm-badge-png]][package-url] A robust, ES3 compatible, "has own property" predicate. ## Example ```js const assert = require('assert'); const hasOwn = require('hasown'); assert.equal(hasOwn({}, 'toString'), false); assert.equal(hasOwn([], 'length'), true); assert.equal(hasOwn({ a: 42 }, 'a'), true); ``` ## Tests Simply clone the repo, `npm install`, and run `npm test` [package-url]: https://npmjs.org/package/hasown [npm-version-svg]: https://versionbadg.es/inspect-js/hasown.svg [deps-svg]: https://david-dm.org/inspect-js/hasOwn.svg [deps-url]: https://david-dm.org/inspect-js/hasOwn [dev-deps-svg]: https://david-dm.org/inspect-js/hasOwn/dev-status.svg [dev-deps-url]: https://david-dm.org/inspect-js/hasOwn#info=devDependencies [npm-badge-png]: https://nodei.co/npm/hasown.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/hasown.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/hasown.svg [downloads-url]: https://npm-stat.com/charts.html?package=hasown [codecov-image]: https://codecov.io/gh/inspect-js/hasOwn/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/inspect-js/hasOwn/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/hasOwn [actions-url]: https://github.com/inspect-js/hasOwn/actions
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/hasown/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/hasown/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1612 }
2.0.0 / 2021-12-17 ================== * Drop support for Node.js 0.6 * Remove `I'mateapot` export; use `ImATeapot` instead * Remove support for status being non-first argument * Rename `UnorderedCollection` constructor to `TooEarly` * deps: [email protected] - Replace internal `eval` usage with `Function` constructor - Use instance methods on `process` to check for listeners * deps: [email protected] - Fix messaging casing of `418 I'm a Teapot` - Remove code 306 - Rename `425 Unordered Collection` to standard `425 Too Early` 2021-11-14 / 1.8.1 ================== * deps: [email protected] 2020-06-29 / 1.8.0 ================== * Add `isHttpError` export to determine if value is an HTTP error * deps: [email protected] 2019-06-24 / 1.7.3 ================== * deps: [email protected] 2019-02-18 / 1.7.2 ================== * deps: [email protected] 2018-09-08 / 1.7.1 ================== * Fix error creating objects in some environments 2018-07-30 / 1.7.0 ================== * Set constructor name when possible * Use `toidentifier` module to make class names * deps: statuses@'>= 1.5.0 < 2' 2018-03-29 / 1.6.3 ================== * deps: depd@~1.1.2 - perf: remove argument reassignment * deps: [email protected] * deps: statuses@'>= 1.4.0 < 2' 2017-08-04 / 1.6.2 ================== * deps: [email protected] - Remove unnecessary `Buffer` loading 2017-02-20 / 1.6.1 ================== * deps: [email protected] - Fix shim for old browsers 2017-02-14 / 1.6.0 ================== * Accept custom 4xx and 5xx status codes in factory * Add deprecation message to `"I'mateapot"` export * Deprecate passing status code as anything except first argument in factory * Deprecate using non-error status codes * Make `message` property enumerable for `HttpError`s 2016-11-16 / 1.5.1 ================== * deps: [email protected] - Fix issue loading in browser * deps: [email protected] * deps: statuses@'>= 1.3.1 < 2' 2016-05-18 / 1.5.0 ================== * Support new code `421 Misdirected Request` * Use `setprototypeof` module to replace `__proto__` setting * deps: statuses@'>= 1.3.0 < 2' - Add `421 Misdirected Request` - perf: enable strict mode * perf: enable strict mode 2016-01-28 / 1.4.0 ================== * Add `HttpError` export, for `err instanceof createError.HttpError` * deps: [email protected] * deps: statuses@'>= 1.2.1 < 2' - Fix message for status 451 - Remove incorrect nginx status code 2015-02-02 / 1.3.1 ================== * Fix regression where status can be overwritten in `createError` `props` 2015-02-01 / 1.3.0 ================== * Construct errors using defined constructors from `createError` * Fix error names that are not identifiers - `createError["I'mateapot"]` is now `createError.ImATeapot` * Set a meaningful `name` property on constructed errors 2014-12-09 / 1.2.8 ================== * Fix stack trace from exported function * Remove `arguments.callee` usage 2014-10-14 / 1.2.7 ================== * Remove duplicate line 2014-10-02 / 1.2.6 ================== * Fix `expose` to be `true` for `ClientError` constructor 2014-09-28 / 1.2.5 ================== * deps: statuses@1 2014-09-21 / 1.2.4 ================== * Fix dependency version to work with old `npm`s 2014-09-21 / 1.2.3 ================== * deps: statuses@~1.1.0 2014-09-21 / 1.2.2 ================== * Fix publish error 2014-09-21 / 1.2.1 ================== * Support Node.js 0.6 * Use `inherits` instead of `util` 2014-09-09 / 1.2.0 ================== * Fix the way inheriting functions * Support `expose` being provided in properties argument 2014-09-08 / 1.1.0 ================== * Default status to 500 * Support provided `error` to extend 2014-09-08 / 1.0.1 ================== * Fix accepting string message 2014-09-08 / 1.0.0 ================== * Initial release
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/http-errors/HISTORY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/http-errors/HISTORY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 3972 }
# http-errors [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][node-url] [![Node.js Version][node-image]][node-url] [![Build Status][ci-image]][ci-url] [![Test Coverage][coveralls-image]][coveralls-url] Create HTTP errors for Express, Koa, Connect, etc. with ease. ## Install This is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/). Installation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): ```console $ npm install http-errors ``` ## Example ```js var createError = require('http-errors') var express = require('express') var app = express() app.use(function (req, res, next) { if (!req.user) return next(createError(401, 'Please login to view this page.')) next() }) ``` ## API This is the current API, currently extracted from Koa and subject to change. ### Error Properties - `expose` - can be used to signal if `message` should be sent to the client, defaulting to `false` when `status` >= 500 - `headers` - can be an object of header names to values to be sent to the client, defaulting to `undefined`. When defined, the key names should all be lower-cased - `message` - the traditional error message, which should be kept short and all single line - `status` - the status code of the error, mirroring `statusCode` for general compatibility - `statusCode` - the status code of the error, defaulting to `500` ### createError([status], [message], [properties]) Create a new error object with the given message `msg`. The error object inherits from `createError.HttpError`. ```js var err = createError(404, 'This video does not exist!') ``` - `status: 500` - the status code as a number - `message` - the message of the error, defaulting to node's text for that status code. - `properties` - custom properties to attach to the object ### createError([status], [error], [properties]) Extend the given `error` object with `createError.HttpError` properties. This will not alter the inheritance of the given `error` object, and the modified `error` object is the return value. <!-- eslint-disable no-redeclare --> ```js fs.readFile('foo.txt', function (err, buf) { if (err) { if (err.code === 'ENOENT') { var httpError = createError(404, err, { expose: false }) } else { var httpError = createError(500, err) } } }) ``` - `status` - the status code as a number - `error` - the error object to extend - `properties` - custom properties to attach to the object ### createError.isHttpError(val) Determine if the provided `val` is an `HttpError`. This will return `true` if the error inherits from the `HttpError` constructor of this module or matches the "duck type" for an error this module creates. All outputs from the `createError` factory will return `true` for this function, including if an non-`HttpError` was passed into the factory. ### new createError\[code || name\](\[msg]\)) Create a new error object with the given message `msg`. The error object inherits from `createError.HttpError`. ```js var err = new createError.NotFound() ``` - `code` - the status code as a number - `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`. #### List of all constructors |Status Code|Constructor Name | |-----------|-----------------------------| |400 |BadRequest | |401 |Unauthorized | |402 |PaymentRequired | |403 |Forbidden | |404 |NotFound | |405 |MethodNotAllowed | |406 |NotAcceptable | |407 |ProxyAuthenticationRequired | |408 |RequestTimeout | |409 |Conflict | |410 |Gone | |411 |LengthRequired | |412 |PreconditionFailed | |413 |PayloadTooLarge | |414 |URITooLong | |415 |UnsupportedMediaType | |416 |RangeNotSatisfiable | |417 |ExpectationFailed | |418 |ImATeapot | |421 |MisdirectedRequest | |422 |UnprocessableEntity | |423 |Locked | |424 |FailedDependency | |425 |TooEarly | |426 |UpgradeRequired | |428 |PreconditionRequired | |429 |TooManyRequests | |431 |RequestHeaderFieldsTooLarge | |451 |UnavailableForLegalReasons | |500 |InternalServerError | |501 |NotImplemented | |502 |BadGateway | |503 |ServiceUnavailable | |504 |GatewayTimeout | |505 |HTTPVersionNotSupported | |506 |VariantAlsoNegotiates | |507 |InsufficientStorage | |508 |LoopDetected | |509 |BandwidthLimitExceeded | |510 |NotExtended | |511 |NetworkAuthenticationRequired| ## License [MIT](LICENSE) [ci-image]: https://badgen.net/github/checks/jshttp/http-errors/master?label=ci [ci-url]: https://github.com/jshttp/http-errors/actions?query=workflow%3Aci [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/http-errors/master [coveralls-url]: https://coveralls.io/r/jshttp/http-errors?branch=master [node-image]: https://badgen.net/npm/node/http-errors [node-url]: https://nodejs.org/en/download [npm-downloads-image]: https://badgen.net/npm/dm/http-errors [npm-url]: https://npmjs.org/package/http-errors [npm-version-image]: https://badgen.net/npm/v/http-errors [travis-image]: https://badgen.net/travis/jshttp/http-errors/master [travis-url]: https://travis-ci.org/jshttp/http-errors
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/http-errors/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/http-errors/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 5961 }
# 0.4.24 / 2018-08-22 * Added MIK encoding (#196, by @Ivan-Kalatchev) # 0.4.23 / 2018-05-07 * Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann) * Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn) # 0.4.22 / 2018-05-05 * Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson) * Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson) # 0.4.21 / 2018-04-06 * Fix encoding canonicalization (#156) * Fix the paths in the "browser" field in package.json (#174 by @LMLB) * Removed "contributors" section in package.json - see Git history instead. # 0.4.20 / 2018-04-06 * Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR) # 0.4.19 / 2017-09-09 * Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147) * Re-generated windows1255 codec, because it was updated in iconv project * Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8 # 0.4.18 / 2017-06-13 * Fixed CESU-8 regression in Node v8. # 0.4.17 / 2017-04-22 * Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn) # 0.4.16 / 2017-04-22 * Added support for React Native (#150) * Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex) * Fixed typo in Readme (#138 by @jiangzhuo) * Fixed build for Node v6.10+ by making correct version comparison * Added a warning if iconv-lite is loaded not as utf-8 (see #142) # 0.4.15 / 2016-11-21 * Fixed typescript type definition (#137) # 0.4.14 / 2016-11-20 * Preparation for v1.0 * Added Node v6 and latest Node versions to Travis CI test rig * Deprecated Node v0.8 support * Typescript typings (@larssn) * Fix encoding of Euro character in GB 18030 (inspired by @lygstate) * Add ms prefix to dbcs windows encodings (@rokoroku) # 0.4.13 / 2015-10-01 * Fix silly mistake in deprecation notice. # 0.4.12 / 2015-09-26 * Node v4 support: * Added CESU-8 decoding (#106) * Added deprecation notice for `extendNodeEncodings` * Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol) # 0.4.11 / 2015-07-03 * Added CESU-8 encoding. # 0.4.10 / 2015-05-26 * Changed UTF-16 endianness heuristic to take into account any ASCII chars, not just spaces. This should minimize the importance of "default" endianness. # 0.4.9 / 2015-05-24 * Streamlined BOM handling: strip BOM by default, add BOM when encoding if addBOM: true. Added docs to Readme. * UTF16 now uses UTF16-LE by default. * Fixed minor issue with big5 encoding. * Added io.js testing on Travis; updated node-iconv version to test against. Now we just skip testing SBCS encodings that node-iconv doesn't support. * (internal refactoring) Updated codec interface to use classes. * Use strict mode in all files. # 0.4.8 / 2015-04-14 * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94) # 0.4.7 / 2015-02-05 * stop official support of Node.js v0.8. Should still work, but no guarantees. reason: Packages needed for testing are hard to get on Travis CI. * work in environment where Object.prototype is monkey patched with enumerable props (#89). # 0.4.6 / 2015-01-12 * fix rare aliases of single-byte encodings (thanks @mscdex) * double the timeout for dbcs tests to make them less flaky on travis # 0.4.5 / 2014-11-20 * fix windows-31j and x-sjis encoding support (@nleush) * minor fix: undefined variable reference when internal error happens # 0.4.4 / 2014-07-16 * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3) * fixed streaming base64 encoding # 0.4.3 / 2014-06-14 * added encodings UTF-16BE and UTF-16 with BOM # 0.4.2 / 2014-06-12 * don't throw exception if `extendNodeEncodings()` is called more than once # 0.4.1 / 2014-06-11 * codepage 808 added # 0.4.0 / 2014-06-10 * code is rewritten from scratch * all widespread encodings are supported * streaming interface added * browserify compatibility added * (optional) extend core primitive encodings to make usage even simpler * moved from vows to mocha as the testing framework
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/iconv-lite/Changelog.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/iconv-lite/Changelog.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 4339 }
## Pure JS character encoding conversion [![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite) * Doesn't need native code compilation. Works on Windows and in sandboxed environments like [Cloud9](http://c9.io). * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). * Intuitive encode/decode API * Streaming support for Node v0.10+ * [Deprecated] Can extend Node.js primitives (buffers, streams) to support all iconv-lite encodings. * In-browser usage via [Browserify](https://github.com/substack/node-browserify) (~180k gzip compressed with Buffer shim included). * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. * React Native is supported (need to explicitly `npm install` two more modules: `buffer` and `stream`). * License: MIT. [![NPM Stats](https://nodei.co/npm/iconv-lite.png?downloads=true&downloadRank=true)](https://npmjs.org/packages/iconv-lite/) ## Usage ### Basic API ```javascript var iconv = require('iconv-lite'); // Convert from an encoded buffer to js string. str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); // Convert from js string to an encoded buffer. buf = iconv.encode("Sample input string", 'win1251'); // Check if encoding is supported iconv.encodingExists("us-ascii") ``` ### Streaming API (Node v0.10+) ```javascript // Decode stream (from binary stream to js strings) http.createServer(function(req, res) { var converterStream = iconv.decodeStream('win1251'); req.pipe(converterStream); converterStream.on('data', function(str) { console.log(str); // Do something with decoded strings, chunk-by-chunk. }); }); // Convert encoding streaming example fs.createReadStream('file-in-win1251.txt') .pipe(iconv.decodeStream('win1251')) .pipe(iconv.encodeStream('ucs2')) .pipe(fs.createWriteStream('file-in-ucs2.txt')); // Sugar: all encode/decode streams have .collect(cb) method to accumulate data. http.createServer(function(req, res) { req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) { assert(typeof body == 'string'); console.log(body); // full request body string }); }); ``` ### [Deprecated] Extend Node.js own encodings > NOTE: This doesn't work on latest Node versions. See [details](https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility). ```javascript // After this call all Node basic primitives will understand iconv-lite encodings. iconv.extendNodeEncodings(); // Examples: buf = new Buffer(str, 'win1251'); buf.write(str, 'gbk'); str = buf.toString('latin1'); assert(Buffer.isEncoding('iso-8859-15')); Buffer.byteLength(str, 'us-ascii'); http.createServer(function(req, res) { req.setEncoding('big5'); req.collect(function(err, body) { console.log(body); }); }); fs.createReadStream("file.txt", "shift_jis"); // External modules are also supported (if they use Node primitives, which they probably do). request = require('request'); request({ url: "http://github.com/", encoding: "cp932" }); // To remove extensions iconv.undoExtendNodeEncodings(); ``` ## Supported encodings * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap. * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. Aliases like 'latin1', 'us-ascii' also supported. * All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP. See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings). Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors! Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors! ## Encoding/decoding speed Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). Note: your results may vary, so please always check on your hardware. operation [email protected] [email protected] ---------------------------------------------------------- encode('win1251') ~96 Mb/s ~320 Mb/s decode('win1251') ~95 Mb/s ~246 Mb/s ## BOM handling * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`). A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found. * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module. * Encoding: No BOM added, unless overridden by `addBOM: true` option. ## UTF-16 Encodings This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be smart about endianness in the following ways: * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. ## Other notes When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). Untranslatable characters are set to � or ?. No transliteration is currently supported. Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77). ## Testing ```bash $ git clone [email protected]:ashtuchkin/iconv-lite.git $ cd iconv-lite $ npm install $ npm test $ # To view performance: $ node test/performance.js $ # To view test coverage: $ npm run coverage $ open coverage/lcov-report/index.html ```
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/iconv-lite/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/iconv-lite/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 6531 }
Browser-friendly inheritance fully compatible with standard node.js [inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). This package exports standard `inherits` from node.js `util` module in node environment, but also provides alternative browser-friendly implementation through [browser field](https://gist.github.com/shtylman/4339901). Alternative implementation is a literal copy of standard one located in standalone module to avoid requiring of `util`. It also has a shim for old browsers with no `Object.create` support. While keeping you sure you are using standard `inherits` implementation in node.js environment, it allows bundlers such as [browserify](https://github.com/substack/node-browserify) to not include full `util` package to your client code if all you need is just `inherits` function. It worth, because browser shim for `util` package is large and `inherits` is often the single function you need from it. It's recommended to use this package instead of `require('util').inherits` for any code that has chances to be used not only in node.js but in browser too. ## usage ```js var inherits = require('inherits'); // then use exactly as the standard one ``` ## note on version ~1.0 Version ~1.0 had completely different motivation and is not compatible neither with 2.0 nor with standard node.js `inherits`. If you are using version ~1.0 and planning to switch to ~2.0, be careful: * new version uses `super_` instead of `super` for referencing superclass * new version overwrites current prototype while old one preserves any existing fields on it
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/inherits/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/inherits/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1624 }
# The only accessible & unstyled & full featured Input OTP component in the Web. ### OTP Input for React 🔐 by [@guilhermerodz](https://twitter.com/guilherme_rodz) https://github.com/guilhermerodz/input-otp/assets/10366880/753751f5-eda8-4145-a4b9-7ef51ca5e453 ## Usage ```bash npm install input-otp ``` Then import the component. ```diff +'use client' +import { OTPInput } from 'input-otp' function MyForm() { return <form> + <OTPInput maxLength={6} render={({slots}) => (...)} /> </form> } ``` ## Default example The example below uses `tailwindcss` `@shadcn/ui` `tailwind-merge` `clsx`: ```tsx 'use client' import { OTPInput, SlotProps } from 'input-otp' <OTPInput maxLength={6} containerClassName="group flex items-center has-[:disabled]:opacity-30" render={({ slots }) => ( <> <div className="flex"> {slots.slice(0, 3).map((slot, idx) => ( <Slot key={idx} {...slot} /> ))} </div> <FakeDash /> <div className="flex"> {slots.slice(3).map((slot, idx) => ( <Slot key={idx} {...slot} /> ))} </div> </> )} /> // Feel free to copy. Uses @shadcn/ui tailwind colors. function Slot(props: SlotProps) { return ( <div className={cn( 'relative w-10 h-14 text-[2rem]', 'flex items-center justify-center', 'transition-all duration-300', 'border-border border-y border-r first:border-l first:rounded-l-md last:rounded-r-md', 'group-hover:border-accent-foreground/20 group-focus-within:border-accent-foreground/20', 'outline outline-0 outline-accent-foreground/20', { 'outline-4 outline-accent-foreground': props.isActive }, )} > <div className="group-has-[input[data-input-otp-placeholder-shown]]:opacity-20"> {props.char ?? props.placeholderChar} </div> {props.hasFakeCaret && <FakeCaret />} </div> ) } // You can emulate a fake textbox caret! function FakeCaret() { return ( <div className="absolute pointer-events-none inset-0 flex items-center justify-center animate-caret-blink"> <div className="w-px h-8 bg-white" /> </div> ) } // Inspired by Stripe's MFA input. function FakeDash() { return ( <div className="flex w-10 justify-center items-center"> <div className="w-3 h-1 rounded-full bg-border" /> </div> ) } // tailwind.config.ts for the blinking caret animation. const config = { theme: { extend: { keyframes: { 'caret-blink': { '0%,70%,100%': { opacity: '1' }, '20%,50%': { opacity: '0' }, }, }, animation: { 'caret-blink': 'caret-blink 1.2s ease-out infinite', }, }, }, } // Small utility to merge class names. import { clsx } from 'clsx' import { twMerge } from 'tailwind-merge' import type { ClassValue } from 'clsx' export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) } ``` ## How it works There's currently no native OTP/2FA/MFA input in HTML, which means people are either going with 1. a simple input design or 2. custom designs like this one. This library works by rendering an invisible input as a sibling of the slots, contained by a `relative`ly positioned parent (the container root called _OTPInput_). ## Features This is the most complete OTP input on the web. It's fully featured <details> <summary>Supports iOS + Android copy-paste-cut</summary> https://github.com/guilhermerodz/input-otp/assets/10366880/bdbdc96a-23da-4e89-bff8-990e6a1c4c23 </details> <details> <summary>Automatic OTP code retrieval from transport (e.g SMS)</summary> By default, this input uses `autocomplete='one-time-code'` and it works as it's a single input. https://github.com/guilhermerodz/input-otp/assets/10366880/5705dac6-9159-443b-9c27-b52e93c60ea8 </details> <details> <summary>Supports screen readers (a11y)</summary> Stripe was my first inspiration to build this library. Take a look at Stripe's input. The screen reader does not behave like it normally should on a normal single input. That's because Stripe's solution is to render a 1-digit input with "clone-divs" rendering a single char per div. https://github.com/guilhermerodz/input-otp/assets/10366880/3d127aef-147c-4f28-9f6c-57a357a802d0 So we're rendering a single input with invisible/transparent colors instead. The screen reader now gets to read it, but there is no appearance. Feel free to build whatever UI you want: https://github.com/guilhermerodz/input-otp/assets/10366880/718710f0-2198-418c-8fa0-46c05ae5475d </details> <details> <summary>Supports all keybindings</summary> Should be able to support all keybindings of a common text input as it's an input. https://github.com/guilhermerodz/input-otp/assets/10366880/185985c0-af64-48eb-92f9-2e59be9eb78f </details> <details> <summary>Automatically optimizes for password managers</summary> For password managers such as LastPass, 1Password, Dashlane or Bitwarden, `input-otp` will automatically detect them in the page and increase input width by ~40px to trick the password manager's browser extension and prevent the badge from rendering to the last/right slot of the input. <img width="670" alt="image" src="https://github.com/guilhermerodz/input-otp/assets/10366880/9bb306ca-deff-4803-aa3d-148c594a540c"> - **This feature is optional and it's enabled by default. You can disable this optimization by adding `pushPasswordManagerStrategy="none"`.** - **This feature does not cause visible layout shift.** ### Auto tracks if the input has space in the right side for the badge https://github.com/guilhermerodz/input-otp/assets/10366880/bf01af88-1f82-463e-adf4-54a737a92f59 </details> ## API Reference ### OTPInput The root container. Define settings for the input via props. Then, use the `render` prop to create the slots. #### Props ```ts type OTPInputProps = { // The number of slots maxLength: number // Render function creating the slots render: (props: RenderProps) => React.ReactElement // PS: Render prop is mandatory, except in cases // you'd like to consume the original Context API. // (search for Context in this docs) // The class name for the root container containerClassName?: string // Value state controlling the input value?: string // Setter for the controlled value (or callback for uncontrolled value) onChange?: (newValue: string) => unknown // Callback when the input is complete onComplete?: (...args: any[]) => unknown // Where is the text located within the input // Affects click-holding or long-press behavior // Default: 'left' textAlign?: 'left' | 'center' | 'right' // Virtual keyboard appearance on mobile // Default: 'numeric' inputMode?: 'numeric' | 'text' | 'decimal' | 'tel' | 'search' | 'email' | 'url' // Pro tip: input-otp export some patterns by default such as REGEXP_ONLY_DIGITS which you can import from the same library path // Example: import { REGEXP_ONLY_DIGITS } from 'input-otp'; // Then use it as: <OTPInput pattern={REGEXP_ONLY_DIGITS}> pattern?: string // While rendering the input slot, you can access both the char and the placeholder, if there's one and it's active. placeholder?: string // Transfomer function that allows pasting, for example, "XXX-XXX" even though the input's regex/pattern doesn't allow hyphen and its max length is 6. // Example: (pasted) => pasted.replaceAll('-', '') pasteTransformer?: (pastedText: string) => string // Enabled by default, it's an optional // strategy for detecting Password Managers // in the page and then shifting their // badges to the right side, outside the input. pushPasswordManagerStrategy?: | 'increase-width' | 'none' // Enabled by default, it's an optional // fallback for pages without JS. // This is a CSS string. Write your own // rules that will be applied as soon as // <noscript> is parsed for no-js pages. // Use `null` to disable any no-js fallback (not recommended). // Default: ` // [data-input-otp] { // --nojs-bg: white !important; // --nojs-fg: black !important; // // background-color: var(--nojs-bg) !important; // color: var(--nojs-fg) !important; // caret-color: var(--nojs-fg) !important; // letter-spacing: .25em !important; // text-align: center !important; // border: 1px solid var(--nojs-fg) !important; // border-radius: 4px !important; // width: 100% !important; // } // @media (prefers-color-scheme: dark) { // [data-input-otp] { // --nojs-bg: black !important; // --nojs-fg: white !important; // } // }` noScriptCSSFallback?: string | null } ``` ## Examples <details> <summary>Automatic form submission on OTP completion</summary> ```tsx export default function Page() { const formRef = useRef<HTMLFormElement>(null) const buttonRef = useRef<HTMLButtonElement>(null) return ( <form ref={formRef}> <OTPInput // ... automatically submit the form onComplete={() => formRef.current?.submit()} // ... or focus the button like as you wish onComplete={() => buttonRef.current?.focus()} /> <button ref={buttonRef}>Submit</button> </form> ) } ``` </details> <details> <summary>Automatically focus the input when the page loads</summary> ```tsx export default function Page() { return ( <form ref={formRef}> <OTPInput autoFocus // Pro tip: accepts all common HTML input props... /> </form> ) } ``` </details> <details> <summary>Usage with react-hook-form</summary> Just use it as a regular text input: ```tsx const { register, handleSubmit } = useForm(); // Then register it like a text input <InputOTP {...register("otp")} /> ``` You can also use react-hook-form's Controller if needed: ```tsx const { control } = useForm(); // Then control it like a text input <Controller name="customOTP" control={control} defaultValue="" render={({ field }) => ( <OTPInput {...field} label="Custom OTP" /> )} /> ``` </details> ## Caveats <details> <summary>[Workaround] If you want to block specific password manager/badges:</summary> By default, `input-otp` handles password managers for you. The password manager badges should be automatically shifted to the right side. However, if you still want to block password managers, please disable the `pushPasswordManagerStrategy` and then manually block each PWM. ```diff <OTPInput // First, disable library's built-in strategy // for shifting badges automatically - pushPasswordManagerStrategy="increase-width" + pushPasswordManagerStrategy="none" // Then, manually add specifics attributes // your password manager docs // Example: block LastPass + data-lpignore="true" // Example: block 1Password + data-1p-ignore="true" /> ``` </details> <details> <summary>[Setting] If you want to customize the `noscript` CSS fallback</summary> By default, `input-otp` handles cases where JS is not in the page by applying custom CSS styles. If you do not like the fallback design and want to apply it to your own, just pass a prop: ```diff // This is the default CSS fallback. // Feel free to change it entirely and apply to your design system. const NOSCRIPT_CSS_FALLBACK = ` [data-input-otp] { --nojs-bg: white !important; --nojs-fg: black !important; background-color: var(--nojs-bg) !important; color: var(--nojs-fg) !important; caret-color: var(--nojs-fg) !important; letter-spacing: .25em !important; text-align: center !important; border: 1px solid var(--nojs-fg) !important; border-radius: 4px !important; width: 100% !important; } @media (prefers-color-scheme: dark) { [data-input-otp] { --nojs-bg: black !important; --nojs-fg: white !important; } }` <OTPInput // Pass your own custom styles for when JS is disabled + noScriptCSSFallback={NOSCRIPT_CSS_FALLBACK} /> ``` </details> <details> <summary>[Workaround] If you're experiencing an unwanted border on input focus:</summary> ```diff <OTPInput // Add class to the input itself + className="focus-visible:ring-0" // Not the container containerClassName="..." /> ``` </details> <details> <summary>[Not Recommended] If you want to centralize input text/selection, use the `textAlign` prop:</summary> ```diff <OTPInput // customizable but not recommended + textAlign="center" /> ``` NOTE: this also affects the selected caret position after a touch/click. `textAlign="left"` <img src="https://github.com/guilhermerodz/input-otp/assets/10366880/685a03df-2b69-4a36-b21c-e453f6098f79" width="300" /> <br> `textAlign="center"` <img src="https://github.com/guilhermerodz/input-otp/assets/10366880/e0f15b97-ceb8-40c8-96b7-fa3a8896379f" width="300" /> <br> `textAlign="right"` <img src="https://github.com/guilhermerodz/input-otp/assets/10366880/26697579-0e8b-4dad-8b85-3a036102e951" width="300" /> <br> </details> <details> <summary>If you want to use Context props:</summary> ```diff +import { OTPInputContext } from 'input-otp' function MyForm() { return ( <OTPInput - // First remove the `render` prop - render={...} > <OTPInputWrapper /> </OTPInput> ) } +function OTPInputWrapper() { + const inputContext = React.useContext(OTPInputContext) + return ( + <> + {inputContext.slots.map((slot, idx) => ( + <Slot key={idx} {...slot} /> + ))} + </> + ) +} ``` NOTE: this also affects the selected caret position after a touch/click. `textAlign="left"` <img src="https://github.com/guilhermerodz/input-otp/assets/10366880/685a03df-2b69-4a36-b21c-e453f6098f79" width="300" /> <br> `textAlign="center"` <img src="https://github.com/guilhermerodz/input-otp/assets/10366880/e0f15b97-ceb8-40c8-96b7-fa3a8896379f" width="300" /> <br> `textAlign="right"` <img src="https://github.com/guilhermerodz/input-otp/assets/10366880/26697579-0e8b-4dad-8b85-3a036102e951" width="300" /> <br> </details> <details> <summary>[DX] Add Tailwind autocomplete for `containerClassname` attribute in VS Code.</summary> Add the following setting to your `.vscode/settings.json`: ```diff { "tailwindCSS.classAttributes": [ "class", "className", + ".*ClassName" ] } ``` </details>
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/input-otp/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/input-otp/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 14248 }
# InternMap *For live examples, see https://observablehq.com/@mbostock/internmap.* If you use dates as keys in a JavaScript Map (or as values in a Set), you may be surprised that it won’t work as you expect. ```js dateMap = new Map([ [new Date(Date.UTC(2001, 0, 1)), "red"], [new Date(Date.UTC(2001, 0, 1)), "green"] // distinct key! ]) ``` ```js dateMap.get(new Date(Date.UTC(2001, 0, 1))) // undefined! ``` That’s because Map uses the [SameValueZero algorithm](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness) to determine key equality: for two dates to be considered the same, they must be the same instance (the same object), not just the same moment in time. This is true of the equality operator, too. ```js { const date1 = new Date(Date.UTC(2001, 0, 1)); const date2 = new Date(Date.UTC(2001, 0, 1)); return date1 === date2; // false! } ``` You can avoid this issue by using primitive values such as numbers or strings as keys instead. But it’s tedious and easy to forget to coerce types. (You’ll also need to do the inverse type conversion when pulling keys out of the map, say when using *map*.keys or *map*.entries, or when iterating over the map. The inverse above is new Date(*key*). Also, if you forget to coerce your key to a number when using *map*.get, it’s easy not to notice because the map won’t throw an error; it’ll simply return undefined.) ```js numberMap = new Map([[978307200000, "red"]]) numberMap.get(978307200000) // "red" numberMap.get(new Date(978307200000)) // undefined; oops! ``` Wouldn’t it be easier if Map and Set “just worked” with dates? Or with any object that supports [*object*.valueOf](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)? Enter **InternMap**. [*Interning*](https://en.wikipedia.org/wiki/String_interning) refers to storing only one copy of each distinct key. An InternMap considers two Date instances representing the same moment to be equal, storing only the first instance. ```js map = new InternMap([ [new Date(Date.UTC(2001, 0, 1)), "red"], [new Date(Date.UTC(2001, 0, 1)), "green"] // replaces previous entry ]) ``` ```js map.get(new Date(Date.UTC(2001, 0, 1))) // "green" ``` ```js [...map.keys()] // [2001-01-01] ``` InternMap extends Map, so you can simply drop it in whenever you’d prefer this behavior to the SameValueZero algorithm. Because InternMap calls *object*.valueOf only for non-primitive keys, note that you can pass primitive keys, too. ```js map.get(978307200000) // "green"; this works too! ``` InternMap keeps only the first distinct key according to its associated primitive value. Avoid adding keys to the map with inconsistent types. ```js map2 = new InternMap([ [978307200000, "red"], // danger! [new Date(Date.UTC(2001, 0, 1)), "blue"] ]) ``` ```js map2.get(new Date(Date.UTC(2001, 0, 1))) // "blue"; this still works… ``` ```js [...map2.keys()] // [978307200000]; but the key isn’t a Date ``` While InternMap uses *object*.valueOf by default to compute the intern key, you can pass a key function as a second argument to the constructor to change the behavior. For example, if you use JSON.stringify, you can use arrays as compound keys (assuming that the array elements can be serialized to JSON). ```js map3 = new InternMap([ [["foo", "bar"], 1], [["foo", "baz"], 2], [["goo", "bee"], 3] ], JSON.stringify) ``` ```js map3.get(["foo", "baz"]) // 2 ``` There’s an **InternSet** class, too. ```js set = new InternSet([ new Date(Date.UTC(2000, 0, 1)), new Date(Date.UTC(2001, 0, 1)), new Date(Date.UTC(2001, 0, 1)) ]) ```
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/internmap/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/internmap/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 3643 }
2.2.4 / 2018-03-13 ================== * Use flow strict mode (i.e. `@flow strict`). 2.2.3 / 2018-02-19 ================== * Change license from BSD+Patents to MIT. 2.2.2 / 2016-11-15 ================== * Add LICENSE file. * Misc housekeeping. 2.2.1 / 2016-03-09 ================== * Use `NODE_ENV` variable instead of `__DEV__` to cache `process.env.NODE_ENV`. 2.2.0 / 2015-11-17 ================== * Use `error.name` instead of `Invariant Violation`. 2.1.3 / 2015-11-17 ================== * Remove `@provideModule` pragma. 2.1.2 / 2015-10-27 ================== * Fix license. 2.1.1 / 2015-09-20 ================== * Use correct SPDX license. * Test "browser.js" using browserify. * Switch from "envify" to "loose-envify". 2.1.0 / 2015-06-03 ================== * Add "envify" as a dependency. * Fixed license field in "package.json". 2.0.0 / 2015-02-21 ================== * Switch to using the "browser" field. There are now browser and server versions that respect the "format" in production. 1.0.2 / 2014-09-24 ================== * Added tests, npmignore and gitignore. * Clarifications in README. 1.0.1 / 2014-09-24 ================== * Actually include 'invariant.js'. 1.0.0 / 2014-09-24 ================== * Initial release.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/invariant/CHANGELOG.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/invariant/CHANGELOG.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1290 }
# invariant [![Build Status](https://travis-ci.org/zertosh/invariant.svg?branch=master)](https://travis-ci.org/zertosh/invariant) A mirror of Facebook's `invariant` (e.g. [React](https://github.com/facebook/react/blob/v0.13.3/src/vendor/core/invariant.js), [flux](https://github.com/facebook/flux/blob/2.0.2/src/invariant.js)). A way to provide descriptive errors in development but generic errors in production. ## Install With [npm](http://npmjs.org) do: ```sh npm install invariant ``` ## `invariant(condition, message)` ```js var invariant = require('invariant'); invariant(someTruthyVal, 'This will not throw'); // No errors invariant(someFalseyVal, 'This will throw an error with this message'); // Error: Invariant Violation: This will throw an error with this message ``` **Note:** When `process.env.NODE_ENV` is not `production`, the message is required. If omitted, `invariant` will throw regardless of the truthiness of the condition. When `process.env.NODE_ENV` is `production`, the message is optional – so they can be minified away. ### Browser When used with [browserify](https://github.com/substack/node-browserify), it'll use `browser.js` (instead of `invariant.js`) and the [envify](https://github.com/hughsk/envify) transform will inline the value of `process.env.NODE_ENV`. ### Node The node version is optimized around the performance implications of accessing `process.env`. The value of `process.env.NODE_ENV` is cached, and repeatedly used instead of reading `process.env`. See [Server rendering is slower with npm react #812](https://github.com/facebook/react/issues/812)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/invariant/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/invariant/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1611 }
# ipaddr.js — an IPv6 and IPv4 address manipulation library [![Build Status](https://travis-ci.org/whitequark/ipaddr.js.svg)](https://travis-ci.org/whitequark/ipaddr.js) ipaddr.js is a small (1.9K minified and gzipped) library for manipulating IP addresses in JavaScript environments. It runs on both CommonJS runtimes (e.g. [nodejs]) and in a web browser. ipaddr.js allows you to verify and parse string representation of an IP address, match it against a CIDR range or range list, determine if it falls into some reserved ranges (examples include loopback and private ranges), and convert between IPv4 and IPv4-mapped IPv6 addresses. [nodejs]: http://nodejs.org ## Installation `npm install ipaddr.js` or `bower install ipaddr.js` ## API ipaddr.js defines one object in the global scope: `ipaddr`. In CommonJS, it is exported from the module: ```js var ipaddr = require('ipaddr.js'); ``` The API consists of several global methods and two classes: ipaddr.IPv6 and ipaddr.IPv4. ### Global methods There are three global methods defined: `ipaddr.isValid`, `ipaddr.parse` and `ipaddr.process`. All of them receive a string as a single parameter. The `ipaddr.isValid` method returns `true` if the address is a valid IPv4 or IPv6 address, and `false` otherwise. It does not throw any exceptions. The `ipaddr.parse` method returns an object representing the IP address, or throws an `Error` if the passed string is not a valid representation of an IP address. The `ipaddr.process` method works just like the `ipaddr.parse` one, but it automatically converts IPv4-mapped IPv6 addresses to their IPv4 counterparts before returning. It is useful when you have a Node.js instance listening on an IPv6 socket, and the `net.ivp6.bindv6only` sysctl parameter (or its equivalent on non-Linux OS) is set to 0. In this case, you can accept IPv4 connections on your IPv6-only socket, but the remote address will be mangled. Use `ipaddr.process` method to automatically demangle it. ### Object representation Parsing methods return an object which descends from `ipaddr.IPv6` or `ipaddr.IPv4`. These objects share some properties, but most of them differ. #### Shared properties One can determine the type of address by calling `addr.kind()`. It will return either `"ipv6"` or `"ipv4"`. An address can be converted back to its string representation with `addr.toString()`. Note that this method: * does not return the original string used to create the object (in fact, there is no way of getting that string) * returns a compact representation (when it is applicable) A `match(range, bits)` method can be used to check if the address falls into a certain CIDR range. Note that an address can be (obviously) matched only against an address of the same type. For example: ```js var addr = ipaddr.parse("2001:db8:1234::1"); var range = ipaddr.parse("2001:db8::"); addr.match(range, 32); // => true ``` Alternatively, `match` can also be called as `match([range, bits])`. In this way, it can be used together with the `parseCIDR(string)` method, which parses an IP address together with a CIDR range. For example: ```js var addr = ipaddr.parse("2001:db8:1234::1"); addr.match(ipaddr.parseCIDR("2001:db8::/32")); // => true ``` A `range()` method returns one of predefined names for several special ranges defined by IP protocols. The exact names (and their respective CIDR ranges) can be looked up in the source: [IPv6 ranges] and [IPv4 ranges]. Some common ones include `"unicast"` (the default one) and `"reserved"`. You can match against your own range list by using `ipaddr.subnetMatch(address, rangeList, defaultName)` method. It can work with a mix of IPv6 or IPv4 addresses, and accepts a name-to-subnet map as the range list. For example: ```js var rangeList = { documentationOnly: [ ipaddr.parse('2001:db8::'), 32 ], tunnelProviders: [ [ ipaddr.parse('2001:470::'), 32 ], // he.net [ ipaddr.parse('2001:5c0::'), 32 ] // freenet6 ] }; ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "tunnelProviders" ``` The addresses can be converted to their byte representation with `toByteArray()`. (Actually, JavaScript mostly does not know about byte buffers. They are emulated with arrays of numbers, each in range of 0..255.) ```js var bytes = ipaddr.parse('2a00:1450:8007::68').toByteArray(); // ipv6.google.com bytes // => [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, <zeroes...>, 0x00, 0x68 ] ``` The `ipaddr.IPv4` and `ipaddr.IPv6` objects have some methods defined, too. All of them have the same interface for both protocols, and are similar to global methods. `ipaddr.IPvX.isValid(string)` can be used to check if the string is a valid address for particular protocol, and `ipaddr.IPvX.parse(string)` is the error-throwing parser. `ipaddr.IPvX.isValid(string)` uses the same format for parsing as the POSIX `inet_ntoa` function, which accepts unusual formats like `0xc0.168.1.1` or `0x10000000`. The function `ipaddr.IPv4.isValidFourPartDecimal(string)` validates the IPv4 address and also ensures that it is written in four-part decimal format. [IPv6 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L186 [IPv4 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L71 #### IPv6 properties Sometimes you will want to convert IPv6 not to a compact string representation (with the `::` substitution); the `toNormalizedString()` method will return an address where all zeroes are explicit. For example: ```js var addr = ipaddr.parse("2001:0db8::0001"); addr.toString(); // => "2001:db8::1" addr.toNormalizedString(); // => "2001:db8:0:0:0:0:0:1" ``` The `isIPv4MappedAddress()` method will return `true` if this address is an IPv4-mapped one, and `toIPv4Address()` will return an IPv4 object address. To access the underlying binary representation of the address, use `addr.parts`. ```js var addr = ipaddr.parse("2001:db8:10::1234:DEAD"); addr.parts // => [0x2001, 0xdb8, 0x10, 0, 0, 0, 0x1234, 0xdead] ``` A IPv6 zone index can be accessed via `addr.zoneId`: ```js var addr = ipaddr.parse("2001:db8::%eth0"); addr.zoneId // => 'eth0' ``` #### IPv4 properties `toIPv4MappedAddress()` will return a corresponding IPv4-mapped IPv6 address. To access the underlying representation of the address, use `addr.octets`. ```js var addr = ipaddr.parse("192.168.1.1"); addr.octets // => [192, 168, 1, 1] ``` `prefixLengthFromSubnetMask()` will return a CIDR prefix length for a valid IPv4 netmask or null if the netmask is not valid. ```js ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask() == 28 ipaddr.IPv4.parse('255.192.164.0').prefixLengthFromSubnetMask() == null ``` `subnetMaskFromPrefixLength()` will return an IPv4 netmask for a valid CIDR prefix length. ```js ipaddr.IPv4.subnetMaskFromPrefixLength(24) == "255.255.255.0" ipaddr.IPv4.subnetMaskFromPrefixLength(29) == "255.255.255.248" ``` `broadcastAddressFromCIDR()` will return the broadcast address for a given IPv4 interface and netmask in CIDR notation. ```js ipaddr.IPv4.broadcastAddressFromCIDR("172.0.0.1/24") == "172.0.0.255" ``` `networkAddressFromCIDR()` will return the network address for a given IPv4 interface and netmask in CIDR notation. ```js ipaddr.IPv4.networkAddressFromCIDR("172.0.0.1/24") == "172.0.0.0" ``` #### Conversion IPv4 and IPv6 can be converted bidirectionally to and from network byte order (MSB) byte arrays. The `fromByteArray()` method will take an array and create an appropriate IPv4 or IPv6 object if the input satisfies the requirements. For IPv4 it has to be an array of four 8-bit values, while for IPv6 it has to be an array of sixteen 8-bit values. For example: ```js var addr = ipaddr.fromByteArray([0x7f, 0, 0, 1]); addr.toString(); // => "127.0.0.1" ``` or ```js var addr = ipaddr.fromByteArray([0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) addr.toString(); // => "2001:db8::1" ``` Both objects also offer a `toByteArray()` method, which returns an array in network byte order (MSB). For example: ```js var addr = ipaddr.parse("127.0.0.1"); addr.toByteArray(); // => [0x7f, 0, 0, 1] ``` or ```js var addr = ipaddr.parse("2001:db8::1"); addr.toByteArray(); // => [0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] ```
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/ipaddr.js/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/ipaddr.js/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 8306 }
# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path) > Check if a file path is a binary file ## Install ``` $ npm install is-binary-path ``` ## Usage ```js const isBinaryPath = require('is-binary-path'); isBinaryPath('source/unicorn.png'); //=> true isBinaryPath('source/unicorn.txt'); //=> false ``` ## Related - [binary-extensions](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions - [is-text-path](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file ## License MIT © [Sindre Sorhus](https://sindresorhus.com), [Paul Miller](https://paulmillr.com)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/is-binary-path/readme.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/is-binary-path/readme.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 731 }
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [v2.15.1](https://github.com/inspect-js/is-core-module/compare/v2.15.0...v2.15.1) - 2024-08-21 ### Commits - [Tests] add `process.getBuiltinModule` tests [`28c7791`](https://github.com/inspect-js/is-core-module/commit/28c7791c196d58c64cfdf638b7e68ed1b62a4da0) - [Fix] `test/mock_loader` is no longer exposed as of v22.7 [`68b08b0`](https://github.com/inspect-js/is-core-module/commit/68b08b0d7963447dbffa5142e8810dca550383af) - [Tests] replace `aud` with `npm audit` [`32f8060`](https://github.com/inspect-js/is-core-module/commit/32f806026dac14f9016be4401a643851240c76b9) - [Dev Deps] update `mock-property` [`f7d3c8f`](https://github.com/inspect-js/is-core-module/commit/f7d3c8f01e922be49621683eb41477c4f50522e1) - [Dev Deps] add missing peer dep [`eaee885`](https://github.com/inspect-js/is-core-module/commit/eaee885b67238819e9c8ed5bd2098766e1d05331) ## [v2.15.0](https://github.com/inspect-js/is-core-module/compare/v2.14.0...v2.15.0) - 2024-07-17 ### Commits - [New] add `node:sea` [`2819fb3`](https://github.com/inspect-js/is-core-module/commit/2819fb3eae312fa64643bc5430ebd06ec0f3fb88) ## [v2.14.0](https://github.com/inspect-js/is-core-module/compare/v2.13.1...v2.14.0) - 2024-06-20 ### Commits - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `mock-property`, `npmignore`, `tape` [`0e43200`](https://github.com/inspect-js/is-core-module/commit/0e432006d97237cc082d41e6a593e87c81068364) - [meta] add missing `engines.node` [`4ea3af8`](https://github.com/inspect-js/is-core-module/commit/4ea3af88891a1d4f96026f0ec0ef08c67cd1bd24) - [New] add `test/mock_loader` [`e9fbd29`](https://github.com/inspect-js/is-core-module/commit/e9fbd2951383be070aeffb9ebbf3715237282610) - [Deps] update `hasown` [`57f1940`](https://github.com/inspect-js/is-core-module/commit/57f1940947b3e368abdf529232d2f17d88909358) ## [v2.13.1](https://github.com/inspect-js/is-core-module/compare/v2.13.0...v2.13.1) - 2023-10-20 ### Commits - [Refactor] use `hasown` instead of `has` [`0e52096`](https://github.com/inspect-js/is-core-module/commit/0e520968b0a725276b67420ab4b877486b243ae0) - [Dev Deps] update `mock-property`, `tape` [`8736b35`](https://github.com/inspect-js/is-core-module/commit/8736b35464d0f297b55da2c6b30deee04b8303c5) ## [v2.13.0](https://github.com/inspect-js/is-core-module/compare/v2.12.1...v2.13.0) - 2023-08-05 ### Commits - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `semver`, `tape` [`c75b263`](https://github.com/inspect-js/is-core-module/commit/c75b263d047cb53430c3970107e5eb64d6cd6c0c) - [New] `node:test/reporters` and `wasi`/`node:wasi` are in v18.17 [`d76cbf8`](https://github.com/inspect-js/is-core-module/commit/d76cbf8e9b208acfd98913fed5a5f45cb15fe5dc) ## [v2.12.1](https://github.com/inspect-js/is-core-module/compare/v2.12.0...v2.12.1) - 2023-05-16 ### Commits - [Fix] `test/reporters` now requires the `node:` prefix as of v20.2 [`12183d0`](https://github.com/inspect-js/is-core-module/commit/12183d0d8e4edf56b6ce18a1b3be54bfce10175b) ## [v2.12.0](https://github.com/inspect-js/is-core-module/compare/v2.11.0...v2.12.0) - 2023-04-10 ### Commits - [actions] update rebase action to use reusable workflow [`c0a7251`](https://github.com/inspect-js/is-core-module/commit/c0a7251f734f3c621932c5fcdfd1bf966b42ca32) - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9ae8b7f`](https://github.com/inspect-js/is-core-module/commit/9ae8b7fac03c369861d0991b4a2ce8d4848e6a7d) - [New] `test/reporters` added in v19.9, `wasi` added in v20 [`9d5341a`](https://github.com/inspect-js/is-core-module/commit/9d5341ab32053f25b7fa7db3c0e18461db24a79c) - [Dev Deps] add missing `in-publish` dep [`5980245`](https://github.com/inspect-js/is-core-module/commit/59802456e9ac919fa748f53be9d8fbf304a197df) ## [v2.11.0](https://github.com/inspect-js/is-core-module/compare/v2.10.0...v2.11.0) - 2022-10-18 ### Commits - [meta] use `npmignore` to autogenerate an npmignore file [`3360011`](https://github.com/inspect-js/is-core-module/commit/33600118857b46177178072fba2affcdeb009d12) - [Dev Deps] update `aud`, `tape` [`651c6b0`](https://github.com/inspect-js/is-core-module/commit/651c6b0cc2799d4130866cf43ad333dcade3d26c) - [New] `inspector/promises` and `node:inspector/promises` is now available in node 19 [`22d332f`](https://github.com/inspect-js/is-core-module/commit/22d332fe22ac050305444e0781ff85af819abcb0) ## [v2.10.0](https://github.com/inspect-js/is-core-module/compare/v2.9.0...v2.10.0) - 2022-08-03 ### Commits - [New] `node:test` is now available in node ^16.17 [`e8fd36e`](https://github.com/inspect-js/is-core-module/commit/e8fd36e9b86c917775a07cc473b62a3294f459f2) - [Tests] improve skip message [`c014a4c`](https://github.com/inspect-js/is-core-module/commit/c014a4c0cd6eb15fff573ae4709191775e70cab4) ## [v2.9.0](https://github.com/inspect-js/is-core-module/compare/v2.8.1...v2.9.0) - 2022-04-19 ### Commits - [New] add `node:test`, in node 18+ [`f853eca`](https://github.com/inspect-js/is-core-module/commit/f853eca801d0a7d4e1dbb670f1b6d9837d9533c5) - [Tests] use `mock-property` [`03b3644`](https://github.com/inspect-js/is-core-module/commit/03b3644dff4417f4ba5a7d0aa0138f5f6b3e5c46) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`7c0e2d0`](https://github.com/inspect-js/is-core-module/commit/7c0e2d06ed2a89acf53abe2ab34d703ed5b03455) - [meta] simplify "exports" [`d6ed201`](https://github.com/inspect-js/is-core-module/commit/d6ed201eba7fbba0e59814a9050fc49a6e9878c8) ## [v2.8.1](https://github.com/inspect-js/is-core-module/compare/v2.8.0...v2.8.1) - 2022-01-05 ### Commits - [actions] reuse common workflows [`cd2cf9b`](https://github.com/inspect-js/is-core-module/commit/cd2cf9b3b66c8d328f65610efe41e9325db7716d) - [Fix] update node 0.4 results [`062195d`](https://github.com/inspect-js/is-core-module/commit/062195d89f0876a88b95d378b43f7fcc1205bc5b) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`0790b62`](https://github.com/inspect-js/is-core-module/commit/0790b6222848c6167132f9f73acc3520fa8d1298) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`7d139a6`](https://github.com/inspect-js/is-core-module/commit/7d139a6d767709eabf0a0251e074ec1fb230c06e) - [Tests] run `nyc` in `tests-only`, not `test` [`780e8a0`](https://github.com/inspect-js/is-core-module/commit/780e8a049951c71cf78b1707f0871c48a28bde14) ## [v2.8.0](https://github.com/inspect-js/is-core-module/compare/v2.7.0...v2.8.0) - 2021-10-14 ### Commits - [actions] update codecov uploader [`0cfe94e`](https://github.com/inspect-js/is-core-module/commit/0cfe94e106a7d005ea03e008c0a21dec13a77904) - [New] add `readline/promises` to node v17+ [`4f78c30`](https://github.com/inspect-js/is-core-module/commit/4f78c3008b1b58b4db6dc91d99610b1bc859da7e) - [Tests] node ^14.18 supports `node:` prefixes for CJS [`43e2f17`](https://github.com/inspect-js/is-core-module/commit/43e2f177452cea2f0eaf34f61b5407217bbdb6f4) ## [v2.7.0](https://github.com/inspect-js/is-core-module/compare/v2.6.0...v2.7.0) - 2021-09-27 ### Commits - [New] node `v14.18` added `node:`-prefixed core modules to `require` [`6d943ab`](https://github.com/inspect-js/is-core-module/commit/6d943abe81382b9bbe344384d80fbfebe1cc0526) - [Tests] add coverage for Object.prototype pollution [`c6baf5f`](https://github.com/inspect-js/is-core-module/commit/c6baf5f942311a1945c1af41167bb80b84df2af7) - [Dev Deps] update `@ljharb/eslint-config` [`6717f00`](https://github.com/inspect-js/is-core-module/commit/6717f000d063ea57beb772bded36c2f056ac404c) - [eslint] fix linter warning [`594c10b`](https://github.com/inspect-js/is-core-module/commit/594c10bb7d39d7eb00925c90924199ff596184b2) - [meta] add `sideEffects` flag [`c32cfa5`](https://github.com/inspect-js/is-core-module/commit/c32cfa5195632944c4dd4284a142b8476e75be13) ## [v2.6.0](https://github.com/inspect-js/is-core-module/compare/v2.5.0...v2.6.0) - 2021-08-17 ### Commits - [Dev Deps] update `eslint`, `tape` [`6cc928f`](https://github.com/inspect-js/is-core-module/commit/6cc928f8a4bba66aeeccc4f6beeac736d4bd3081) - [New] add `stream/consumers` to node `&gt;= 16.7` [`a1a423e`](https://github.com/inspect-js/is-core-module/commit/a1a423e467e4cc27df180234fad5bab45943e67d) - [Refactor] Remove duplicated `&&` operand [`86faea7`](https://github.com/inspect-js/is-core-module/commit/86faea738213a2433c62d1098488dc9314dca832) - [Tests] include prereleases [`a4da7a6`](https://github.com/inspect-js/is-core-module/commit/a4da7a6abf7568e2aa4fd98e69452179f1850963) ## [v2.5.0](https://github.com/inspect-js/is-core-module/compare/v2.4.0...v2.5.0) - 2021-07-12 ### Commits - [Dev Deps] update `auto-changelog`, `eslint` [`6334cc9`](https://github.com/inspect-js/is-core-module/commit/6334cc94f3af7469685bd8f236740991baaf2705) - [New] add `stream/web` to node v16.5+ [`17ac59b`](https://github.com/inspect-js/is-core-module/commit/17ac59b662d63e220a2e5728625f005c24f177b2) ## [v2.4.0](https://github.com/inspect-js/is-core-module/compare/v2.3.0...v2.4.0) - 2021-05-09 ### Commits - [readme] add actions and codecov badges [`82b7faa`](https://github.com/inspect-js/is-core-module/commit/82b7faa12b56dbe47fbea67e1a5b9e447027ba40) - [Dev Deps] update `@ljharb/eslint-config`, `aud` [`8096868`](https://github.com/inspect-js/is-core-module/commit/8096868c024a161ccd4d44110b136763e92eace8) - [Dev Deps] update `eslint` [`6726824`](https://github.com/inspect-js/is-core-module/commit/67268249b88230018c510f6532a8046d7326346f) - [New] add `diagnostics_channel` to node `^14.17` [`86c6563`](https://github.com/inspect-js/is-core-module/commit/86c65634201b8ff9b3e48a9a782594579c7f5c3c) - [meta] fix prepublish script [`697a01e`](https://github.com/inspect-js/is-core-module/commit/697a01e3c9c0be074066520954f30fb28532ec57) ## [v2.3.0](https://github.com/inspect-js/is-core-module/compare/v2.2.0...v2.3.0) - 2021-04-24 ### Commits - [meta] do not publish github action workflow files [`060d4bb`](https://github.com/inspect-js/is-core-module/commit/060d4bb971a29451c19ff336eb56bee27f9fa95a) - [New] add support for `node:` prefix, in node 16+ [`7341223`](https://github.com/inspect-js/is-core-module/commit/73412230a769f6e81c05eea50b6520cebf54ed2f) - [actions] use `node/install` instead of `node/run`; use `codecov` action [`016269a`](https://github.com/inspect-js/is-core-module/commit/016269abae9f6657a5254adfbb813f09a05067f9) - [patch] remove unneeded `.0` in version ranges [`cb466a6`](https://github.com/inspect-js/is-core-module/commit/cb466a6d89e52b8389e5c12715efcd550c41cea3) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`c9f9c39`](https://github.com/inspect-js/is-core-module/commit/c9f9c396ace60ef81906f98059c064e6452473ed) - [actions] update workflows [`3ee4a89`](https://github.com/inspect-js/is-core-module/commit/3ee4a89fd5a02fccd43882d905448ea6a98e9a3c) - [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`dee4fed`](https://github.com/inspect-js/is-core-module/commit/dee4fed79690c1d43a22f7fa9426abebdc6d727f) - [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`7d046ba`](https://github.com/inspect-js/is-core-module/commit/7d046ba07ae8c9292e43652694ca808d7b309de8) - [meta] use `prepublishOnly` script for npm 7+ [`149e677`](https://github.com/inspect-js/is-core-module/commit/149e6771a5ede6d097e71785b467a9c4b4977cc7) - [readme] remove travis badge [`903b51d`](https://github.com/inspect-js/is-core-module/commit/903b51d6b69b98abeabfbc3695c345b02646f19c) ## [v2.2.0](https://github.com/inspect-js/is-core-module/compare/v2.1.0...v2.2.0) - 2020-11-26 ### Commits - [Tests] migrate tests to Github Actions [`c919f57`](https://github.com/inspect-js/is-core-module/commit/c919f573c0a92d10a0acad0b650b5aecb033d426) - [patch] `core.json`: %s/ /\t/g [`db3f685`](https://github.com/inspect-js/is-core-module/commit/db3f68581f53e73cc09cd675955eb1bdd6a5a39b) - [Tests] run `nyc` on all tests [`b2f925f`](https://github.com/inspect-js/is-core-module/commit/b2f925f8866f210ef441f39fcc8cc42692ab89b1) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`; add `safe-publish-latest` [`89f02a2`](https://github.com/inspect-js/is-core-module/commit/89f02a2b4162246dea303a6ee31bb9a550b05c72) - [New] add `path/posix`, `path/win32`, `util/types` [`77f94f1`](https://github.com/inspect-js/is-core-module/commit/77f94f1e90ffd7c0be2a3f1aa8574ebf7fd981b3) ## [v2.1.0](https://github.com/inspect-js/is-core-module/compare/v2.0.0...v2.1.0) - 2020-11-04 ### Commits - [Dev Deps] update `eslint` [`5e0034e`](https://github.com/inspect-js/is-core-module/commit/5e0034eae57c09c8f1bd769f502486a00f56c6e4) - [New] Add `diagnostics_channel` [`c2d83d0`](https://github.com/inspect-js/is-core-module/commit/c2d83d0a0225a1a658945d9bab7036ea347d29ec) ## [v2.0.0](https://github.com/inspect-js/is-core-module/compare/v1.0.2...v2.0.0) - 2020-09-29 ### Commits - v2 implementation [`865aeb5`](https://github.com/inspect-js/is-core-module/commit/865aeb5ca0e90248a3dfff5d7622e4751fdeb9cd) - Only apps should have lockfiles [`5a5e660`](https://github.com/inspect-js/is-core-module/commit/5a5e660d568e37eb44e17fb1ebb12a105205fc2b) - Initial commit for v2 [`5a51524`](https://github.com/inspect-js/is-core-module/commit/5a51524e06f92adece5fbb138c69b7b9748a2348) - Tests [`116eae4`](https://github.com/inspect-js/is-core-module/commit/116eae4fccd01bc72c1fd3cc4b7561c387afc496) - [meta] add `auto-changelog` [`c24388b`](https://github.com/inspect-js/is-core-module/commit/c24388bee828d223040519d1f5b226ca35beee63) - [actions] add "Automatic Rebase" and "require allow edits" actions [`34292db`](https://github.com/inspect-js/is-core-module/commit/34292dbcbadae0868aff03c22dbd8b7b8a11558a) - [Tests] add `npm run lint` [`4f9eeee`](https://github.com/inspect-js/is-core-module/commit/4f9eeee7ddff10698bbf528620f4dc8d4fa3e697) - [readme] fix travis badges, https all URLs [`e516a73`](https://github.com/inspect-js/is-core-module/commit/e516a73b0dccce20938c432b1ba512eae8eff9e9) - [meta] create FUNDING.yml [`1aabebc`](https://github.com/inspect-js/is-core-module/commit/1aabebca98d01f8a04e46bc2e2520fa93cf21ac6) - [Fix] `domain`: domain landed sometime &gt; v0.7.7 and &lt;= v0.7.12 [`2df7d37`](https://github.com/inspect-js/is-core-module/commit/2df7d37595d41b15eeada732b706b926c2771655) - [Fix] `sys`: worked in 0.6, not 0.7, and 0.8+ [`a75c134`](https://github.com/inspect-js/is-core-module/commit/a75c134229e1e9441801f6b73f6a52489346eb65) ## [v1.0.2](https://github.com/inspect-js/is-core-module/compare/v1.0.1...v1.0.2) - 2014-09-28 ### Commits - simpler [`66fe90f`](https://github.com/inspect-js/is-core-module/commit/66fe90f9771581b9adc0c3900baa52c21b5baea2) ## [v1.0.1](https://github.com/inspect-js/is-core-module/compare/v1.0.0...v1.0.1) - 2014-09-28 ### Commits - remove stupid [`f21f906`](https://github.com/inspect-js/is-core-module/commit/f21f906f882c2bd656a5fc5ed6fbe48ddaffb2ac) - update readme [`1eff0ec`](https://github.com/inspect-js/is-core-module/commit/1eff0ec69798d1ec65771552d1562911e90a8027) ## v1.0.0 - 2014-09-28 ### Commits - init [`48e5e76`](https://github.com/inspect-js/is-core-module/commit/48e5e76cac378fddb8c1f7d4055b8dfc943d6b96)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/is-core-module/CHANGELOG.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/is-core-module/CHANGELOG.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 15385 }
# is-core-module <sup>[![Version Badge][2]][1]</sup> [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][5]][6] [![dev dependency status][7]][8] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][11]][1] Is this specifier a node.js core module? Optionally provide a node version to check; defaults to the current node version. ## Example ```js var isCore = require('is-core-module'); var assert = require('assert'); assert(isCore('fs')); assert(!isCore('butts')); ``` ## Tests Clone the repo, `npm install`, and run `npm test` [1]: https://npmjs.org/package/is-core-module [2]: https://versionbadg.es/inspect-js/is-core-module.svg [5]: https://david-dm.org/inspect-js/is-core-module.svg [6]: https://david-dm.org/inspect-js/is-core-module [7]: https://david-dm.org/inspect-js/is-core-module/dev-status.svg [8]: https://david-dm.org/inspect-js/is-core-module#info=devDependencies [11]: https://nodei.co/npm/is-core-module.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/is-core-module.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/is-core-module.svg [downloads-url]: https://npm-stat.com/charts.html?package=is-core-module [codecov-image]: https://codecov.io/gh/inspect-js/is-core-module/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/inspect-js/is-core-module/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-core-module [actions-url]: https://github.com/inspect-js/is-core-module/actions
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/is-core-module/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/is-core-module/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1658 }
# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) > Returns true if a string has an extglob. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save is-extglob ``` ## Usage ```js var isExtglob = require('is-extglob'); ``` **True** ```js isExtglob('?(abc)'); isExtglob('@(abc)'); isExtglob('!(abc)'); isExtglob('*(abc)'); isExtglob('+(abc)'); ``` **False** Escaped extglobs: ```js isExtglob('\\?(abc)'); isExtglob('\\@(abc)'); isExtglob('\\!(abc)'); isExtglob('\\*(abc)'); isExtglob('\\+(abc)'); ``` Everything else... ```js isExtglob('foo.js'); isExtglob('!foo.js'); isExtglob('*.js'); isExtglob('**/abc.js'); isExtglob('abc/*.js'); isExtglob('abc/(aaa|bbb).js'); isExtglob('abc/[a-z].js'); isExtglob('abc/{a,b}.js'); isExtglob('abc/?.js'); isExtglob('abc.js'); isExtglob('abc/def/ghi.js'); ``` ## History **v2.0** Adds support for escaping. Escaped exglobs no longer return true. ## About ### Related projects * [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") * [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") * [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") ### Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). ### Building docs _(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ To generate the readme and API documentation with [verb](https://github.com/verbose/verb): ```sh $ npm install -g verb verb-generate-readme && verb ``` ### Running tests Install dev dependencies: ```sh $ npm install -d && npm test ``` ### Author **Jon Schlinkert** * [github/jonschlinkert](https://github.com/jonschlinkert) * [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ### License Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/is-extglob/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/is-extglob/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 3466 }
# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) > Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) ## Install ``` $ npm install is-fullwidth-code-point ``` ## Usage ```js const isFullwidthCodePoint = require('is-fullwidth-code-point'); isFullwidthCodePoint('谢'.codePointAt(0)); //=> true isFullwidthCodePoint('a'.codePointAt(0)); //=> false ``` ## API ### isFullwidthCodePoint(codePoint) #### codePoint Type: `number` The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. ## License MIT © [Sindre Sorhus](https://sindresorhus.com)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/is-fullwidth-code-point/readme.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/is-fullwidth-code-point/readme.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 839 }
# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions) > Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save is-glob ``` You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). ## Usage ```js var isGlob = require('is-glob'); ``` ### Default behavior **True** Patterns that have glob characters or regex patterns will return `true`: ```js isGlob('!foo.js'); isGlob('*.js'); isGlob('**/abc.js'); isGlob('abc/*.js'); isGlob('abc/(aaa|bbb).js'); isGlob('abc/[a-z].js'); isGlob('abc/{a,b}.js'); //=> true ``` Extglobs ```js isGlob('abc/@(a).js'); isGlob('abc/!(a).js'); isGlob('abc/+(a).js'); isGlob('abc/*(a).js'); isGlob('abc/?(a).js'); //=> true ``` **False** Escaped globs or extglobs return `false`: ```js isGlob('abc/\\@(a).js'); isGlob('abc/\\!(a).js'); isGlob('abc/\\+(a).js'); isGlob('abc/\\*(a).js'); isGlob('abc/\\?(a).js'); isGlob('\\!foo.js'); isGlob('\\*.js'); isGlob('\\*\\*/abc.js'); isGlob('abc/\\*.js'); isGlob('abc/\\(aaa|bbb).js'); isGlob('abc/\\[a-z].js'); isGlob('abc/\\{a,b}.js'); //=> false ``` Patterns that do not have glob patterns return `false`: ```js isGlob('abc.js'); isGlob('abc/def/ghi.js'); isGlob('foo.js'); isGlob('abc/@.js'); isGlob('abc/+.js'); isGlob('abc/?.js'); isGlob(); isGlob(null); //=> false ``` Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): ```js isGlob(['**/*.js']); isGlob(['foo.js']); //=> false ``` ### Option strict When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not. **True** Patterns that have glob characters or regex patterns will return `true`: ```js isGlob('!foo.js', {strict: false}); isGlob('*.js', {strict: false}); isGlob('**/abc.js', {strict: false}); isGlob('abc/*.js', {strict: false}); isGlob('abc/(aaa|bbb).js', {strict: false}); isGlob('abc/[a-z].js', {strict: false}); isGlob('abc/{a,b}.js', {strict: false}); //=> true ``` Extglobs ```js isGlob('abc/@(a).js', {strict: false}); isGlob('abc/!(a).js', {strict: false}); isGlob('abc/+(a).js', {strict: false}); isGlob('abc/*(a).js', {strict: false}); isGlob('abc/?(a).js', {strict: false}); //=> true ``` **False** Escaped globs or extglobs return `false`: ```js isGlob('\\!foo.js', {strict: false}); isGlob('\\*.js', {strict: false}); isGlob('\\*\\*/abc.js', {strict: false}); isGlob('abc/\\*.js', {strict: false}); isGlob('abc/\\(aaa|bbb).js', {strict: false}); isGlob('abc/\\[a-z].js', {strict: false}); isGlob('abc/\\{a,b}.js', {strict: false}); //=> false ``` ## About <details> <summary><strong>Contributing</strong></summary> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). </details> <details> <summary><strong>Running Tests</strong></summary> Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: ```sh $ npm install && npm test ``` </details> <details> <summary><strong>Building docs</strong></summary> _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ To generate the readme, run the following command: ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` </details> ### Related projects You might also be interested in these projects: * [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") * [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") * [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") * [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") ### Contributors | **Commits** | **Contributor** | | --- | --- | | 47 | [jonschlinkert](https://github.com/jonschlinkert) | | 5 | [doowb](https://github.com/doowb) | | 1 | [phated](https://github.com/phated) | | 1 | [danhper](https://github.com/danhper) | | 1 | [paulmillr](https://github.com/paulmillr) | ### Author **Jon Schlinkert** * [GitHub Profile](https://github.com/jonschlinkert) * [Twitter Profile](https://twitter.com/jonschlinkert) * [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) ### License Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT License](LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/is-glob/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/is-glob/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 7138 }
# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![NPM total downloads](https://img.shields.io/npm/dt/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-number) > Returns true if the value is a finite number. Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save is-number ``` ## Why is this needed? In JavaScript, it's not always as straightforward as it should be to reliably check if a value is a number. It's common for devs to use `+`, `-`, or `Number()` to cast a string value to a number (for example, when values are returned from user input, regex matches, parsers, etc). But there are many non-intuitive edge cases that yield unexpected results: ```js console.log(+[]); //=> 0 console.log(+''); //=> 0 console.log(+' '); //=> 0 console.log(typeof NaN); //=> 'number' ``` This library offers a performant way to smooth out edge cases like these. ## Usage ```js const isNumber = require('is-number'); ``` See the [tests](./test.js) for more examples. ### true ```js isNumber(5e3); // true isNumber(0xff); // true isNumber(-1.1); // true isNumber(0); // true isNumber(1); // true isNumber(1.1); // true isNumber(10); // true isNumber(10.10); // true isNumber(100); // true isNumber('-1.1'); // true isNumber('0'); // true isNumber('012'); // true isNumber('0xff'); // true isNumber('1'); // true isNumber('1.1'); // true isNumber('10'); // true isNumber('10.10'); // true isNumber('100'); // true isNumber('5e3'); // true isNumber(parseInt('012')); // true isNumber(parseFloat('012')); // true ``` ### False Everything else is false, as you would expect: ```js isNumber(Infinity); // false isNumber(NaN); // false isNumber(null); // false isNumber(undefined); // false isNumber(''); // false isNumber(' '); // false isNumber('foo'); // false isNumber([1]); // false isNumber([]); // false isNumber(function () {}); // false isNumber({}); // false ``` ## Release history ### 7.0.0 * Refactor. Now uses `.isFinite` if it exists. * Performance is about the same as v6.0 when the value is a string or number. But it's now 3x-4x faster when the value is not a string or number. ### 6.0.0 * Optimizations, thanks to @benaadams. ### 5.0.0 **Breaking changes** * removed support for `instanceof Number` and `instanceof String` ## Benchmarks As with all benchmarks, take these with a grain of salt. See the [benchmarks](./benchmark/index.js) for more detail. ``` # all v7.0 x 413,222 ops/sec ±2.02% (86 runs sampled) v6.0 x 111,061 ops/sec ±1.29% (85 runs sampled) parseFloat x 317,596 ops/sec ±1.36% (86 runs sampled) fastest is 'v7.0' # string v7.0 x 3,054,496 ops/sec ±1.05% (89 runs sampled) v6.0 x 2,957,781 ops/sec ±0.98% (88 runs sampled) parseFloat x 3,071,060 ops/sec ±1.13% (88 runs sampled) fastest is 'parseFloat,v7.0' # number v7.0 x 3,146,895 ops/sec ±0.89% (89 runs sampled) v6.0 x 3,214,038 ops/sec ±1.07% (89 runs sampled) parseFloat x 3,077,588 ops/sec ±1.07% (87 runs sampled) fastest is 'v6.0' ``` ## About <details> <summary><strong>Contributing</strong></summary> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). </details> <details> <summary><strong>Running Tests</strong></summary> Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: ```sh $ npm install && npm test ``` </details> <details> <summary><strong>Building docs</strong></summary> _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ To generate the readme, run the following command: ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` </details> ### Related projects You might also be interested in these projects: * [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") * [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") * [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") * [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") ### Contributors | **Commits** | **Contributor** | | --- | --- | | 49 | [jonschlinkert](https://github.com/jonschlinkert) | | 5 | [charlike-old](https://github.com/charlike-old) | | 1 | [benaadams](https://github.com/benaadams) | | 1 | [realityking](https://github.com/realityking) | ### Author **Jon Schlinkert** * [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) * [GitHub Profile](https://github.com/jonschlinkert) * [Twitter Profile](https://twitter.com/jonschlinkert) ### License Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT License](LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 15, 2018._
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/is-number/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/is-number/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 6504 }
# isexe Minimal module to check if a file is executable, and a normal file. Uses `fs.stat` and tests against the `PATHEXT` environment variable on Windows. ## USAGE ```javascript var isexe = require('isexe') isexe('some-file-name', function (err, isExe) { if (err) { console.error('probably file does not exist or something', err) } else if (isExe) { console.error('this thing can be run') } else { console.error('cannot be run') } }) // same thing but synchronous, throws errors var isExe = isexe.sync('some-file-name') // treat errors as just "not executable" isexe('maybe-missing-file', { ignoreErrors: true }, callback) var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) ``` ## API ### `isexe(path, [options], [callback])` Check if the path is executable. If no callback provided, and a global `Promise` object is available, then a Promise will be returned. Will raise whatever errors may be raised by `fs.stat`, unless `options.ignoreErrors` is set to true. ### `isexe.sync(path, [options])` Same as `isexe` but returns the value and throws any errors raised. ### Options * `ignoreErrors` Treat all errors as "no, this is not executable", but don't raise them. * `uid` Number to use as the user id * `gid` Number to use as the group id * `pathExt` List of path extensions to use instead of `PATHEXT` environment variable on Windows.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/isexe/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/isexe/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1394 }
# Blue Oak Model License Version 1.0.0 ## Purpose This license gives everyone as much permission to work with this software as possible, while protecting contributors from liability. ## Acceptance In order to receive this license, you must agree to its rules. The rules of this license are both obligations under that agreement and conditions to your license. You must not do anything with this software that triggers a rule that you cannot or will not follow. ## Copyright Each contributor licenses you to do everything with this software that would otherwise infringe that contributor's copyright in it. ## Notices You must ensure that everyone who gets a copy of any part of this software from you, with or without changes, also gets the text of this license or a link to <https://blueoakcouncil.org/license/1.0.0>. ## Excuse If anyone notifies you in writing that you have not complied with [Notices](#notices), you can keep your license by taking all practical steps to comply within 30 days after the notice. If you do not do so, your license ends immediately. ## Patent Each contributor licenses you to do everything with this software that would otherwise infringe any patent claims they can license or become able to license. ## Reliability No contributor can revoke this license. ## No Liability **_As far as the law allows, this software comes as is, without any warranty or condition, and no contributor will be liable to anyone for any damages related to this software or this license, under any kind of legal claim._**
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/jackspeak/LICENSE.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/jackspeak/LICENSE.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1549 }
# jackspeak A very strict and proper argument parser. Validate string, boolean, and number options, from the command line and the environment. Call the `jack` method with a config object, and then chain methods off of it. At the end, call the `.parse()` method, and you'll get an object with `positionals` and `values` members. Any unrecognized configs or invalid values will throw an error. As long as you define configs using object literals, types will be properly inferred and TypeScript will know what kinds of things you got. If you give it a prefix for environment variables, then defaults will be read from the environment, and parsed values written back to it, so you can easily pass configs through to child processes. Automatically generates a `usage`/`help` banner by calling the `.usage()` method. Unless otherwise noted, all methods return the object itself. ## USAGE ```js import { jack } from 'jackspeak' // this works too: // const { jack } = require('jackspeak') const { positionals, values } = jack({ envPrefix: 'FOO' }) .flag({ asdf: { description: 'sets the asfd flag', short: 'a', default: true }, 'no-asdf': { description: 'unsets the asdf flag', short: 'A' }, foo: { description: 'another boolean', short: 'f' }, }) .optList({ 'ip-addrs': { description: 'addresses to ip things', delim: ',', // defaults to '\n' default: ['127.0.0.1'], }, }) .parse([ 'some', 'positional', '--ip-addrs', '192.168.0.1', '--ip-addrs', '1.1.1.1', 'args', '--foo', // sets the foo flag '-A', // short for --no-asdf, sets asdf flag to false ]) console.log(process.env.FOO_ASDF) // '0' console.log(process.env.FOO_FOO) // '1' console.log(values) // { // 'ip-addrs': ['192.168.0.1', '1.1.1.1'], // foo: true, // asdf: false, // } console.log(process.env.FOO_IP_ADDRS) // '192.168.0.1,1.1.1.1' console.log(positionals) // ['some', 'positional', 'args'] ``` ## `jack(options: JackOptions = {}) => Jack` Returns a `Jack` object that can be used to chain and add field definitions. The other methods (apart from `validate()`, `parse()`, and `usage()` obviously) return the same Jack object, updated with the new types, so they can be chained together as shown in the code examples. Options: - `allowPositionals` Defaults to true. Set to `false` to not allow any positional arguments. - `envPrefix` Set to a string to write configs to and read configs from the environment. For example, if set to `MY_APP` then the `foo-bar` config will default based on the value of `env.MY_APP_FOO_BAR` and will write back to that when parsed. Boolean values are written as `'1'` and `'0'`, and will be treated as `true` if they're `'1'` or false otherwise. Number values are written with their `toString()` representation. Strings are just strings. Any value with `multiple: true` will be represented in the environment split by a delimiter, which defaults to `\n`. - `env` The place to read/write environment variables. Defaults to `process.env`. - `usage` A short usage string to print at the top of the help banner. - `stopAtPositional` Boolean, default false. Stop parsing opts and flags at the first positional argument. This is useful if you want to pass certain options to subcommands, like some programs do, so you can stop parsing and pass the positionals to the subcommand to parse. - `stopAtPositionalTest` Conditional `stopAtPositional`. Provide a function that takes a positional argument string and returns boolean. If it returns `true`, then parsing will stop. Useful when _some_ subcommands should parse the rest of the command line options, and others should not. ### `Jack.heading(text: string, level?: 1 | 2 | 3 | 4 | 5 | 6)` Define a short string heading, used in the `usage()` output. Indentation of the heading and subsequent description/config usage entries (up until the next heading) is set by the heading level. If the first usage item defined is a heading, it is always treated as level 1, regardless of the argument provided. Headings level 1 and 2 will have a line of padding underneath them. Headings level 3 through 6 will not. ### `Jack.description(text: string, { pre?: boolean } = {})` Define a long string description, used in the `usage()` output. If the `pre` option is set to `true`, then whitespace will not be normalized. However, if any line is too long for the width allotted, it will still be wrapped. ## Option Definitions Configs are defined by calling the appropriate field definition method with an object where the keys are the long option name, and the value defines the config. Options: - `type` Only needed for the `addFields` method, as the others set it implicitly. Can be `'string'`, `'boolean'`, or `'number'`. - `multiple` Only needed for the `addFields` method, as the others set it implicitly. Set to `true` to define an array type. This means that it can be set on the CLI multiple times, set as an array in the `values` and it is represented in the environment as a delimited string. - `short` A one-character shorthand for the option. - `description` Some words to describe what this option is and why you'd set it. - `hint` (Only relevant for non-boolean types) The thing to show in the usage output, like `--option=<hint>` - `validate` A function that returns false (or throws) if an option value is invalid. - `validOptions` An array of strings or numbers that define the valid values that can be set. This is not allowed on `boolean` (flag) options. May be used along with a `validate()` method. - `default` A default value for the field. Note that this may be overridden by an environment variable, if present. ### `Jack.flag({ [option: string]: definition, ... })` Define one or more boolean fields. Boolean options may be set to `false` by using a `--no-${optionName}` argument, which will be implicitly created if it's not defined to be something else. If a boolean option named `no-${optionName}` with the same `multiple` setting is in the configuration, then that will be treated as a negating flag. ### `Jack.flagList({ [option: string]: definition, ... })` Define one or more boolean array fields. ### `Jack.num({ [option: string]: definition, ... })` Define one or more number fields. These will be set in the environment as a stringified number, and included in the `values` object as a number. ### `Jack.numList({ [option: string]: definition, ... })` Define one or more number list fields. These will be set in the environment as a delimited set of stringified numbers, and included in the `values` as a number array. ### `Jack.opt({ [option: string]: definition, ... })` Define one or more string option fields. ### `Jack.optList({ [option: string]: definition, ... })` Define one or more string list fields. ### `Jack.addFields({ [option: string]: definition, ... })` Define one or more fields of any type. Note that `type` and `multiple` must be set explicitly on each definition when using this method. ## Actions Use these methods on a Jack object that's already had its config fields defined. ### `Jack.parse(args: string[] = process.argv): { positionals: string[], values: OptionsResults }` Parse the arguments list, write to the environment if `envPrefix` is set, and returned the parsed values and remaining positional arguments. ### `Jack.validate(o: any): asserts o is OptionsResults` Throws an error if the object provided is not a valid result set, for the configurations defined thusfar. ### `Jack.usage(): string` Returns the compiled `usage` string, with all option descriptions and heading/description text, wrapped to the appropriate width for the terminal. ### `Jack.setConfigValues(options: OptionsResults, src?: string)` Validate the `options` argument, and set the default value for each field that appears in the options. Values provided will be overridden by environment variables or command line arguments. ### `Jack.usageMarkdown(): string` Returns the compiled `usage` string, with all option descriptions and heading/description text, but as markdown instead of formatted for a terminal, for generating HTML documentation for your CLI. ## Some Example Code Also see [the examples folder](https://github.com/isaacs/jackspeak/tree/master/examples) ```js import { jack } from 'jackspeak' const j = jack({ // Optional // This will be auto-generated from the descriptions if not supplied // top level usage line, printed by -h // will be auto-generated if not specified usage: 'foo [options] <files>', }) .heading('The best Foo that ever Fooed') .description( ` Executes all the files and interprets their output as TAP formatted test result data. To parse TAP data from stdin, specify "-" as a filename. `, ) // flags don't take a value, they're boolean on or off, and can be // turned off by prefixing with `--no-` // so this adds support for -b to mean --bail, or -B to mean --no-bail .flag({ flag: { // specify a short value if you like. this must be a single char short: 'f', // description is optional as well. description: `Make the flags wave`, // default value for flags is 'false', unless you change it default: true, }, 'no-flag': { // you can can always negate a flag with `--no-flag` // specifying a negate option will let you define a short // single-char option for negation. short: 'F', description: `Do not wave the flags`, }, }) // Options that take a value are specified with `opt()` .opt({ reporter: { short: 'R', description: 'the style of report to display', }, }) // if you want a number, say so, and jackspeak will enforce it .num({ jobs: { short: 'j', description: 'how many jobs to run in parallel', default: 1, }, }) // A list is an option that can be specified multiple times, // to expand into an array of all the settings. Normal opts // will just give you the last value specified. .optList({ 'node-arg': {}, }) // a flagList is an array of booleans, so `-ddd` is [true, true, true] // count the `true` values to treat it as a counter. .flagList({ debug: { short: 'd' }, }) // opts take a value, and is set to the string in the results // you can combine multiple short-form flags together, but // an opt will end the combine chain, posix-style. So, // -bofilename would be like --bail --output-file=filename .opt({ 'output-file': { short: 'o', // optional: make it -o<file> in the help output insead of -o<value> hint: 'file', description: `Send the raw output to the specified file.`, }, }) // now we can parse argv like this: const { values, positionals } = j.parse(process.argv) // or decide to show the usage banner console.log(j.usage()) // or validate an object config we got from somewhere else try { j.validate(someConfig) } catch (er) { console.error('someConfig is not valid!', er) } ``` ## Name The inspiration for this module is [yargs](http://npm.im/yargs), which is pirate talk themed. Yargs has all the features, and is infinitely flexible. "Jackspeak" is the slang of the royal navy. This module does not have all the features. It is declarative and rigid by design.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/jackspeak/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/jackspeak/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 11397 }
# jiti [![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![bundle][bundle-src]][bundle-href] [![License][license-src]][license-href] Runtime Typescript and ESM support for Node.js. > [!IMPORTANT] > This is the support branch for jiti v1. Check out [jiti/main](https://github.com/unjs/jiti/tree/main) for the latest version and [unjs/jiti#174](https://github.com/unjs/jiti/issues/174) for the roadmap. ## Features - Seamless typescript and ESM syntax support - Seamless interoperability between ESM and CommonJS - Synchronous API to replace `require` - Super slim and zero dependency - Smart syntax detection to avoid extra transforms - CommonJS cache integration - Filesystem transpile hard cache - V8 compile cache - Custom resolve alias ## Usage ### Programmatic ```js const jiti = require("jiti")(__filename); jiti("./path/to/file.ts"); ``` You can also pass options as second argument: ```js const jiti = require("jiti")(__filename, { debug: true }); ``` ### CLI ```bash jiti index.ts # or npx jiti index.ts ``` ### Register require hook ```bash node -r jiti/register index.ts ``` Alternatively, you can register `jiti` as a require hook programmatically: ```js const jiti = require("jiti")(); const unregister = jiti.register(); ``` ## Options ### `debug` - Type: Boolean - Default: `false` - Environment Variable: `JITI_DEBUG` Enable debug to see which files are transpiled ### `cache` - Type: Boolean | String - Default: `true` - Environment Variable: `JITI_CACHE` Use transpile cache If set to `true` will use `node_modules/.cache/jiti` (if exists) or `{TMP_DIR}/node-jiti` ### `esmResolve` - Type: Boolean | String - Default: `false` - Environment Variable: `JITI_ESM_RESOLVE` Using esm resolution algorithm to support `import` condition. ### `transform` - Type: Function - Default: Babel (lazy loaded) Transform function. See [src/babel](./src/babel.ts) for more details ### `sourceMaps` - Type: Boolean - Default `false` - Environment Variable: `JITI_SOURCE_MAPS` Add inline source map to transformed source for better debugging. ### `interopDefault` - Type: Boolean - Default: `false` Return the `.default` export of a module at the top-level. ### `alias` - Type: Object - Default: - - Environment Variable: `JITI_ALIAS` Custom alias map used to resolve ids. ### `nativeModules` - Type: Array - Default: ['typescript`] - Environment Variable: `JITI_NATIVE_MODULES` List of modules (within `node_modules`) to always use native require for them. ### `transformModules` - Type: Array - Default: [] - Environment Variable: `JITI_TRANSFORM_MODULES` List of modules (within `node_modules`) to transform them regardless of syntax. ### `experimentalBun` - Type: Boolean - Default: Enabled if `process.versions.bun` exists (Bun runtime) - Environment Variable: `JITI_EXPERIMENTAL_BUN` Enable experimental native Bun support for transformations. ## Development - Clone this repository - Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` - Install dependencies using `pnpm install` - Run `pnpm dev` - Run `pnpm jiti ./test/path/to/file.ts` ## License MIT. Made with 💖 <!-- Badged --> [npm-version-src]: https://img.shields.io/npm/v/jiti?style=flat&colorA=18181B&colorB=F0DB4F [npm-version-href]: https://npmjs.com/package/jiti [npm-downloads-src]: https://img.shields.io/npm/dm/jiti?style=flat&colorA=18181B&colorB=F0DB4F [npm-downloads-href]: https://npmjs.com/package/jiti [bundle-src]: https://img.shields.io/bundlephobia/minzip/jiti?style=flat&colorA=18181B&colorB=F0DB4F [bundle-href]: https://bundlephobia.com/result?p=h3 [license-src]: https://img.shields.io/github/license/unjs/jiti.svg?style=flat&colorA=18181B&colorB=F0DB4F [license-href]: https://github.com/unjs/jiti/blob/main/LICENSE
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/jiti/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/jiti/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 3841 }
### Version 4.0.0 (2018-01-28) ### - Added: Support for ES2018. The only change needed was recognizing the `s` regex flag. - Changed: _All_ tokens returned by the `matchToToken` function now have a `closed` property. It is set to `undefined` for the tokens where “closed” doesn’t make sense. This means that all tokens objects have the same shape, which might improve performance. These are the breaking changes: - `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but `['/a/s']`. (There are of course other variations of this.) - Code that rely on some token objects not having the `closed` property could now behave differently. ### Version 3.0.2 (2017-06-28) ### - No code changes. Just updates to the readme. ### Version 3.0.1 (2017-01-30) ### - Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched correctly. ### Version 3.0.0 (2017-01-11) ### This release contains one breaking change, that should [improve performance in V8][v8-perf]: > So how can you, as a JavaScript developer, ensure that your RegExps are fast? > If you are not interested in hooking into RegExp internals, make sure that > neither the RegExp instance, nor its prototype is modified in order to get the > best performance: > > ```js > var re = /./g; > re.exec(''); // Fast path. > re.new_property = 'slow'; > ``` This module used to export a single regex, with `.matchToToken` bolted on, just like in the above example. This release changes the exports of the module to avoid this issue. Before: ```js import jsTokens from "js-tokens" // or: var jsTokens = require("js-tokens") var matchToToken = jsTokens.matchToToken ``` After: ```js import jsTokens, {matchToToken} from "js-tokens" // or: var jsTokens = require("js-tokens").default var matchToToken = require("js-tokens").matchToToken ``` [v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html ### Version 2.0.0 (2016-06-19) ### - Added: Support for ES2016. In other words, support for the `**` exponentiation operator. These are the breaking changes: - `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`. - `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`. ### Version 1.0.3 (2016-03-27) ### - Improved: Made the regex ever so slightly smaller. - Updated: The readme. ### Version 1.0.2 (2015-10-18) ### - Improved: Limited npm package contents for a smaller download. Thanks to @zertosh! ### Version 1.0.1 (2015-06-20) ### - Fixed: Declared an undeclared variable. ### Version 1.0.0 (2015-02-26) ### - Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That type is now equivalent to the Punctuator token in the ECMAScript specification. (Backwards-incompatible change.) - Fixed: A `-` followed by a number is now correctly matched as a punctuator followed by a number. It used to be matched as just a number, but there is no such thing as negative number literals. (Possibly backwards-incompatible change.) ### Version 0.4.1 (2015-02-21) ### - Added: Support for the regex `u` flag. ### Version 0.4.0 (2015-02-21) ### - Improved: `jsTokens.matchToToken` performance. - Added: Support for octal and binary number literals. - Added: Support for template strings. ### Version 0.3.1 (2015-01-06) ### - Fixed: Support for unicode spaces. They used to be allowed in names (which is very confusing), and some unicode newlines were wrongly allowed in strings and regexes. ### Version 0.3.0 (2014-12-19) ### - Changed: The `jsTokens.names` array has been replaced with the `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no longer part of the public API; instead use said function. See this [gist] for an example. (Backwards-incompatible change.) - Changed: The empty string is now considered an “invalid” token, instead an “empty” token (its own group). (Backwards-incompatible change.) - Removed: component support. (Backwards-incompatible change.) [gist]: https://gist.github.com/lydell/be49dbf80c382c473004 ### Version 0.2.0 (2014-06-19) ### - Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own category (“functionArrow”), for simplicity. (Backwards-incompatible change.) - Added: ES6 splats (`...`) are now matched as an operator (instead of three punctuations). (Backwards-incompatible change.) ### Version 0.1.0 (2014-03-08) ### - Initial release.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/js-tokens/CHANGELOG.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/js-tokens/CHANGELOG.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 4462 }
Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens) ======== A regex that tokenizes JavaScript. ```js var jsTokens = require("js-tokens").default var jsString = "var foo=opts.foo;\n..." jsString.match(jsTokens) // ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...] ``` Installation ============ `npm install js-tokens` ```js import jsTokens from "js-tokens" // or: var jsTokens = require("js-tokens").default ``` Usage ===== ### `jsTokens` ### A regex with the `g` flag that matches JavaScript tokens. The regex _always_ matches, even invalid JavaScript and the empty string. The next match is always directly after the previous. ### `var token = matchToToken(match)` ### ```js import {matchToToken} from "js-tokens" // or: var matchToToken = require("js-tokens").matchToToken ``` Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type: String, value: String}` object. The following types are available: - string - comment - regex - number - name - punctuator - whitespace - invalid Multi-line comments and strings also have a `closed` property indicating if the token was closed or not (see below). Comments and strings both come in several flavors. To distinguish them, check if the token starts with `//`, `/*`, `'`, `"` or `` ` ``. Names are ECMAScript IdentifierNames, that is, including both identifiers and keywords. You may use [is-keyword-js] to tell them apart. Whitespace includes both line terminators and other whitespace. [is-keyword-js]: https://github.com/crissdev/is-keyword-js ECMAScript support ================== The intention is to always support the latest ECMAScript version whose feature set has been finalized. If adding support for a newer version requires changes, a new version with a major verion bump will be released. Currently, ECMAScript 2018 is supported. Invalid code handling ===================== Unterminated strings are still matched as strings. JavaScript strings cannot contain (unescaped) newlines, so unterminated strings simply end at the end of the line. Unterminated template strings can contain unescaped newlines, though, so they go on to the end of input. Unterminated multi-line comments are also still matched as comments. They simply go on to the end of the input. Unterminated regex literals are likely matched as division and whatever is inside the regex. Invalid ASCII characters have their own capturing group. Invalid non-ASCII characters are treated as names, to simplify the matching of names (except unicode spaces which are treated as whitespace). Note: See also the [ES2018](#es2018) section. Regex literals may contain invalid regex syntax. They are still matched as regex literals. They may also contain repeated regex flags, to keep the regex simple. Strings may contain invalid escape sequences. Limitations =========== Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be perfect. But that’s not the point either. You may compare jsTokens with [esprima] by using `esprima-compare.js`. See `npm run esprima-compare`! [esprima]: http://esprima.org/ ### Template string interpolation ### Template strings are matched as single tokens, from the starting `` ` `` to the ending `` ` ``, including interpolations (whose tokens are not matched individually). Matching template string interpolations requires recursive balancing of `{` and `}`—something that JavaScript regexes cannot do. Only one level of nesting is supported. ### Division and regex literals collision ### Consider this example: ```js var g = 9.82 var number = bar / 2/g var regex = / 2/g ``` A human can easily understand that in the `number` line we’re dealing with division, and in the `regex` line we’re dealing with a regex literal. How come? Because humans can look at the whole code to put the `/` characters in context. A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also look backwards. See the [ES2018](#es2018) section). When the `jsTokens` regex scans throught the above, it will see the following at the end of both the `number` and `regex` rows: ```js / 2/g ``` It is then impossible to know if that is a regex literal, or part of an expression dealing with division. Here is a similar case: ```js foo /= 2/g foo(/= 2/g) ``` The first line divides the `foo` variable with `2/g`. The second line calls the `foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only sees forwards, it cannot tell the two cases apart. There are some cases where we _can_ tell division and regex literals apart, though. First off, we have the simple cases where there’s only one slash in the line: ```js var foo = 2/g foo /= 2 ``` Regex literals cannot contain newlines, so the above cases are correctly identified as division. Things are only problematic when there are more than one non-comment slash in a single line. Secondly, not every character is a valid regex flag. ```js var number = bar / 2/e ``` The above example is also correctly identified as division, because `e` is not a valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*` (any letter) as flags, but it is not worth it since it increases the amount of ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are allowed. This means that the above example will be identified as division as long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6 characters long. Lastly, we can look _forward_ for information. - If the token following what looks like a regex literal is not valid after a regex literal, but is valid in a division expression, then the regex literal is treated as division instead. For example, a flagless regex cannot be followed by a string, number or name, but all of those three can be the denominator of a division. - Generally, if what looks like a regex literal is followed by an operator, the regex literal is treated as division instead. This is because regexes are seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division could likely be part of such an expression. Please consult the regex source and the test cases for precise information on when regex or division is matched (should you need to know). In short, you could sum it up as: If the end of a statement looks like a regex literal (even if it isn’t), it will be treated as one. Otherwise it should work as expected (if you write sane code). ### ES2018 ### ES2018 added some nice regex improvements to the language. - [Unicode property escapes] should allow telling names and invalid non-ASCII characters apart without blowing up the regex size. - [Lookbehind assertions] should allow matching telling division and regex literals apart in more cases. - [Named capture groups] might simplify some things. These things would be nice to do, but are not critical. They probably have to wait until the oldest maintained Node.js LTS release supports those features. [Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html [Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html [Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html License ======= [MIT](LICENSE).
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/js-tokens/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/js-tokens/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 7367 }
# jsesc [![Build status](https://travis-ci.org/mathiasbynens/jsesc.svg?branch=master)](https://travis-ci.org/mathiasbynens/jsesc) [![Code coverage status](https://coveralls.io/repos/mathiasbynens/jsesc/badge.svg)](https://coveralls.io/r/mathiasbynens/jsesc) Given some data, _jsesc_ returns a stringified representation of that data. jsesc is similar to `JSON.stringify()` except: 1. it outputs JavaScript instead of JSON [by default](#json), enabling support for data structures like ES6 maps and sets; 2. it offers [many options](#api) to customize the output; 3. its output is ASCII-safe [by default](#minimal), thanks to its use of [escape sequences](https://mathiasbynens.be/notes/javascript-escapes) where needed. For any input, jsesc generates the shortest possible valid printable-ASCII-only output. [Here’s an online demo.](https://mothereff.in/js-escapes) jsesc’s output can be used instead of `JSON.stringify`’s to avoid [mojibake](https://en.wikipedia.org/wiki/Mojibake) and other encoding issues, or even to [avoid errors](https://twitter.com/annevk/status/380000829643571200) when passing JSON-formatted data (which may contain U+2028 LINE SEPARATOR, U+2029 PARAGRAPH SEPARATOR, or [lone surrogates](https://esdiscuss.org/topic/code-points-vs-unicode-scalar-values#content-14)) to a JavaScript parser or an UTF-8 encoder. ## Installation Via [npm](https://www.npmjs.com/): ```bash npm install jsesc ``` In [Node.js](https://nodejs.org/): ```js const jsesc = require('jsesc'); ``` ## API ### `jsesc(value, options)` This function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in JavaScript strings](https://mathiasbynens.be/notes/javascript-escapes). The first supported value type is strings: ```js jsesc('Ich ♥ Bücher'); // → 'Ich \\u2665 B\\xFCcher' jsesc('foo 𝌆 bar'); // → 'foo \\uD834\\uDF06 bar' ``` Instead of a string, the `value` can also be an array, an object, a map, a set, or a buffer. In such cases, `jsesc` returns a stringified version of the value where any characters that are not printable ASCII symbols are escaped in the same way. ```js // Escaping an array jsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ]); // → '[\'Ich \\u2665 B\\xFCcher\',\'foo \\uD834\\uDF06 bar\']' // Escaping an object jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }); // → '{\'Ich \\u2665 B\\xFCcher\':\'foo \\uD834\\uDF06 bar\'}' ``` The optional `options` argument accepts an object with the following options: #### `quotes` The default value for the `quotes` option is `'single'`. This means that any occurrences of `'` in the input string are escaped as `\'`, so that the output can be used in a string literal wrapped in single quotes. ```js jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.'); // → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', { 'quotes': 'single' }); // → '`Lorem` ipsum "dolor" sit \\\'amet\\\' etc.' // → "`Lorem` ipsum \"dolor\" sit \\'amet\\' etc." ``` If you want to use the output as part of a string literal wrapped in double quotes, set the `quotes` option to `'double'`. ```js jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', { 'quotes': 'double' }); // → '`Lorem` ipsum \\"dolor\\" sit \'amet\' etc.' // → "`Lorem` ipsum \\\"dolor\\\" sit 'amet' etc." ``` If you want to use the output as part of a template literal (i.e. wrapped in backticks), set the `quotes` option to `'backtick'`. ```js jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', { 'quotes': 'backtick' }); // → '\\`Lorem\\` ipsum "dolor" sit \'amet\' etc.' // → "\\`Lorem\\` ipsum \"dolor\" sit 'amet' etc." // → `\\\`Lorem\\\` ipsum "dolor" sit 'amet' etc.` ``` This setting also affects the output for arrays and objects: ```js jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, { 'quotes': 'double' }); // → '{"Ich \\u2665 B\\xFCcher":"foo \\uD834\\uDF06 bar"}' jsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], { 'quotes': 'double' }); // → '["Ich \\u2665 B\\xFCcher","foo \\uD834\\uDF06 bar"]' ``` #### `numbers` The default value for the `numbers` option is `'decimal'`. This means that any numeric values are represented using decimal integer literals. Other valid options are `binary`, `octal`, and `hexadecimal`, which result in binary integer literals, octal integer literals, and hexadecimal integer literals, respectively. ```js jsesc(42, { 'numbers': 'binary' }); // → '0b101010' jsesc(42, { 'numbers': 'octal' }); // → '0o52' jsesc(42, { 'numbers': 'decimal' }); // → '42' jsesc(42, { 'numbers': 'hexadecimal' }); // → '0x2A' ``` #### `wrap` The `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting. ```js jsesc('Lorem ipsum "dolor" sit \'amet\' etc.', { 'quotes': 'single', 'wrap': true }); // → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\'' // → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'" jsesc('Lorem ipsum "dolor" sit \'amet\' etc.', { 'quotes': 'double', 'wrap': true }); // → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."' // → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\"" ``` #### `es6` The `es6` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, any astral Unicode symbols in the input are escaped using [ECMAScript 6 Unicode code point escape sequences](https://mathiasbynens.be/notes/javascript-escapes#unicode-code-point) instead of using separate escape sequences for each surrogate half. If backwards compatibility with ES5 environments is a concern, don’t enable this setting. If the `json` setting is enabled, the value for the `es6` setting is ignored (as if it was `false`). ```js // By default, the `es6` option is disabled: jsesc('foo 𝌆 bar 💩 baz'); // → 'foo \\uD834\\uDF06 bar \\uD83D\\uDCA9 baz' // To explicitly disable it: jsesc('foo 𝌆 bar 💩 baz', { 'es6': false }); // → 'foo \\uD834\\uDF06 bar \\uD83D\\uDCA9 baz' // To enable it: jsesc('foo 𝌆 bar 💩 baz', { 'es6': true }); // → 'foo \\u{1D306} bar \\u{1F4A9} baz' ``` #### `escapeEverything` The `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output are escaped — even printable ASCII symbols. ```js jsesc('lolwat"foo\'bar', { 'escapeEverything': true }); // → '\\x6C\\x6F\\x6C\\x77\\x61\\x74\\"\\x66\\x6F\\x6F\\\'\\x62\\x61\\x72' // → "\\x6C\\x6F\\x6C\\x77\\x61\\x74\\\"\\x66\\x6F\\x6F\\'\\x62\\x61\\x72" ``` This setting also affects the output for string literals within arrays and objects. #### `minimal` The `minimal` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, only a limited set of symbols in the output are escaped: * U+0000 `\0` * U+0008 `\b` * U+0009 `\t` * U+000A `\n` * U+000C `\f` * U+000D `\r` * U+005C `\\` * U+2028 `\u2028` * U+2029 `\u2029` * whatever symbol is being used for wrapping string literals (based on [the `quotes` option](#quotes)) * [lone surrogates](https://esdiscuss.org/topic/code-points-vs-unicode-scalar-values#content-14) Note: with this option enabled, jsesc output is no longer guaranteed to be ASCII-safe. ```js jsesc('foo\u2029bar\nbaz©qux𝌆flops', { 'minimal': false }); // → 'foo\\u2029bar\\nbaz©qux𝌆flops' ``` #### `isScriptContext` The `isScriptContext` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, occurrences of [`</script` and `</style`](https://mathiasbynens.be/notes/etago) in the output are escaped as `<\/script` and `<\/style`, and [`<!--`](https://mathiasbynens.be/notes/etago#comment-8) is escaped as `\x3C!--` (or `\u003C!--` when the `json` option is enabled). This setting is useful when jsesc’s output ends up as part of a `<script>` or `<style>` element in an HTML document. ```js jsesc('foo</script>bar', { 'isScriptContext': true }); // → 'foo<\\/script>bar' ``` #### `compact` The `compact` option takes a boolean value (`true` or `false`), and defaults to `true` (enabled). When enabled, the output for arrays and objects is as compact as possible; it’s not formatted nicely. ```js jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, { 'compact': true // this is the default }); // → '{\'Ich \u2665 B\xFCcher\':\'foo \uD834\uDF06 bar\'}' jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, { 'compact': false }); // → '{\n\t\'Ich \u2665 B\xFCcher\': \'foo \uD834\uDF06 bar\'\n}' jsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], { 'compact': false }); // → '[\n\t\'Ich \u2665 B\xFCcher\',\n\t\'foo \uD834\uDF06 bar\'\n]' ``` This setting has no effect on the output for strings. #### `indent` The `indent` option takes a string value, and defaults to `'\t'`. When the `compact` setting is disabled (`false`), the value of the `indent` option is used to format the output for arrays and objects. ```js jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, { 'compact': false, 'indent': '\t' // this is the default }); // → '{\n\t\'Ich \u2665 B\xFCcher\': \'foo \uD834\uDF06 bar\'\n}' jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, { 'compact': false, 'indent': ' ' }); // → '{\n \'Ich \u2665 B\xFCcher\': \'foo \uD834\uDF06 bar\'\n}' jsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], { 'compact': false, 'indent': ' ' }); // → '[\n \'Ich \u2665 B\xFCcher\',\n\ t\'foo \uD834\uDF06 bar\'\n]' ``` This setting has no effect on the output for strings. #### `indentLevel` The `indentLevel` option takes a numeric value, and defaults to `0`. It represents the current indentation level, i.e. the number of times the value of [the `indent` option](#indent) is repeated. ```js jsesc(['a', 'b', 'c'], { 'compact': false, 'indentLevel': 1 }); // → '[\n\t\t\'a\',\n\t\t\'b\',\n\t\t\'c\'\n\t]' jsesc(['a', 'b', 'c'], { 'compact': false, 'indentLevel': 2 }); // → '[\n\t\t\t\'a\',\n\t\t\t\'b\',\n\t\t\t\'c\'\n\t\t]' ``` #### `json` The `json` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output is valid JSON. [Hexadecimal character escape sequences](https://mathiasbynens.be/notes/javascript-escapes#hexadecimal) and [the `\v` or `\0` escape sequences](https://mathiasbynens.be/notes/javascript-escapes#single) are not used. Setting `json: true` implies `quotes: 'double', wrap: true, es6: false`, although these values can still be overridden if needed — but in such cases, the output won’t be valid JSON anymore. ```js jsesc('foo\x00bar\xFF\uFFFDbaz', { 'json': true }); // → '"foo\\u0000bar\\u00FF\\uFFFDbaz"' jsesc({ 'foo\x00bar\xFF\uFFFDbaz': 'foo\x00bar\xFF\uFFFDbaz' }, { 'json': true }); // → '{"foo\\u0000bar\\u00FF\\uFFFDbaz":"foo\\u0000bar\\u00FF\\uFFFDbaz"}' jsesc([ 'foo\x00bar\xFF\uFFFDbaz', 'foo\x00bar\xFF\uFFFDbaz' ], { 'json': true }); // → '["foo\\u0000bar\\u00FF\\uFFFDbaz","foo\\u0000bar\\u00FF\\uFFFDbaz"]' // Values that are acceptable in JSON but aren’t strings, arrays, or object // literals can’t be escaped, so they’ll just be preserved: jsesc([ 'foo\x00bar', [1, '©', { 'foo': true, 'qux': null }], 42 ], { 'json': true }); // → '["foo\\u0000bar",[1,"\\u00A9",{"foo":true,"qux":null}],42]' // Values that aren’t allowed in JSON are run through `JSON.stringify()`: jsesc([ undefined, -Infinity ], { 'json': true }); // → '[null,null]' ``` **Note:** Using this option on objects or arrays that contain non-string values relies on `JSON.stringify()`. For legacy environments like IE ≤ 7, use [a `JSON` polyfill](http://bestiejs.github.io/json3/). #### `lowercaseHex` The `lowercaseHex` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, any alphabetical hexadecimal digits in escape sequences as well as any hexadecimal integer literals (see [the `numbers` option](#numbers)) in the output are in lowercase. ```js jsesc('Ich ♥ Bücher', { 'lowercaseHex': true }); // → 'Ich \\u2665 B\\xfccher' // ^^ jsesc(42, { 'numbers': 'hexadecimal', 'lowercaseHex': true }); // → '0x2a' // ^^ ``` ### `jsesc.version` A string representing the semantic version number. ### Using the `jsesc` binary To use the `jsesc` binary in your shell, simply install jsesc globally using npm: ```bash npm install -g jsesc ``` After that you’re able to escape strings from the command line: ```bash $ jsesc 'föo ♥ bår 𝌆 baz' f\xF6o \u2665 b\xE5r \uD834\uDF06 baz ``` To escape arrays or objects containing string values, use the `-o`/`--object` option: ```bash $ jsesc --object '{ "föo": "♥", "bår": "𝌆 baz" }' {'f\xF6o':'\u2665','b\xE5r':'\uD834\uDF06 baz'} ``` To prettify the output in such cases, use the `-p`/`--pretty` option: ```bash $ jsesc --pretty '{ "föo": "♥", "bår": "𝌆 baz" }' { 'f\xF6o': '\u2665', 'b\xE5r': '\uD834\uDF06 baz' } ``` For valid JSON output, use the `-j`/`--json` option: ```bash $ jsesc --json --pretty '{ "föo": "♥", "bår": "𝌆 baz" }' { "f\u00F6o": "\u2665", "b\u00E5r": "\uD834\uDF06 baz" } ``` Read a local JSON file, escape any non-ASCII symbols, and save the result to a new file: ```bash $ jsesc --json --object < data-raw.json > data-escaped.json ``` Or do the same with an online JSON file: ```bash $ curl -sL "http://git.io/aorKgQ" | jsesc --json --object > data-escaped.json ``` See `jsesc --help` for the full list of options. ## Support As of v3.0.0, jsesc supports Node.js v6+ only. Older versions (up to jsesc v1.3.0) support Chrome 27, Firefox 3, Safari 4, Opera 10, IE 6, Node.js v6.0.0, Narwhal 0.3.2, RingoJS 0.8-0.11, PhantomJS 1.9.0, and Rhino 1.7RC4. **Note:** Using the `json` option on objects or arrays that contain non-string values relies on `JSON.parse()`. For legacy environments like IE ≤ 7, use [a `JSON` polyfill](https://bestiejs.github.io/json3/). ## Author | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | |---| | [Mathias Bynens](https://mathiasbynens.be/) | ## License This library is available under the [MIT](https://mths.be/mit) license.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/jsesc/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/jsesc/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 14220 }
MIT License Copyright (c) 2012-2018 Aseem Kishore, and [others]. 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. [others]: https://github.com/json5/json5/contributors
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/json5/LICENSE.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/json5/LICENSE.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1144 }
# JSON5 – JSON for Humans [![Build Status](https://app.travis-ci.com/json5/json5.svg?branch=main)][Build Status] [![Coverage Status](https://coveralls.io/repos/github/json5/json5/badge.svg)][Coverage Status] JSON5 is an extension to the popular [JSON] file format that aims to be easier to **write and maintain _by hand_ (e.g. for config files)**. It is _not intended_ to be used for machine-to-machine communication. (Keep using JSON or other file formats for that. 🙂) JSON5 was started in 2012, and as of 2022, now gets **[>65M downloads/week](https://www.npmjs.com/package/json5)**, ranks in the **[top 0.1%](https://gist.github.com/anvaka/8e8fa57c7ee1350e3491)** of the most depended-upon packages on npm, and has been adopted by major projects like **[Chromium](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5;drc=5de823b36e68fd99009a29281b17bc3a1d6b329c), [Next.js](https://github.com/vercel/next.js/blob/b88f20c90bf4659b8ad5cb2a27956005eac2c7e8/packages/next/lib/find-config.ts#L43-L46), [Babel](https://babeljs.io/docs/en/config-files#supported-file-extensions), [Retool](https://community.retool.com/t/i-am-attempting-to-append-several-text-fields-to-a-google-sheet-but-receiving-a-json5-invalid-character-error/7626), [WebStorm](https://www.jetbrains.com/help/webstorm/json.html), and [more](https://github.com/json5/json5/wiki/In-the-Wild)**. It's also natively supported on **[Apple platforms](https://developer.apple.com/documentation/foundation/jsondecoder/3766916-allowsjson5)** like **MacOS** and **iOS**. Formally, the **[JSON5 Data Interchange Format](https://spec.json5.org/)** is a superset of JSON (so valid JSON files will always be valid JSON5 files) that expands its syntax to include some productions from [ECMAScript 5.1] (ES5). It's also a strict _subset_ of ES5, so valid JSON5 files will always be valid ES5. This JavaScript library is a reference implementation for JSON5 parsing and serialization, and is directly used in many of the popular projects mentioned above (where e.g. extreme performance isn't necessary), but others have created [many other libraries](https://github.com/json5/json5/wiki/In-the-Wild) across many other platforms. [Build Status]: https://app.travis-ci.com/json5/json5 [Coverage Status]: https://coveralls.io/github/json5/json5 [JSON]: https://tools.ietf.org/html/rfc7159 [ECMAScript 5.1]: https://www.ecma-international.org/ecma-262/5.1/ ## Summary of Features The following ECMAScript 5.1 features, which are not supported in JSON, have been extended to JSON5. ### Objects - Object keys may be an ECMAScript 5.1 _[IdentifierName]_. - Objects may have a single trailing comma. ### Arrays - Arrays may have a single trailing comma. ### Strings - Strings may be single quoted. - Strings may span multiple lines by escaping new line characters. - Strings may include character escapes. ### Numbers - Numbers may be hexadecimal. - Numbers may have a leading or trailing decimal point. - Numbers may be [IEEE 754] positive infinity, negative infinity, and NaN. - Numbers may begin with an explicit plus sign. ### Comments - Single and multi-line comments are allowed. ### White Space - Additional white space characters are allowed. [IdentifierName]: https://www.ecma-international.org/ecma-262/5.1/#sec-7.6 [IEEE 754]: http://ieeexplore.ieee.org/servlet/opac?punumber=4610933 ## Example Kitchen-sink example: ```js { // comments unquoted: 'and you can quote me on that', singleQuotes: 'I can use "double quotes" here', lineBreaks: "Look, Mom! \ No \\n's!", hexadecimal: 0xdecaf, leadingDecimalPoint: .8675309, andTrailing: 8675309., positiveSign: +1, trailingComma: 'in objects', andIn: ['arrays',], "backwardsCompatible": "with JSON", } ``` A more real-world example is [this config file](https://github.com/chromium/chromium/blob/feb3c9f670515edf9a88f185301cbd7794ee3e52/third_party/blink/renderer/platform/runtime_enabled_features.json5) from the Chromium/Blink project. ## Specification For a detailed explanation of the JSON5 format, please read the [official specification](https://json5.github.io/json5-spec/). ## Installation and Usage ### Node.js ```sh npm install json5 ``` #### CommonJS ```js const JSON5 = require('json5') ``` #### Modules ```js import JSON5 from 'json5' ``` ### Browsers #### UMD ```html <!-- This will create a global `JSON5` variable. --> <script src="https://unpkg.com/json5@2/dist/index.min.js"></script> ``` #### Modules ```html <script type="module"> import JSON5 from 'https://unpkg.com/json5@2/dist/index.min.mjs' </script> ``` ## API The JSON5 API is compatible with the [JSON API]. [JSON API]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON ### JSON5.parse() Parses a JSON5 string, constructing the JavaScript value or object described by the string. An optional reviver function can be provided to perform a transformation on the resulting object before it is returned. #### Syntax JSON5.parse(text[, reviver]) #### Parameters - `text`: The string to parse as JSON5. - `reviver`: If a function, this prescribes how the value originally produced by parsing is transformed, before being returned. #### Return value The object corresponding to the given JSON5 text. ### JSON5.stringify() Converts a JavaScript value to a JSON5 string, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. #### Syntax JSON5.stringify(value[, replacer[, space]]) JSON5.stringify(value[, options]) #### Parameters - `value`: The value to convert to a JSON5 string. - `replacer`: A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON5 string. If this value is null or not provided, all properties of the object are included in the resulting JSON5 string. - `space`: A String or Number object that's used to insert white space into the output JSON5 string for readability purposes. If this is a Number, it indicates the number of space characters to use as white space; this number is capped at 10 (if it is greater, the value is just 10). Values less than 1 indicate that no space should be used. If this is a String, the string (or the first 10 characters of the string, if it's longer than that) is used as white space. If this parameter is not provided (or is null), no white space is used. If white space is used, trailing commas will be used in objects and arrays. - `options`: An object with the following properties: - `replacer`: Same as the `replacer` parameter. - `space`: Same as the `space` parameter. - `quote`: A String representing the quote character to use when serializing strings. #### Return value A JSON5 string representing the value. ### Node.js `require()` JSON5 files When using Node.js, you can `require()` JSON5 files by adding the following statement. ```js require('json5/lib/register') ``` Then you can load a JSON5 file with a Node.js `require()` statement. For example: ```js const config = require('./config.json5') ``` ## CLI Since JSON is more widely used than JSON5, this package includes a CLI for converting JSON5 to JSON and for validating the syntax of JSON5 documents. ### Installation ```sh npm install --global json5 ``` ### Usage ```sh json5 [options] <file> ``` If `<file>` is not provided, then STDIN is used. #### Options: - `-s`, `--space`: The number of spaces to indent or `t` for tabs - `-o`, `--out-file [file]`: Output to the specified file, otherwise STDOUT - `-v`, `--validate`: Validate JSON5 but do not output JSON - `-V`, `--version`: Output the version number - `-h`, `--help`: Output usage information ## Contributing ### Development ```sh git clone https://github.com/json5/json5 cd json5 npm install ``` When contributing code, please write relevant tests and run `npm test` and `npm run lint` before submitting pull requests. Please use an editor that supports [EditorConfig](http://editorconfig.org/). ### Issues To report bugs or request features regarding the JSON5 **data format**, please submit an issue to the official **[_specification_ repository](https://github.com/json5/json5-spec)**. Note that we will never add any features that make JSON5 incompatible with ES5; that compatibility is a fundamental premise of JSON5. To report bugs or request features regarding this **JavaScript implementation** of JSON5, please submit an issue to **_this_ repository**. ### Security Vulnerabilities and Disclosures To report a security vulnerability, please follow the follow the guidelines described in our [security policy](./SECURITY.md). ## License MIT. See [LICENSE.md](./LICENSE.md) for details. ## Credits [Aseem Kishore](https://github.com/aseemk) founded this project. He wrote a [blog post](https://aseemk.substack.com/p/ignore-the-f-ing-haters-json5) about the journey and lessons learned 10 years in. [Michael Bolin](http://bolinfest.com/) independently arrived at and published some of these same ideas with awesome explanations and detail. Recommended reading: [Suggested Improvements to JSON](http://bolinfest.com/essays/json.html) [Douglas Crockford](http://www.crockford.com/) of course designed and built JSON, but his state machine diagrams on the [JSON website](http://json.org/), as cheesy as it may sound, gave us motivation and confidence that building a new parser to implement these ideas was within reach! The original implementation of JSON5 was also modeled directly off of Doug’s open-source [json_parse.js] parser. We’re grateful for that clean and well-documented code. [json_parse.js]: https://github.com/douglascrockford/JSON-js/blob/03157639c7a7cddd2e9f032537f346f1a87c0f6d/json_parse.js [Max Nanasy](https://github.com/MaxNanasy) has been an early and prolific supporter, contributing multiple patches and ideas. [Andrew Eisenberg](https://github.com/aeisenberg) contributed the original `stringify` method. [Jordan Tucker](https://github.com/jordanbtucker) has aligned JSON5 more closely with ES5, wrote the official JSON5 specification, completely rewrote the codebase from the ground up, and is actively maintaining this project.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/json5/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/json5/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 10409 }
# Lilconfig ⚙️ [![npm version](https://badge.fury.io/js/lilconfig.svg)](https://badge.fury.io/js/lilconfig) [![install size](https://packagephobia.now.sh/badge?p=lilconfig)](https://packagephobia.now.sh/result?p=lilconfig) [![Coverage Status](https://coveralls.io/repos/github/antonk52/lilconfig/badge.svg)](https://coveralls.io/github/antonk52/lilconfig) A zero-dependency alternative to [cosmiconfig](https://www.npmjs.com/package/cosmiconfig) with the same API. ## Installation ```sh npm install lilconfig ``` ## Usage ```js import {lilconfig, lilconfigSync} from 'lilconfig'; // all keys are optional const options = { stopDir: '/Users/you/some/dir', searchPlaces: ['package.json', 'myapp.conf.js'], ignoreEmptySearchPlaces: false } lilconfig( 'myapp', options // optional ).search() // Promise<LilconfigResult> lilconfigSync( 'myapp', options // optional ).load(pathToConfig) // LilconfigResult /** * LilconfigResult * { * config: any; // your config * filepath: string; * } */ ``` ## Difference to `cosmiconfig` Lilconfig does not intend to be 100% compatible with `cosmiconfig` but tries to mimic it where possible. The key differences are: - **no** support for yaml files out of the box(`lilconfig` attempts to parse files with no extension as JSON instead of YAML). You can still add the support for YAML files by providing a loader, see an [example](#yaml-loader) below. - **no** cache ### Options difference between the two. |cosmiconfig option | lilconfig | |------------------------|-----------| |cache | ❌ | |loaders | ✅ | |ignoreEmptySearchPlaces | ✅ | |packageProp | ✅ | |searchPlaces | ✅ | |stopDir | ✅ | |transform | ✅ | ## Loaders examples ### Yaml loader If you need the YAML support you can provide your own loader ```js import {lilconfig} from 'lilconfig'; import yaml from 'yaml'; function loadYaml(filepath, content) { return yaml.parse(content); } const options = { loaders: { '.yaml': loadYaml, '.yml': loadYaml, // loader for files with no extension noExt: loadYaml } }; lilconfig('myapp', options) .search() .then(result => { result // {config, filepath} }); ``` ### ESM loader Lilconfig v2 does not support ESM modules out of the box. However, you can support it with a custom a loader. Note that this will only work with the async `lilconfig` function and won't work with the sync `lilconfigSync`. ```js import {lilconfig} from 'lilconfig'; const loadEsm = filepath => import(filepath); lilconfig('myapp', { loaders: { '.js': loadEsm, '.mjs': loadEsm, } }) .search() .then(result => { result // {config, filepath} result.config.default // if config uses `export default` }); ``` ## Version correlation - lilconig v1 → cosmiconfig v6 - lilconig v2 → cosmiconfig v7
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/lilconfig/readme.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/lilconfig/readme.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 3015 }
# lines-and-columns Maps lines and columns to character offsets and back. This is useful for parsers and other text processors that deal in character ranges but process text with meaningful lines and columns. ## Install ``` $ npm install [--save] lines-and-columns ``` ## Usage ```js import { LinesAndColumns } from 'lines-and-columns' const lines = new LinesAndColumns( `table { border: 0 }` ) lines.locationForIndex(9) // { line: 1, column: 1 } lines.indexForLocation({ line: 1, column: 2 }) // 10 ``` ## License MIT
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/lines-and-columns/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/lines-and-columns/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 532 }
# lodash.castarray v4.4.0 The [lodash](https://lodash.com/) method `_.castArray` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.castarray ``` In Node.js: ```js var castArray = require('lodash.castarray'); ``` See the [documentation](https://lodash.com/docs#castArray) or [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash.castarray) for more details.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/lodash.castarray/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/lodash.castarray/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 473 }
# lodash.isplainobject v4.0.6 The [lodash](https://lodash.com/) method `_.isPlainObject` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.isplainobject ``` In Node.js: ```js var isPlainObject = require('lodash.isplainobject'); ``` See the [documentation](https://lodash.com/docs#isPlainObject) or [package source](https://github.com/lodash/lodash/blob/4.0.6-npm-packages/lodash.isplainobject) for more details.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/lodash.isplainobject/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/lodash.isplainobject/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 501 }
# lodash.merge v4.6.2 The [Lodash](https://lodash.com/) method `_.merge` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.merge ``` In Node.js: ```js var merge = require('lodash.merge'); ``` See the [documentation](https://lodash.com/docs#merge) or [package source](https://github.com/lodash/lodash/blob/4.6.2-npm-packages/lodash.merge) for more details.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/lodash.merge/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/lodash.merge/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 445 }
# lodash v4.17.21 The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. ## Installation Using npm: ```shell $ npm i -g npm $ npm i --save lodash ``` In Node.js: ```js // Load the full build. var _ = require('lodash'); // Load the core build. var _ = require('lodash/core'); // Load the FP build for immutable auto-curried iteratee-first data-last methods. var fp = require('lodash/fp'); // Load method categories. var array = require('lodash/array'); var object = require('lodash/fp/object'); // Cherry-pick methods for smaller browserify/rollup/webpack bundles. var at = require('lodash/at'); var curryN = require('lodash/fp/curryN'); ``` See the [package source](https://github.com/lodash/lodash/tree/4.17.21-npm) for more details. **Note:**<br> Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL. ## Support Tested in Chrome 74-75, Firefox 66-67, IE 11, Edge 18, Safari 11-12, & Node.js 8-12.<br> Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/lodash/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/lodash/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1106 }
npm run build npm run doc npm i git clone --depth=10 --branch=master [email protected]:lodash-archive/lodash-cli.git ./node_modules/lodash-cli mkdir -p ./node_modules/lodash-cli/node_modules/lodash; cd $_; cp ../../../../lodash.js ./lodash.js; cp ../../../../package.json ./package.json cd ../../; npm i --production; cd ../../ node ./node_modules/lodash-cli/bin/lodash core exports=node -o ./npm-package/core.js node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./npm-package cp lodash.js npm-package/lodash.js cp dist/lodash.min.js npm-package/lodash.min.js cp LICENSE npm-package/LICENSE 1. Clone two repos Bump lodash version in package.json, readme, package=locak, lodash.js npm run build npm run doc 2. update mappings in ldoash-cli 3. copy ldoash into lodash-cli node modules and package json. node ./node_modules/lodash-cli/bin/lodash core exports=node -o ./npm-package/core.js node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./npm-package 1. Clone the two repositories: ```sh $ git clone https://github.com/lodash/lodash.git $ git clone https://github.com/bnjmnt4n/lodash-cli.git ``` 2. Update lodash-cli to accomdate changes in lodash source. This can typically involve adding new function dependency mappings in lib/mappings.js. Sometimes, additional changes might be needed for more involved functions. 3. In the lodash repository, update references to the lodash version in README.md, lodash.js, package.jsona nd package-lock.json 4. Run: ```sh npm run build npm run doc node ../lodash-cli/bin/lodash core -o ./dist/lodash.core.js ``` 5. Add a commit and tag the release mkdir ../lodash-temp cp lodash.js dist/lodash.min.js dist/lodash.core.js dist/lodash.core.min.js ../lodash-temp/ node ../lodash-cli/bin/lodash modularize exports=node -o . cp ../lodash-temp/lodash.core.js core.js cp ../lodash-temp/lodash.core.min.js core.min.js cp ../lodash-temp/lodash.js lodash.js cp ../lodash-temp/lodash.min.js lodash.min.js ❯ node ../lodash-cli/bin/lodash modularize exports=es -o .
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/lodash/release.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/lodash/release.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2032 }
# loose-envify [![Build Status](https://travis-ci.org/zertosh/loose-envify.svg?branch=master)](https://travis-ci.org/zertosh/loose-envify) Fast (and loose) selective `process.env` replacer using [js-tokens](https://github.com/lydell/js-tokens) instead of an AST. Works just like [envify](https://github.com/hughsk/envify) but much faster. ## Gotchas * Doesn't handle broken syntax. * Doesn't look inside embedded expressions in template strings. - **this won't work:** ```js console.log(`the current env is ${process.env.NODE_ENV}`); ``` * Doesn't replace oddly-spaced or oddly-commented expressions. - **this won't work:** ```js console.log(process./*won't*/env./*work*/NODE_ENV); ``` ## Usage/Options loose-envify has the exact same interface as [envify](https://github.com/hughsk/envify), including the CLI. ## Benchmark ``` envify: $ for i in {1..5}; do node bench/bench.js 'envify'; done 708ms 727ms 791ms 719ms 720ms loose-envify: $ for i in {1..5}; do node bench/bench.js '../'; done 51ms 52ms 52ms 52ms 52ms ```
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/loose-envify/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/loose-envify/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1070 }
# lru cache A cache object that deletes the least-recently-used items. [![Build Status](https://travis-ci.org/isaacs/node-lru-cache.svg?branch=master)](https://travis-ci.org/isaacs/node-lru-cache) [![Coverage Status](https://coveralls.io/repos/isaacs/node-lru-cache/badge.svg?service=github)](https://coveralls.io/github/isaacs/node-lru-cache) ## Installation: ```javascript npm install lru-cache --save ``` ## Usage: ```javascript var LRU = require("lru-cache") , options = { max: 500 , length: function (n, key) { return n * 2 + key.length } , dispose: function (key, n) { n.close() } , maxAge: 1000 * 60 * 60 } , cache = new LRU(options) , otherCache = new LRU(50) // sets just the max size cache.set("key", "value") cache.get("key") // "value" // non-string keys ARE fully supported // but note that it must be THE SAME object, not // just a JSON-equivalent object. var someObject = { a: 1 } cache.set(someObject, 'a value') // Object keys are not toString()-ed cache.set('[object Object]', 'a different value') assert.equal(cache.get(someObject), 'a value') // A similar object with same keys/values won't work, // because it's a different object identity assert.equal(cache.get({ a: 1 }), undefined) cache.reset() // empty the cache ``` If you put more stuff in it, then items will fall out. If you try to put an oversized thing in it, then it'll fall out right away. ## Options * `max` The maximum size of the cache, checked by applying the length function to all values in the cache. Not setting this is kind of silly, since that's the whole purpose of this lib, but it defaults to `Infinity`. Setting it to a non-number or negative number will throw a `TypeError`. Setting it to 0 makes it be `Infinity`. * `maxAge` Maximum age in ms. Items are not pro-actively pruned out as they age, but if you try to get an item that is too old, it'll drop it and return undefined instead of giving it to you. Setting this to a negative value will make everything seem old! Setting it to a non-number will throw a `TypeError`. * `length` Function that is used to calculate the length of stored items. If you're storing strings or buffers, then you probably want to do something like `function(n, key){return n.length}`. The default is `function(){return 1}`, which is fine if you want to store `max` like-sized things. The item is passed as the first argument, and the key is passed as the second argumnet. * `dispose` Function that is called on items when they are dropped from the cache. This can be handy if you want to close file descriptors or do other cleanup tasks when items are no longer accessible. Called with `key, value`. It's called *before* actually removing the item from the internal cache, so if you want to immediately put it back in, you'll have to do that in a `nextTick` or `setTimeout` callback or it won't do anything. * `stale` By default, if you set a `maxAge`, it'll only actually pull stale items out of the cache when you `get(key)`. (That is, it's not pre-emptively doing a `setTimeout` or anything.) If you set `stale:true`, it'll return the stale value before deleting it. If you don't set this, then it'll return `undefined` when you try to get a stale entry, as if it had already been deleted. * `noDisposeOnSet` By default, if you set a `dispose()` method, then it'll be called whenever a `set()` operation overwrites an existing key. If you set this option, `dispose()` will only be called when a key falls out of the cache, not when it is overwritten. * `updateAgeOnGet` When using time-expiring entries with `maxAge`, setting this to `true` will make each item's effective time update to the current time whenever it is retrieved from cache, causing it to not expire. (It can still fall out of cache based on recency of use, of course.) ## API * `set(key, value, maxAge)` * `get(key) => value` Both of these will update the "recently used"-ness of the key. They do what you think. `maxAge` is optional and overrides the cache `maxAge` option if provided. If the key is not found, `get()` will return `undefined`. The key and val can be any value. * `peek(key)` Returns the key value (or `undefined` if not found) without updating the "recently used"-ness of the key. (If you find yourself using this a lot, you *might* be using the wrong sort of data structure, but there are some use cases where it's handy.) * `del(key)` Deletes a key out of the cache. * `reset()` Clear the cache entirely, throwing away all values. * `has(key)` Check if a key is in the cache, without updating the recent-ness or deleting it for being stale. * `forEach(function(value,key,cache), [thisp])` Just like `Array.prototype.forEach`. Iterates over all the keys in the cache, in order of recent-ness. (Ie, more recently used items are iterated over first.) * `rforEach(function(value,key,cache), [thisp])` The same as `cache.forEach(...)` but items are iterated over in reverse order. (ie, less recently used items are iterated over first.) * `keys()` Return an array of the keys in the cache. * `values()` Return an array of the values in the cache. * `length` Return total length of objects in cache taking into account `length` options function. * `itemCount` Return total quantity of objects currently in cache. Note, that `stale` (see options) items are returned as part of this item count. * `dump()` Return an array of the cache entries ready for serialization and usage with 'destinationCache.load(arr)`. * `load(cacheEntriesArray)` Loads another cache entries array, obtained with `sourceCache.dump()`, into the cache. The destination cache is reset before loading new entries * `prune()` Manually iterates over the entire cache proactively pruning old entries
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/lru-cache/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/lru-cache/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 5986 }
<p align="center"> <a href="https://github.com/lucide-icons/lucide#gh-light-mode-only"> <img src="https://lucide.dev/lucide-react.svg#gh-light-mode-only" alt="Lucide React - Implementation of the lucide icon library for react applications." width="540"> </a> <a href="https://github.com/lucide-icons/lucide#gh-dark-mode-only"> <img src="https://lucide.dev/package-logos/dark/lucide-react.svg#gh-dark-mode-only" alt="Lucide React - Implementation of the lucide icon library for react applications." width="540"> </a> </p> # Lucide React Implementation of the lucide icon library for react applications. > What is lucide? Read it [here](https://github.com/lucide-icons/lucide#what-is-lucide). ## Installation ```sh yarn add lucide-react ``` or ```sh npm install lucide-react ``` ## Documentation For full documentation, visit [lucide.dev](https://lucide.dev/guide/packages/lucide-react) ## Community Join the [Discord server](https://discord.gg/EH6nSts) to chat with the maintainers and other users. ## License Lucide is licensed under the ISC license. See [LICENSE](https://lucide.dev/license). ## Sponsors <a href="https://vercel.com?utm_source=lucide&utm_campaign=oss"> <img src="https://lucide.dev/vercel.svg" alt="Powered by Vercel" width="200" /> </a> <a href="https://www.digitalocean.com/?refcode=b0877a2caebd&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge"><img src="https://lucide.dev/digitalocean.svg" width="200" alt="DigitalOcean Referral Badge" /></a> ### Awesome backer 🍺 <a href="https://www.scipress.io?utm_source=lucide"><img src="https://lucide.dev/sponsors/scipress.svg" width="180" alt="Scipress sponsor badge" /></a>
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/lucide-react/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/lucide-react/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1700 }
# License information ## Contribution License Agreement If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work. `</legalese>` ## Marked Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/) Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/) 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. ## Markdown Copyright © 2004, John Gruber http://daringfireball.net/ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/marked/LICENSE.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/marked/LICENSE.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2932 }
<a href="https://marked.js.org"> <img width="60px" height="60px" src="https://marked.js.org/img/logo-black.svg" align="right" /> </a> # Marked [![npm](https://badgen.net/npm/v/marked)](https://www.npmjs.com/package/marked) [![install size](https://badgen.net/packagephobia/install/marked)](https://packagephobia.now.sh/result?p=marked) [![downloads](https://badgen.net/npm/dt/marked)](https://www.npmjs.com/package/marked) [![github actions](https://github.com/markedjs/marked/workflows/Tests/badge.svg)](https://github.com/markedjs/marked/actions) [![snyk](https://snyk.io/test/npm/marked/badge.svg)](https://snyk.io/test/npm/marked) - ⚡ built for speed - ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time - ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications - 🌐 works in a browser, on a server, or from a command line interface (CLI) ## Demo Checkout the [demo page](https://marked.js.org/demo/) to see marked in action ⛹️ ## Docs Our [documentation pages](https://marked.js.org) are also rendered using marked 💯 Also read about: * [Options](https://marked.js.org/using_advanced) * [Extensibility](https://marked.js.org/using_pro) ## Compatibility **Node.js:** Only [current and LTS](https://nodejs.org/en/about/releases/) Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time. **Browser:** Not IE11 :) ## Installation **CLI:** ```sh npm install -g marked ``` **In-browser:** ```sh npm install marked ``` ## Usage ### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/using_advanced#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the *output* HTML! 🚨 ``` DOMPurify.sanitize(marked.parse(`<img src="x" onerror="alert('not happening')">`)); ``` **CLI** ``` bash # Example with stdin input $ marked -o hello.html hello world ^D $ cat hello.html <p>hello world</p> ``` ```bash # Print all options $ marked --help ``` **Browser** ```html <!doctype html> <html> <head> <meta charset="utf-8"/> <title>Marked in the browser</title> </head> <body> <div id="content"></div> <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> <script> document.getElementById('content').innerHTML = marked.parse('# Marked in the browser\n\nRendered by **marked**.'); </script> </body> </html> ``` or import esm module ```html <script type="module"> import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js"; document.getElementById('content').innerHTML = marked.parse('# Marked in the browser\n\nRendered by **marked**.'); </script> ``` ## License Copyright (c) 2011-2022, Christopher Jeffrey. (MIT License)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/marked/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/marked/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2949 }
0.3.0 / 2014-09-07 ================== * Support Node.js 0.6 * Throw error when parameter format invalid on parse 0.2.0 / 2014-06-18 ================== * Add `typer.format()` to format media types 0.1.0 / 2014-06-17 ================== * Accept `req` as argument to `parse` * Accept `res` as argument to `parse` * Parse media type with extra LWS between type and first parameter 0.0.0 / 2014-06-13 ================== * Initial implementation
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/media-typer/HISTORY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/media-typer/HISTORY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 460 }
# media-typer [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Node.js Version][node-version-image]][node-version-url] [![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] Simple RFC 6838 media type parser ## Installation ```sh $ npm install media-typer ``` ## API ```js var typer = require('media-typer') ``` ### typer.parse(string) ```js var obj = typer.parse('image/svg+xml; charset=utf-8') ``` Parse a media type string. This will return an object with the following properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): - `type`: The type of the media type (always lower case). Example: `'image'` - `subtype`: The subtype of the media type (always lower case). Example: `'svg'` - `suffix`: The suffix of the media type (always lower case). Example: `'xml'` - `parameters`: An object of the parameters in the media type (name of parameter always lower case). Example: `{charset: 'utf-8'}` ### typer.parse(req) ```js var obj = typer.parse(req) ``` Parse the `content-type` header from the given `req`. Short-cut for `typer.parse(req.headers['content-type'])`. ### typer.parse(res) ```js var obj = typer.parse(res) ``` Parse the `content-type` header set on the given `res`. Short-cut for `typer.parse(res.getHeader('content-type'))`. ### typer.format(obj) ```js var obj = typer.format({type: 'image', subtype: 'svg', suffix: 'xml'}) ``` Format an object into a media type string. This will return a string of the mime type for the given object. For the properties of the object, see the documentation for `typer.parse(string)`. ## License [MIT](LICENSE) [npm-image]: https://img.shields.io/npm/v/media-typer.svg?style=flat [npm-url]: https://npmjs.org/package/media-typer [node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat [node-version-url]: http://nodejs.org/download/ [travis-image]: https://img.shields.io/travis/jshttp/media-typer.svg?style=flat [travis-url]: https://travis-ci.org/jshttp/media-typer [coveralls-image]: https://img.shields.io/coveralls/jshttp/media-typer.svg?style=flat [coveralls-url]: https://coveralls.io/r/jshttp/media-typer [downloads-image]: https://img.shields.io/npm/dm/media-typer.svg?style=flat [downloads-url]: https://npmjs.org/package/media-typer
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/media-typer/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/media-typer/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2370 }
# memorystore [![NPM Version](https://img.shields.io/npm/v/memorystore.svg)](https://www.npmjs.com/package/memorystore) ![node](https://img.shields.io/node/v/memorystore.svg) [![Build Status](https://travis-ci.org/roccomuso/memorystore.svg?branch=master)](https://travis-ci.org/roccomuso/memorystore) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) > express-session full featured `MemoryStore` module without leaks! A session store implementation for Express using [lru-cache](https://github.com/isaacs/node-lru-cache). Because the default `MemoryStore` for [express-session](https://github.com/expressjs/session) will lead to a memory leak due to it haven't a suitable way to make them expire. The sessions are still stored in memory, so they're not shared with other processes or services. ## Setup $ npm install express-session memorystore Pass the `express-session` store into `memorystore` to create a `MemoryStore` constructor. ```javascript const session = require('express-session') const MemoryStore = require('memorystore')(session) app.use(session({ cookie: { maxAge: 86400000 }, store: new MemoryStore({ checkPeriod: 86400000 // prune expired entries every 24h }), resave: false, secret: 'keyboard cat' })) ``` ## Options * `checkPeriod` Define how long MemoryStore will check for expired. The period is in ms. The automatic check is disabled by default! Not setting this is kind of silly, since that's the whole purpose of this lib. * `max` The maximum size of the cache, checked by applying the length function to all values in the cache. It defaults to `Infinity`. * `ttl` Session TTL (expiration) in milliseconds. Defaults to session.maxAge (if set), or one day. This may also be set to a function of the form `(options, sess, sessionID) => number`. * `dispose` Function that is called on sessions when they are dropped from the cache. This can be handy if you want to close file descriptors or do other cleanup tasks when sessions are no longer accessible. Called with `key, value`. It's called *before* actually removing the item from the internal cache, so if you want to immediately put it back in, you'll have to do that in a `nextTick` or `setTimeout` callback or it won't do anything. * `stale` By default, if you set a `maxAge`, it'll only actually pull stale items out of the cache when you `get(key)`. (That is, it's not pre-emptively doing a `setTimeout` or anything.) If you set `stale:true`, it'll return the stale value before deleting it. If you don't set this, then it'll return `undefined` when you try to get a stale entry, as if it had already been deleted. * `noDisposeOnSet` By default, if you set a `dispose()` method, then it'll be called whenever a `set()` operation overwrites an existing key. If you set this option, `dispose()` will only be called when a key falls out of the cache, not when it is overwritten. * `serializer` An object containing `stringify` and `parse` methods compatible with Javascript's `JSON` to override the serializer used. ## Methods `memorystore` implements all the **required**, **recommended** and **optional** methods of the [express-session](https://github.com/expressjs/session#session-store-implementation) store. Plus a few more: - `startInterval()` and `stopInterval()` methods to start/clear the automatic check for expired. - `prune()` that you can use to manually remove only the expired entries from the store. ## Debug To enable debug set the env var `DEBUG=memorystore` # Author Rocco Musolino ([@roccomuso](https://twitter.com/roccomuso)) # License MIT
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/memorystore/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/memorystore/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 3689 }
1.0.1 / 2016-01-17 ================== * perf: enable strict mode 1.0.0 / 2015-03-01 ================== * Add option to only add new descriptors * Add simple argument validation * Add jsdoc to source file 0.0.2 / 2013-12-14 ================== * Move repository to `component` organization 0.0.1 / 2013-10-29 ================== * Initial release
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/merge-descriptors/HISTORY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/merge-descriptors/HISTORY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 362 }
# merge-descriptors [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] Merge objects using descriptors. ```js var thing = { get name() { return 'jon' } } var animal = { } merge(animal, thing) animal.name === 'jon' ``` ## API ### merge(destination, source) Redefines `destination`'s descriptors with `source`'s. The return value is the `destination` object. ### merge(destination, source, false) Defines `source`'s descriptors on `destination` if `destination` does not have a descriptor by the same name. The return value is the `destination` object. ## License [MIT](LICENSE) [npm-image]: https://img.shields.io/npm/v/merge-descriptors.svg [npm-url]: https://npmjs.org/package/merge-descriptors [travis-image]: https://img.shields.io/travis/component/merge-descriptors/master.svg [travis-url]: https://travis-ci.org/component/merge-descriptors [coveralls-image]: https://img.shields.io/coveralls/component/merge-descriptors/master.svg [coveralls-url]: https://coveralls.io/r/component/merge-descriptors?branch=master [downloads-image]: https://img.shields.io/npm/dm/merge-descriptors.svg [downloads-url]: https://npmjs.org/package/merge-descriptors
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/merge-descriptors/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/merge-descriptors/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1304 }
# merge2 Merge multiple streams into one stream in sequence or parallel. [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Downloads][downloads-image]][downloads-url] ## Install Install with [npm](https://npmjs.org/package/merge2) ```sh npm install merge2 ``` ## Usage ```js const gulp = require('gulp') const merge2 = require('merge2') const concat = require('gulp-concat') const minifyHtml = require('gulp-minify-html') const ngtemplate = require('gulp-ngtemplate') gulp.task('app-js', function () { return merge2( gulp.src('static/src/tpl/*.html') .pipe(minifyHtml({empty: true})) .pipe(ngtemplate({ module: 'genTemplates', standalone: true }) ), gulp.src([ 'static/src/js/app.js', 'static/src/js/locale_zh-cn.js', 'static/src/js/router.js', 'static/src/js/tools.js', 'static/src/js/services.js', 'static/src/js/filters.js', 'static/src/js/directives.js', 'static/src/js/controllers.js' ]) ) .pipe(concat('app.js')) .pipe(gulp.dest('static/dist/js/')) }) ``` ```js const stream = merge2([stream1, stream2], stream3, {end: false}) //... stream.add(stream4, stream5) //.. stream.end() ``` ```js // equal to merge2([stream1, stream2], stream3) const stream = merge2() stream.add([stream1, stream2]) stream.add(stream3) ``` ```js // merge order: // 1. merge `stream1`; // 2. merge `stream2` and `stream3` in parallel after `stream1` merged; // 3. merge 'stream4' after `stream2` and `stream3` merged; const stream = merge2(stream1, [stream2, stream3], stream4) // merge order: // 1. merge `stream5` and `stream6` in parallel after `stream4` merged; // 2. merge 'stream7' after `stream5` and `stream6` merged; stream.add([stream5, stream6], stream7) ``` ```js // nest merge // equal to merge2(stream1, stream2, stream6, stream3, [stream4, stream5]); const streamA = merge2(stream1, stream2) const streamB = merge2(stream3, [stream4, stream5]) const stream = merge2(streamA, streamB) streamA.add(stream6) ``` ## API ```js const merge2 = require('merge2') ``` ### merge2() ### merge2(options) ### merge2(stream1, stream2, ..., streamN) ### merge2(stream1, stream2, ..., streamN, options) ### merge2(stream1, [stream2, stream3, ...], streamN, options) return a duplex stream (mergedStream). streams in array will be merged in parallel. ### mergedStream.add(stream) ### mergedStream.add(stream1, [stream2, stream3, ...], ...) return the mergedStream. ### mergedStream.on('queueDrain', function() {}) It will emit 'queueDrain' when all streams merged. If you set `end === false` in options, this event give you a notice that should add more streams to merge or end the mergedStream. #### stream *option* Type: `Readable` or `Duplex` or `Transform` stream. #### options *option* Type: `Object`. * **end** - `Boolean` - if `end === false` then mergedStream will not be auto ended, you should end by yourself. **Default:** `undefined` * **pipeError** - `Boolean` - if `pipeError === true` then mergedStream will emit `error` event from source streams. **Default:** `undefined` * **objectMode** - `Boolean` . **Default:** `true` `objectMode` and other options(`highWaterMark`, `defaultEncoding` ...) is same as Node.js `Stream`. ## License MIT © [Teambition](https://www.teambition.com) [npm-url]: https://npmjs.org/package/merge2 [npm-image]: http://img.shields.io/npm/v/merge2.svg [travis-url]: https://travis-ci.org/teambition/merge2 [travis-image]: http://img.shields.io/travis/teambition/merge2.svg [downloads-url]: https://npmjs.org/package/merge2 [downloads-image]: http://img.shields.io/npm/dm/merge2.svg?style=flat-square
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/merge2/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/merge2/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 3742 }
1.1.2 / 2016-01-17 ================== * perf: enable strict mode 1.1.1 / 2014-12-30 ================== * Improve `browserify` support 1.1.0 / 2014-07-05 ================== * Add `CONNECT` method 1.0.1 / 2014-06-02 ================== * Fix module to work with harmony transform 1.0.0 / 2014-05-08 ================== * Add `PURGE` method 0.1.0 / 2013-10-28 ================== * Add `http.METHODS` support
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/methods/HISTORY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/methods/HISTORY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 426 }
# Methods [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Node.js Version][node-version-image]][node-version-url] [![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] HTTP verbs that Node.js core's HTTP parser supports. This module provides an export that is just like `http.METHODS` from Node.js core, with the following differences: * All method names are lower-cased. * Contains a fallback list of methods for Node.js versions that do not have a `http.METHODS` export (0.10 and lower). * Provides the fallback list when using tools like `browserify` without pulling in the `http` shim module. ## Install ```bash $ npm install methods ``` ## API ```js var methods = require('methods') ``` ### methods This is an array of lower-cased method names that Node.js supports. If Node.js provides the `http.METHODS` export, then this is the same array lower-cased, otherwise it is a snapshot of the verbs from Node.js 0.10. ## License [MIT](LICENSE) [npm-image]: https://img.shields.io/npm/v/methods.svg?style=flat [npm-url]: https://npmjs.org/package/methods [node-version-image]: https://img.shields.io/node/v/methods.svg?style=flat [node-version-url]: https://nodejs.org/en/download/ [travis-image]: https://img.shields.io/travis/jshttp/methods.svg?style=flat [travis-url]: https://travis-ci.org/jshttp/methods [coveralls-image]: https://img.shields.io/coveralls/jshttp/methods.svg?style=flat [coveralls-url]: https://coveralls.io/r/jshttp/methods?branch=master [downloads-image]: https://img.shields.io/npm/dm/methods.svg?style=flat [downloads-url]: https://npmjs.org/package/methods
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/methods/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/methods/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1693 }
# micromatch [![NPM version](https://img.shields.io/npm/v/micromatch.svg?style=flat)](https://www.npmjs.com/package/micromatch) [![NPM monthly downloads](https://img.shields.io/npm/dm/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![NPM total downloads](https://img.shields.io/npm/dt/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![Tests](https://github.com/micromatch/micromatch/actions/workflows/test.yml/badge.svg)](https://github.com/micromatch/micromatch/actions/workflows/test.yml) > Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch. Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. ## Table of Contents <details> <summary><strong>Details</strong></summary> * [Install](#install) - [Sponsors](#sponsors) * [Gold Sponsors](#gold-sponsors) * [Quickstart](#quickstart) * [Why use micromatch?](#why-use-micromatch) + [Matching features](#matching-features) * [Switching to micromatch](#switching-to-micromatch) + [From minimatch](#from-minimatch) + [From multimatch](#from-multimatch) * [API](#api) * [Options](#options) * [Options Examples](#options-examples) + [options.basename](#optionsbasename) + [options.bash](#optionsbash) + [options.expandRange](#optionsexpandrange) + [options.format](#optionsformat) + [options.ignore](#optionsignore) + [options.matchBase](#optionsmatchbase) + [options.noextglob](#optionsnoextglob) + [options.nonegate](#optionsnonegate) + [options.noglobstar](#optionsnoglobstar) + [options.nonull](#optionsnonull) + [options.nullglob](#optionsnullglob) + [options.onIgnore](#optionsonignore) + [options.onMatch](#optionsonmatch) + [options.onResult](#optionsonresult) + [options.posixSlashes](#optionsposixslashes) + [options.unescape](#optionsunescape) * [Extended globbing](#extended-globbing) + [Extglobs](#extglobs) + [Braces](#braces) + [Regex character classes](#regex-character-classes) + [Regex groups](#regex-groups) + [POSIX bracket expressions](#posix-bracket-expressions) * [Notes](#notes) + [Bash 4.3 parity](#bash-43-parity) + [Backslashes](#backslashes) * [Benchmarks](#benchmarks) + [Running benchmarks](#running-benchmarks) + [Latest results](#latest-results) * [Contributing](#contributing) * [About](#about) </details> ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save micromatch ``` <br /> # Sponsors [Become a Sponsor](https://github.com/sponsors/jonschlinkert) to add your logo to this README, or any of [my other projects](https://github.com/jonschlinkert?tab=repositories&q=&type=&language=&sort=stargazers) <br /> ## Quickstart ```js const micromatch = require('micromatch'); // micromatch(list, patterns[, options]); ``` The [main export](#micromatch) takes a list of strings and one or more glob patterns: ```js console.log(micromatch(['foo', 'bar', 'baz', 'qux'], ['f*', 'b*'])) //=> ['foo', 'bar', 'baz'] console.log(micromatch(['foo', 'bar', 'baz', 'qux'], ['*', '!b*'])) //=> ['foo', 'qux'] ``` Use [.isMatch()](#ismatch) to for boolean matching: ```js console.log(micromatch.isMatch('foo', 'f*')) //=> true console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true ``` [Switching](#switching-to-micromatch) from minimatch and multimatch is easy! <br> ## Why use micromatch? > micromatch is a [replacement](#switching-to-micromatch) for minimatch and multimatch * Supports all of the same matching features as [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch) * More complete support for the Bash 4.3 specification than minimatch and multimatch. Micromatch passes _all of the spec tests_ from bash, including some that bash still fails. * **Fast & Performant** - Loads in about 5ms and performs [fast matches](#benchmarks). * **Glob matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories * **[Advanced globbing](#extended-globbing)** - Supports [extglobs](#extglobs), [braces](#braces-1), and [POSIX brackets](#posix-bracket-expressions), and support for escaping special characters with `\` or quotes. * **Accurate** - Covers more scenarios [than minimatch](https://github.com/yarnpkg/yarn/pull/3339) * **Well tested** - More than 5,000 [test assertions](./test) * **Windows support** - More reliable windows support than minimatch and multimatch. * **[Safe](https://github.com/micromatch/braces#braces-is-safe)** - Micromatch is not subject to DoS with brace patterns like minimatch and multimatch. ### Matching features * Support for multiple glob patterns (no need for wrappers like multimatch) * Wildcards (`**`, `*.js`) * Negation (`'!a/*.js'`, `'*!(b).js'`) * [extglobs](#extglobs) (`+(x|y)`, `!(a|b)`) * [POSIX character classes](#posix-bracket-expressions) (`[[:alpha:][:digit:]]`) * [brace expansion](https://github.com/micromatch/braces) (`foo/{1..5}.md`, `bar/{a,b,c}.js`) * regex character classes (`foo-[1-5].js`) * regex logical "or" (`foo/(abc|xyz).js`) You can mix and match these features to create whatever patterns you need! ## Switching to micromatch _(There is one notable difference between micromatch and minimatch in regards to how backslashes are handled. See [the notes about backslashes](#backslashes) for more information.)_ ### From minimatch Use [micromatch.isMatch()](#ismatch) instead of `minimatch()`: ```js console.log(micromatch.isMatch('foo', 'b*')); //=> false ``` Use [micromatch.match()](#match) instead of `minimatch.match()`: ```js console.log(micromatch.match(['foo', 'bar'], 'b*')); //=> 'bar' ``` ### From multimatch Same signature: ```js console.log(micromatch(['foo', 'bar', 'baz'], ['f*', '*z'])); //=> ['foo', 'baz'] ``` ## API **Params** * `list` **{String|Array<string>}**: List of strings to match. * `patterns` **{String|Array<string>}**: One or more glob patterns to use for matching. * `options` **{Object}**: See available [options](#options) * `returns` **{Array}**: Returns an array of matches **Example** ```js const mm = require('micromatch'); // mm(list, patterns[, options]); console.log(mm(['a.js', 'a.txt'], ['*.js'])); //=> [ 'a.js' ] ``` ### [.matcher](index.js#L109) Returns a matcher function from the given glob `pattern` and `options`. The returned function takes a string to match as its only argument and returns true if the string is a match. **Params** * `pattern` **{String}**: Glob pattern * `options` **{Object}** * `returns` **{Function}**: Returns a matcher function. **Example** ```js const mm = require('micromatch'); // mm.matcher(pattern[, options]); const isMatch = mm.matcher('*.!(*a)'); console.log(isMatch('a.a')); //=> false console.log(isMatch('a.b')); //=> true ``` ### [.isMatch](index.js#L128) Returns true if **any** of the given glob `patterns` match the specified `string`. **Params** * `str` **{String}**: The string to test. * `patterns` **{String|Array}**: One or more glob patterns to use for matching. * `[options]` **{Object}**: See available [options](#options). * `returns` **{Boolean}**: Returns true if any patterns match `str` **Example** ```js const mm = require('micromatch'); // mm.isMatch(string, patterns[, options]); console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true console.log(mm.isMatch('a.a', 'b.*')); //=> false ``` ### [.not](index.js#L153) Returns a list of strings that _**do not match any**_ of the given `patterns`. **Params** * `list` **{Array}**: Array of strings to match. * `patterns` **{String|Array}**: One or more glob pattern to use for matching. * `options` **{Object}**: See available [options](#options) for changing how matches are performed * `returns` **{Array}**: Returns an array of strings that **do not match** the given patterns. **Example** ```js const mm = require('micromatch'); // mm.not(list, patterns[, options]); console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); //=> ['b.b', 'c.c'] ``` ### [.contains](index.js#L193) Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string. **Params** * `str` **{String}**: The string to match. * `patterns` **{String|Array}**: Glob pattern to use for matching. * `options` **{Object}**: See available [options](#options) for changing how matches are performed * `returns` **{Boolean}**: Returns true if any of the patterns matches any part of `str`. **Example** ```js var mm = require('micromatch'); // mm.contains(string, pattern[, options]); console.log(mm.contains('aa/bb/cc', '*b')); //=> true console.log(mm.contains('aa/bb/cc', '*d')); //=> false ``` ### [.matchKeys](index.js#L235) Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead. **Params** * `object` **{Object}**: The object with keys to filter. * `patterns` **{String|Array}**: One or more glob patterns to use for matching. * `options` **{Object}**: See available [options](#options) for changing how matches are performed * `returns` **{Object}**: Returns an object with only keys that match the given patterns. **Example** ```js const mm = require('micromatch'); // mm.matchKeys(object, patterns[, options]); const obj = { aa: 'a', ab: 'b', ac: 'c' }; console.log(mm.matchKeys(obj, '*b')); //=> { ab: 'b' } ``` ### [.some](index.js#L264) Returns true if some of the strings in the given `list` match any of the given glob `patterns`. **Params** * `list` **{String|Array}**: The string or array of strings to test. Returns as soon as the first match is found. * `patterns` **{String|Array}**: One or more glob patterns to use for matching. * `options` **{Object}**: See available [options](#options) for changing how matches are performed * `returns` **{Boolean}**: Returns true if any `patterns` matches any of the strings in `list` **Example** ```js const mm = require('micromatch'); // mm.some(list, patterns[, options]); console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); // true console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); // false ``` ### [.every](index.js#L300) Returns true if every string in the given `list` matches any of the given glob `patterns`. **Params** * `list` **{String|Array}**: The string or array of strings to test. * `patterns` **{String|Array}**: One or more glob patterns to use for matching. * `options` **{Object}**: See available [options](#options) for changing how matches are performed * `returns` **{Boolean}**: Returns true if all `patterns` matches all of the strings in `list` **Example** ```js const mm = require('micromatch'); // mm.every(list, patterns[, options]); console.log(mm.every('foo.js', ['foo.js'])); // true console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); // true console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); // false console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); // false ``` ### [.all](index.js#L339) Returns true if **all** of the given `patterns` match the specified string. **Params** * `str` **{String|Array}**: The string to test. * `patterns` **{String|Array}**: One or more glob patterns to use for matching. * `options` **{Object}**: See available [options](#options) for changing how matches are performed * `returns` **{Boolean}**: Returns true if any patterns match `str` **Example** ```js const mm = require('micromatch'); // mm.all(string, patterns[, options]); console.log(mm.all('foo.js', ['foo.js'])); // true console.log(mm.all('foo.js', ['*.js', '!foo.js'])); // false console.log(mm.all('foo.js', ['*.js', 'foo.js'])); // true console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); // true ``` ### [.capture](index.js#L366) Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match. **Params** * `glob` **{String}**: Glob pattern to use for matching. * `input` **{String}**: String to match * `options` **{Object}**: See available [options](#options) for changing how matches are performed * `returns` **{Array|null}**: Returns an array of captures if the input matches the glob pattern, otherwise `null`. **Example** ```js const mm = require('micromatch'); // mm.capture(pattern, string[, options]); console.log(mm.capture('test/*.js', 'test/foo.js')); //=> ['foo'] console.log(mm.capture('test/*.js', 'foo/bar.css')); //=> null ``` ### [.makeRe](index.js#L392) Create a regular expression from the given glob `pattern`. **Params** * `pattern` **{String}**: A glob pattern to convert to regex. * `options` **{Object}** * `returns` **{RegExp}**: Returns a regex created from the given pattern. **Example** ```js const mm = require('micromatch'); // mm.makeRe(pattern[, options]); console.log(mm.makeRe('*.js')); //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ ``` ### [.scan](index.js#L408) Scan a glob pattern to separate the pattern into segments. Used by the [split](#split) method. **Params** * `pattern` **{String}** * `options` **{Object}** * `returns` **{Object}**: Returns an object with **Example** ```js const mm = require('micromatch'); const state = mm.scan(pattern[, options]); ``` ### [.parse](index.js#L424) Parse a glob pattern to create the source string for a regular expression. **Params** * `glob` **{String}** * `options` **{Object}** * `returns` **{Object}**: Returns an object with useful properties and output to be used as regex source string. **Example** ```js const mm = require('micromatch'); const state = mm.parse(pattern[, options]); ``` ### [.braces](index.js#L451) Process the given brace `pattern`. **Params** * `pattern` **{String}**: String with brace pattern to process. * `options` **{Object}**: Any [options](#options) to change how expansion is performed. See the [braces](https://github.com/micromatch/braces) library for all available options. * `returns` **{Array}** **Example** ```js const { braces } = require('micromatch'); console.log(braces('foo/{a,b,c}/bar')); //=> [ 'foo/(a|b|c)/bar' ] console.log(braces('foo/{a,b,c}/bar', { expand: true })); //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] ``` ## Options | **Option** | **Type** | **Default value** | **Description** | | --- | --- | --- | --- | | `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. | | `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). | | `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. | | `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). | | `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` | | `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. | | `dot` | `boolean` | `false` | Match dotfiles. Otherwise dotfiles are ignored unless a `.` is explicitly defined in the pattern. | | `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. This option is overridden by the `expandBrace` option. | | `failglob` | `boolean` | `false` | Similar to the `failglob` behavior in Bash, throws an error when no matches are found. Based on the bash option of the same name. | | `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. | | `flags` | `boolean` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. | | [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. | | `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. | | `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. | | `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. | | `lookbehinds` | `boolean` | `true` | Support regex positive and negative lookbehinds. Note that you must be using Node 8.1.10 or higher to enable regex lookbehinds. | | `matchBase` | `boolean` | `false` | Alias for `basename` | | `maxLength` | `boolean` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. | | `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. | | `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. | | `nocase` | `boolean` | `false` | Perform case-insensitive matching. Equivalent to the regex `i` flag. Note that this option is ignored when the `flags` option is defined. | | `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. | | `noext` | `boolean` | `false` | Alias for `noextglob` | | `noextglob` | `boolean` | `false` | Disable support for matching with [extglobs](#extglobs) (like `+(a\|b)`) | | `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) | | `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` | | `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. | | [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. | | [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. | | [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. | | `posix` | `boolean` | `false` | Support [POSIX character classes](#posix-bracket-expressions) ("posix brackets"). | | `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself | | `prepend` | `string` | `undefined` | String to prepend to the generated regex used for matching. | | `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). | | `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. | | `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. | | `unescape` | `boolean` | `undefined` | Remove preceding backslashes from escaped glob characters before creating the regular expression to perform matches. | | `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatitibility. | ## Options Examples ### options.basename Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `matchBase`. **Type**: `Boolean` **Default**: `false` **Example** ```js micromatch(['a/b.js', 'a/c.md'], '*.js'); //=> [] micromatch(['a/b.js', 'a/c.md'], '*.js', { basename: true }); //=> ['a/b.js'] ``` ### options.bash Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. Instead, the star is treated the same as any other star. **Type**: `Boolean` **Default**: `true` **Example** ```js const files = ['abc', 'ajz']; console.log(micromatch(files, '[a-c]*')); //=> ['abc', 'ajz'] console.log(micromatch(files, '[a-c]*', { bash: false })); ``` ### options.expandRange **Type**: `function` **Default**: `undefined` Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need. **Example** The following example shows how to create a glob that matches a numeric folder name between `01` and `25`, with leading zeros. ```js const fill = require('fill-range'); const regex = micromatch.makeRe('foo/{01..25}/bar', { expandRange(a, b) { return `(${fill(a, b, { toRegex: true })})`; } }); console.log(regex) //=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/ console.log(regex.test('foo/00/bar')) // false console.log(regex.test('foo/01/bar')) // true console.log(regex.test('foo/10/bar')) // true console.log(regex.test('foo/22/bar')) // true console.log(regex.test('foo/25/bar')) // true console.log(regex.test('foo/26/bar')) // false ``` ### options.format **Type**: `function` **Default**: `undefined` Custom function for formatting strings before they're matched. **Example** ```js // strip leading './' from strings const format = str => str.replace(/^\.\//, ''); const isMatch = picomatch('foo/*.js', { format }); console.log(isMatch('./foo/bar.js')) //=> true ``` ### options.ignore String or array of glob patterns to match files to ignore. **Type**: `String|Array` **Default**: `undefined` ```js const isMatch = micromatch.matcher('*', { ignore: 'f*' }); console.log(isMatch('foo')) //=> false console.log(isMatch('bar')) //=> true console.log(isMatch('baz')) //=> true ``` ### options.matchBase Alias for [options.basename](#options-basename). ### options.noextglob Disable extglob support, so that [extglobs](#extglobs) are regarded as literal characters. **Type**: `Boolean` **Default**: `undefined` **Examples** ```js console.log(micromatch(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)')); //=> ['a/b', 'a/!(z)'] console.log(micromatch(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)', { noextglob: true })); //=> ['a/!(z)'] (matches only as literal characters) ``` ### options.nonegate Disallow negation (`!`) patterns, and treat leading `!` as a literal character to match. **Type**: `Boolean` **Default**: `undefined` ### options.noglobstar Disable matching with globstars (`**`). **Type**: `Boolean` **Default**: `undefined` ```js micromatch(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**'); //=> ['a/b', 'a/b/c', 'a/b/c/d'] micromatch(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**', {noglobstar: true}); //=> ['a/b'] ``` ### options.nonull Alias for [options.nullglob](#options-nullglob). ### options.nullglob If `true`, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nonull`. **Type**: `Boolean` **Default**: `undefined` ### options.onIgnore ```js const onIgnore = ({ glob, regex, input, output }) => { console.log({ glob, regex, input, output }); // { glob: '*', regex: /^(?:(?!\.)(?=.)[^\/]*?\/?)$/, input: 'foo', output: 'foo' } }; const isMatch = micromatch.matcher('*', { onIgnore, ignore: 'f*' }); isMatch('foo'); isMatch('bar'); isMatch('baz'); ``` ### options.onMatch ```js const onMatch = ({ glob, regex, input, output }) => { console.log({ input, output }); // { input: 'some\\path', output: 'some/path' } // { input: 'some\\path', output: 'some/path' } // { input: 'some\\path', output: 'some/path' } }; const isMatch = micromatch.matcher('**', { onMatch, posixSlashes: true }); isMatch('some\\path'); isMatch('some\\path'); isMatch('some\\path'); ``` ### options.onResult ```js const onResult = ({ glob, regex, input, output }) => { console.log({ glob, regex, input, output }); }; const isMatch = micromatch('*', { onResult, ignore: 'f*' }); isMatch('foo'); isMatch('bar'); isMatch('baz'); ``` ### options.posixSlashes Convert path separators on returned files to posix/unix-style forward slashes. Aliased as `unixify` for backwards compatibility. **Type**: `Boolean` **Default**: `true` on windows, `false` everywhere else. **Example** ```js console.log(micromatch.match(['a\\b\\c'], 'a/**')); //=> ['a/b/c'] console.log(micromatch.match(['a\\b\\c'], { posixSlashes: false })); //=> ['a\\b\\c'] ``` ### options.unescape Remove backslashes from escaped glob characters before creating the regular expression to perform matches. **Type**: `Boolean` **Default**: `undefined` **Example** In this example we want to match a literal `*`: ```js console.log(micromatch.match(['abc', 'a\\*c'], 'a\\*c')); //=> ['a\\*c'] console.log(micromatch.match(['abc', 'a\\*c'], 'a\\*c', { unescape: true })); //=> ['a*c'] ``` <br> <br> ## Extended globbing Micromatch supports the following extended globbing features. ### Extglobs Extended globbing, as described by the bash man page: | **pattern** | **regex equivalent** | **description** | | --- | --- | --- | | `?(pattern)` | `(pattern)?` | Matches zero or one occurrence of the given patterns | | `*(pattern)` | `(pattern)*` | Matches zero or more occurrences of the given patterns | | `+(pattern)` | `(pattern)+` | Matches one or more occurrences of the given patterns | | `@(pattern)` | `(pattern)` <sup>*</sup> | Matches one of the given patterns | | `!(pattern)` | N/A (equivalent regex is much more complicated) | Matches anything except one of the given patterns | <sup><strong>*</strong></sup> Note that `@` isn't a regex character. ### Braces Brace patterns can be used to match specific ranges or sets of characters. **Example** The pattern `{f,b}*/{1..3}/{b,q}*` would match any of following strings: ``` foo/1/bar foo/2/bar foo/3/bar baz/1/qux baz/2/qux baz/3/qux ``` Visit [braces](https://github.com/micromatch/braces) to see the full range of features and options related to brace expansion, or to create brace matching or expansion related issues. ### Regex character classes Given the list: `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: * `[ac].js`: matches both `a` and `c`, returning `['a.js', 'c.js']` * `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']` * `a/[A-Z].js`: matches and uppercase letter, returning `['a/E.md']` Learn about [regex character classes](http://www.regular-expressions.info/charclass.html). ### Regex groups Given `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: * `(a|c).js`: would match either `a` or `c`, returning `['a.js', 'c.js']` * `(b|d).js`: would match either `b` or `d`, returning `['b.js', 'd.js']` * `(b|[A-Z]).js`: would match either `b` or an uppercase letter, returning `['b.js', 'E.js']` As with regex, parens can be nested, so patterns like `((a|b)|c)/b` will work. Although brace expansion might be friendlier to use, depending on preference. ### POSIX bracket expressions POSIX brackets are intended to be more user-friendly than regex character classes. This of course is in the eye of the beholder. **Example** ```js console.log(micromatch.isMatch('a1', '[[:alpha:][:digit:]]')) //=> true console.log(micromatch.isMatch('a1', '[[:alpha:][:alpha:]]')) //=> false ``` *** ## Notes ### Bash 4.3 parity Whenever possible matching behavior is based on behavior Bash 4.3, which is mostly consistent with minimatch. However, it's suprising how many edge cases and rabbit holes there are with glob matching, and since there is no real glob specification, and micromatch is more accurate than both Bash and minimatch, there are cases where best-guesses were made for behavior. In a few cases where Bash had no answers, we used wildmatch (used by git) as a fallback. ### Backslashes There is an important, notable difference between minimatch and micromatch _in regards to how backslashes are handled_ in glob patterns. * Micromatch exclusively and explicitly reserves backslashes for escaping characters in a glob pattern, even on windows, which is consistent with bash behavior. _More importantly, unescaping globs can result in unsafe regular expressions_. * Minimatch converts all backslashes to forward slashes, which means you can't use backslashes to escape any characters in your glob patterns. We made this decision for micromatch for a couple of reasons: * Consistency with bash conventions. * Glob patterns are not filepaths. They are a type of [regular language](https://en.wikipedia.org/wiki/Regular_language) that is converted to a JavaScript regular expression. Thus, when forward slashes are defined in a glob pattern, the resulting regular expression will match windows or POSIX path separators just fine. **A note about joining paths to globs** Note that when you pass something like `path.join('foo', '*')` to micromatch, you are creating a filepath and expecting it to still work as a glob pattern. This causes problems on windows, since the `path.sep` is `\\`. In other words, since `\\` is reserved as an escape character in globs, on windows `path.join('foo', '*')` would result in `foo\\*`, which tells micromatch to match `*` as a literal character. This is the same behavior as bash. To solve this, you might be inspired to do something like `'foo\\*'.replace(/\\/g, '/')`, but this causes another, potentially much more serious, problem. ## Benchmarks ### Running benchmarks Install dependencies for running benchmarks: ```sh $ cd bench && npm install ``` Run the benchmarks: ```sh $ npm run bench ``` ### Latest results As of August 23, 2024 (longer bars are better): ```sh # .makeRe star micromatch x 2,232,802 ops/sec ±2.34% (89 runs sampled)) minimatch x 781,018 ops/sec ±6.74% (92 runs sampled)) # .makeRe star; dot=true micromatch x 1,863,453 ops/sec ±0.74% (93 runs sampled) minimatch x 723,105 ops/sec ±0.75% (93 runs sampled) # .makeRe globstar micromatch x 1,624,179 ops/sec ±2.22% (91 runs sampled) minimatch x 1,117,230 ops/sec ±2.78% (86 runs sampled)) # .makeRe globstars micromatch x 1,658,642 ops/sec ±0.86% (92 runs sampled) minimatch x 741,224 ops/sec ±1.24% (89 runs sampled)) # .makeRe with leading star micromatch x 1,525,014 ops/sec ±1.63% (90 runs sampled) minimatch x 561,074 ops/sec ±3.07% (89 runs sampled) # .makeRe - braces micromatch x 172,478 ops/sec ±2.37% (78 runs sampled) minimatch x 96,087 ops/sec ±2.34% (88 runs sampled))) # .makeRe braces - range (expanded) micromatch x 26,973 ops/sec ±0.84% (89 runs sampled) minimatch x 3,023 ops/sec ±0.99% (90 runs sampled)) # .makeRe braces - range (compiled) micromatch x 152,892 ops/sec ±1.67% (83 runs sampled) minimatch x 992 ops/sec ±3.50% (89 runs sampled)d)) # .makeRe braces - nested ranges (expanded) micromatch x 15,816 ops/sec ±13.05% (80 runs sampled) minimatch x 2,953 ops/sec ±1.64% (91 runs sampled) # .makeRe braces - nested ranges (compiled) micromatch x 110,881 ops/sec ±1.85% (82 runs sampled) minimatch x 1,008 ops/sec ±1.51% (91 runs sampled) # .makeRe braces - set (compiled) micromatch x 134,930 ops/sec ±3.54% (63 runs sampled)) minimatch x 43,242 ops/sec ±0.60% (93 runs sampled) # .makeRe braces - nested sets (compiled) micromatch x 94,455 ops/sec ±1.74% (69 runs sampled)) minimatch x 27,720 ops/sec ±1.84% (93 runs sampled)) ``` ## Contributing All contributions are welcome! Please read [the contributing guide](.github/contributing.md) to get started. **Bug reports** Please create an issue if you encounter a bug or matching behavior that doesn't seem correct. If you find a matching-related issue, please: * [research existing issues first](../../issues) (open and closed) * visit the [GNU Bash documentation](https://www.gnu.org/software/bash/manual/) to see how Bash deals with the pattern * visit the [minimatch](https://github.com/isaacs/minimatch) documentation to cross-check expected behavior in node.js * if all else fails, since there is no real specification for globs we will probably need to discuss expected behavior and decide how to resolve it. which means any detail you can provide to help with this discussion would be greatly appreciated. **Platform issues** It's important to us that micromatch work consistently on all platforms. If you encounter any platform-specific matching or path related issues, please let us know (pull requests are also greatly appreciated). ## About <details> <summary><strong>Contributing</strong></summary> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. </details> <details> <summary><strong>Running Tests</strong></summary> Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: ```sh $ npm install && npm test ``` </details> <details> <summary><strong>Building docs</strong></summary> _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ To generate the readme, run the following command: ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` </details> ### Related projects You might also be interested in these projects: * [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.") * [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/micromatch/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") * [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") * [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") * [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/micromatch/nanomatch) | [homepage](https://github.com/micromatch/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)") ### Contributors | **Commits** | **Contributor** | | --- | --- | | 523 | [jonschlinkert](https://github.com/jonschlinkert) | | 12 | [es128](https://github.com/es128) | | 9 | [danez](https://github.com/danez) | | 8 | [doowb](https://github.com/doowb) | | 6 | [paulmillr](https://github.com/paulmillr) | | 5 | [mrmlnc](https://github.com/mrmlnc) | | 3 | [DrPizza](https://github.com/DrPizza) | | 2 | [Tvrqvoise](https://github.com/Tvrqvoise) | | 2 | [antonyk](https://github.com/antonyk) | | 2 | [MartinKolarik](https://github.com/MartinKolarik) | | 2 | [Glazy](https://github.com/Glazy) | | 2 | [mceIdo](https://github.com/mceIdo) | | 2 | [TrySound](https://github.com/TrySound) | | 1 | [yvele](https://github.com/yvele) | | 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | | 1 | [simlu](https://github.com/simlu) | | 1 | [curbengh](https://github.com/curbengh) | | 1 | [fidian](https://github.com/fidian) | | 1 | [tomByrer](https://github.com/tomByrer) | | 1 | [ZoomerTedJackson](https://github.com/ZoomerTedJackson) | | 1 | [styfle](https://github.com/styfle) | | 1 | [sebdeckers](https://github.com/sebdeckers) | | 1 | [muescha](https://github.com/muescha) | | 1 | [juszczykjakub](https://github.com/juszczykjakub) | | 1 | [joyceerhl](https://github.com/joyceerhl) | | 1 | [donatj](https://github.com/donatj) | | 1 | [frangio](https://github.com/frangio) | | 1 | [UltCombo](https://github.com/UltCombo) | | 1 | [DianeLooney](https://github.com/DianeLooney) | | 1 | [devongovett](https://github.com/devongovett) | | 1 | [Cslove](https://github.com/Cslove) | | 1 | [amilajack](https://github.com/amilajack) | ### Author **Jon Schlinkert** * [GitHub Profile](https://github.com/jonschlinkert) * [Twitter Profile](https://twitter.com/jonschlinkert) * [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) ### License Copyright © 2024, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT License](LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on August 23, 2024._
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/micromatch/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/micromatch/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 38929 }
1.52.0 / 2022-02-21 =================== * Add extensions from IANA for more `image/*` types * Add extension `.asc` to `application/pgp-keys` * Add extensions to various XML types * Add new upstream MIME types 1.51.0 / 2021-11-08 =================== * Add new upstream MIME types * Mark `image/vnd.microsoft.icon` as compressible * Mark `image/vnd.ms-dds` as compressible 1.50.0 / 2021-09-15 =================== * Add deprecated iWorks mime types and extensions * Add new upstream MIME types 1.49.0 / 2021-07-26 =================== * Add extension `.trig` to `application/trig` * Add new upstream MIME types 1.48.0 / 2021-05-30 =================== * Add extension `.mvt` to `application/vnd.mapbox-vector-tile` * Add new upstream MIME types * Mark `text/yaml` as compressible 1.47.0 / 2021-04-01 =================== * Add new upstream MIME types * Remove ambigious extensions from IANA for `application/*+xml` types * Update primary extension to `.es` for `application/ecmascript` 1.46.0 / 2021-02-13 =================== * Add extension `.amr` to `audio/amr` * Add extension `.m4s` to `video/iso.segment` * Add extension `.opus` to `audio/ogg` * Add new upstream MIME types 1.45.0 / 2020-09-22 =================== * Add `application/ubjson` with extension `.ubj` * Add `image/avif` with extension `.avif` * Add `image/ktx2` with extension `.ktx2` * Add extension `.dbf` to `application/vnd.dbf` * Add extension `.rar` to `application/vnd.rar` * Add extension `.td` to `application/urc-targetdesc+xml` * Add new upstream MIME types * Fix extension of `application/vnd.apple.keynote` to be `.key` 1.44.0 / 2020-04-22 =================== * Add charsets from IANA * Add extension `.cjs` to `application/node` * Add new upstream MIME types 1.43.0 / 2020-01-05 =================== * Add `application/x-keepass2` with extension `.kdbx` * Add extension `.mxmf` to `audio/mobile-xmf` * Add extensions from IANA for `application/*+xml` types * Add new upstream MIME types 1.42.0 / 2019-09-25 =================== * Add `image/vnd.ms-dds` with extension `.dds` * Add new upstream MIME types * Remove compressible from `multipart/mixed` 1.41.0 / 2019-08-30 =================== * Add new upstream MIME types * Add `application/toml` with extension `.toml` * Mark `font/ttf` as compressible 1.40.0 / 2019-04-20 =================== * Add extensions from IANA for `model/*` types * Add `text/mdx` with extension `.mdx` 1.39.0 / 2019-04-04 =================== * Add extensions `.siv` and `.sieve` to `application/sieve` * Add new upstream MIME types 1.38.0 / 2019-02-04 =================== * Add extension `.nq` to `application/n-quads` * Add extension `.nt` to `application/n-triples` * Add new upstream MIME types * Mark `text/less` as compressible 1.37.0 / 2018-10-19 =================== * Add extensions to HEIC image types * Add new upstream MIME types 1.36.0 / 2018-08-20 =================== * Add Apple file extensions from IANA * Add extensions from IANA for `image/*` types * Add new upstream MIME types 1.35.0 / 2018-07-15 =================== * Add extension `.owl` to `application/rdf+xml` * Add new upstream MIME types - Removes extension `.woff` from `application/font-woff` 1.34.0 / 2018-06-03 =================== * Add extension `.csl` to `application/vnd.citationstyles.style+xml` * Add extension `.es` to `application/ecmascript` * Add new upstream MIME types * Add `UTF-8` as default charset for `text/turtle` * Mark all XML-derived types as compressible 1.33.0 / 2018-02-15 =================== * Add extensions from IANA for `message/*` types * Add new upstream MIME types * Fix some incorrect OOXML types * Remove `application/font-woff2` 1.32.0 / 2017-11-29 =================== * Add new upstream MIME types * Update `text/hjson` to registered `application/hjson` * Add `text/shex` with extension `.shex` 1.31.0 / 2017-10-25 =================== * Add `application/raml+yaml` with extension `.raml` * Add `application/wasm` with extension `.wasm` * Add new `font` type from IANA * Add new upstream font extensions * Add new upstream MIME types * Add extensions for JPEG-2000 images 1.30.0 / 2017-08-27 =================== * Add `application/vnd.ms-outlook` * Add `application/x-arj` * Add extension `.mjs` to `application/javascript` * Add glTF types and extensions * Add new upstream MIME types * Add `text/x-org` * Add VirtualBox MIME types * Fix `source` records for `video/*` types that are IANA * Update `font/opentype` to registered `font/otf` 1.29.0 / 2017-07-10 =================== * Add `application/fido.trusted-apps+json` * Add extension `.wadl` to `application/vnd.sun.wadl+xml` * Add new upstream MIME types * Add `UTF-8` as default charset for `text/css` 1.28.0 / 2017-05-14 =================== * Add new upstream MIME types * Add extension `.gz` to `application/gzip` * Update extensions `.md` and `.markdown` to be `text/markdown` 1.27.0 / 2017-03-16 =================== * Add new upstream MIME types * Add `image/apng` with extension `.apng` 1.26.0 / 2017-01-14 =================== * Add new upstream MIME types * Add extension `.geojson` to `application/geo+json` 1.25.0 / 2016-11-11 =================== * Add new upstream MIME types 1.24.0 / 2016-09-18 =================== * Add `audio/mp3` * Add new upstream MIME types 1.23.0 / 2016-05-01 =================== * Add new upstream MIME types * Add extension `.3gpp` to `audio/3gpp` 1.22.0 / 2016-02-15 =================== * Add `text/slim` * Add extension `.rng` to `application/xml` * Add new upstream MIME types * Fix extension of `application/dash+xml` to be `.mpd` * Update primary extension to `.m4a` for `audio/mp4` 1.21.0 / 2016-01-06 =================== * Add Google document types * Add new upstream MIME types 1.20.0 / 2015-11-10 =================== * Add `text/x-suse-ymp` * Add new upstream MIME types 1.19.0 / 2015-09-17 =================== * Add `application/vnd.apple.pkpass` * Add new upstream MIME types 1.18.0 / 2015-09-03 =================== * Add new upstream MIME types 1.17.0 / 2015-08-13 =================== * Add `application/x-msdos-program` * Add `audio/g711-0` * Add `image/vnd.mozilla.apng` * Add extension `.exe` to `application/x-msdos-program` 1.16.0 / 2015-07-29 =================== * Add `application/vnd.uri-map` 1.15.0 / 2015-07-13 =================== * Add `application/x-httpd-php` 1.14.0 / 2015-06-25 =================== * Add `application/scim+json` * Add `application/vnd.3gpp.ussd+xml` * Add `application/vnd.biopax.rdf+xml` * Add `text/x-processing` 1.13.0 / 2015-06-07 =================== * Add nginx as a source * Add `application/x-cocoa` * Add `application/x-java-archive-diff` * Add `application/x-makeself` * Add `application/x-perl` * Add `application/x-pilot` * Add `application/x-redhat-package-manager` * Add `application/x-sea` * Add `audio/x-m4a` * Add `audio/x-realaudio` * Add `image/x-jng` * Add `text/mathml` 1.12.0 / 2015-06-05 =================== * Add `application/bdoc` * Add `application/vnd.hyperdrive+json` * Add `application/x-bdoc` * Add extension `.rtf` to `text/rtf` 1.11.0 / 2015-05-31 =================== * Add `audio/wav` * Add `audio/wave` * Add extension `.litcoffee` to `text/coffeescript` * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data` * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install` 1.10.0 / 2015-05-19 =================== * Add `application/vnd.balsamiq.bmpr` * Add `application/vnd.microsoft.portable-executable` * Add `application/x-ns-proxy-autoconfig` 1.9.1 / 2015-04-19 ================== * Remove `.json` extension from `application/manifest+json` - This is causing bugs downstream 1.9.0 / 2015-04-19 ================== * Add `application/manifest+json` * Add `application/vnd.micro+json` * Add `image/vnd.zbrush.pcx` * Add `image/x-ms-bmp` 1.8.0 / 2015-03-13 ================== * Add `application/vnd.citationstyles.style+xml` * Add `application/vnd.fastcopy-disk-image` * Add `application/vnd.gov.sk.xmldatacontainer+xml` * Add extension `.jsonld` to `application/ld+json` 1.7.0 / 2015-02-08 ================== * Add `application/vnd.gerber` * Add `application/vnd.msa-disk-image` 1.6.1 / 2015-02-05 ================== * Community extensions ownership transferred from `node-mime` 1.6.0 / 2015-01-29 ================== * Add `application/jose` * Add `application/jose+json` * Add `application/json-seq` * Add `application/jwk+json` * Add `application/jwk-set+json` * Add `application/jwt` * Add `application/rdap+json` * Add `application/vnd.gov.sk.e-form+xml` * Add `application/vnd.ims.imsccv1p3` 1.5.0 / 2014-12-30 ================== * Add `application/vnd.oracle.resource+json` * Fix various invalid MIME type entries - `application/mbox+xml` - `application/oscp-response` - `application/vwg-multiplexed` - `audio/g721` 1.4.0 / 2014-12-21 ================== * Add `application/vnd.ims.imsccv1p2` * Fix various invalid MIME type entries - `application/vnd-acucobol` - `application/vnd-curl` - `application/vnd-dart` - `application/vnd-dxr` - `application/vnd-fdf` - `application/vnd-mif` - `application/vnd-sema` - `application/vnd-wap-wmlc` - `application/vnd.adobe.flash-movie` - `application/vnd.dece-zip` - `application/vnd.dvb_service` - `application/vnd.micrografx-igx` - `application/vnd.sealed-doc` - `application/vnd.sealed-eml` - `application/vnd.sealed-mht` - `application/vnd.sealed-ppt` - `application/vnd.sealed-tiff` - `application/vnd.sealed-xls` - `application/vnd.sealedmedia.softseal-html` - `application/vnd.sealedmedia.softseal-pdf` - `application/vnd.wap-slc` - `application/vnd.wap-wbxml` - `audio/vnd.sealedmedia.softseal-mpeg` - `image/vnd-djvu` - `image/vnd-svf` - `image/vnd-wap-wbmp` - `image/vnd.sealed-png` - `image/vnd.sealedmedia.softseal-gif` - `image/vnd.sealedmedia.softseal-jpg` - `model/vnd-dwf` - `model/vnd.parasolid.transmit-binary` - `model/vnd.parasolid.transmit-text` - `text/vnd-a` - `text/vnd-curl` - `text/vnd.wap-wml` * Remove example template MIME types - `application/example` - `audio/example` - `image/example` - `message/example` - `model/example` - `multipart/example` - `text/example` - `video/example` 1.3.1 / 2014-12-16 ================== * Fix missing extensions - `application/json5` - `text/hjson` 1.3.0 / 2014-12-07 ================== * Add `application/a2l` * Add `application/aml` * Add `application/atfx` * Add `application/atxml` * Add `application/cdfx+xml` * Add `application/dii` * Add `application/json5` * Add `application/lxf` * Add `application/mf4` * Add `application/vnd.apache.thrift.compact` * Add `application/vnd.apache.thrift.json` * Add `application/vnd.coffeescript` * Add `application/vnd.enphase.envoy` * Add `application/vnd.ims.imsccv1p1` * Add `text/csv-schema` * Add `text/hjson` * Add `text/markdown` * Add `text/yaml` 1.2.0 / 2014-11-09 ================== * Add `application/cea` * Add `application/dit` * Add `application/vnd.gov.sk.e-form+zip` * Add `application/vnd.tmd.mediaflex.api+xml` * Type `application/epub+zip` is now IANA-registered 1.1.2 / 2014-10-23 ================== * Rebuild database for `application/x-www-form-urlencoded` change 1.1.1 / 2014-10-20 ================== * Mark `application/x-www-form-urlencoded` as compressible. 1.1.0 / 2014-09-28 ================== * Add `application/font-woff2` 1.0.3 / 2014-09-25 ================== * Fix engine requirement in package 1.0.2 / 2014-09-25 ================== * Add `application/coap-group+json` * Add `application/dcd` * Add `application/vnd.apache.thrift.binary` * Add `image/vnd.tencent.tap` * Mark all JSON-derived types as compressible * Update `text/vtt` data 1.0.1 / 2014-08-30 ================== * Fix extension ordering 1.0.0 / 2014-08-30 ================== * Add `application/atf` * Add `application/merge-patch+json` * Add `multipart/x-mixed-replace` * Add `source: 'apache'` metadata * Add `source: 'iana'` metadata * Remove badly-assumed charset data
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/mime-db/HISTORY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/mime-db/HISTORY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 12580 }
# mime-db [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-image]][node-url] [![Build Status][ci-image]][ci-url] [![Coverage Status][coveralls-image]][coveralls-url] This is a large database of mime types and information about them. It consists of a single, public JSON file and does not include any logic, allowing it to remain as un-opinionated as possible with an API. It aggregates data from the following sources: - http://www.iana.org/assignments/media-types/media-types.xhtml - http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types - http://hg.nginx.org/nginx/raw-file/default/conf/mime.types ## Installation ```bash npm install mime-db ``` ### Database Download If you're crazy enough to use this in the browser, you can just grab the JSON file using [jsDelivr](https://www.jsdelivr.com/). It is recommended to replace `master` with [a release tag](https://github.com/jshttp/mime-db/tags) as the JSON format may change in the future. ``` https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json ``` ## Usage ```js var db = require('mime-db') // grab data on .js files var data = db['application/javascript'] ``` ## Data Structure The JSON file is a map lookup for lowercased mime types. Each mime type has the following properties: - `.source` - where the mime type is defined. If not set, it's probably a custom media type. - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types) - `.extensions[]` - known extensions associated with this mime type. - `.compressible` - whether a file of this type can be gzipped. - `.charset` - the default charset associated with this type, if any. If unknown, every property could be `undefined`. ## Contributing To edit the database, only make PRs against `src/custom-types.json` or `src/custom-suffix.json`. The `src/custom-types.json` file is a JSON object with the MIME type as the keys and the values being an object with the following keys: - `compressible` - leave out if you don't know, otherwise `true`/`false` to indicate whether the data represented by the type is typically compressible. - `extensions` - include an array of file extensions that are associated with the type. - `notes` - human-readable notes about the type, typically what the type is. - `sources` - include an array of URLs of where the MIME type and the associated extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source); links to type aggregating sites and Wikipedia are _not acceptable_. To update the build, run `npm run build`. ### Adding Custom Media Types The best way to get new media types included in this library is to register them with the IANA. The community registration procedure is outlined in [RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types registered with the IANA are automatically pulled into this library. If that is not possible / feasible, they can be added directly here as a "custom" type. To do this, it is required to have a primary source that definitively lists the media type. If an extension is going to be listed as associateed with this media type, the source must definitively link the media type and extension as well. [ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci [ci-url]: https://github.com/jshttp/mime-db/actions?query=workflow%3Aci [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master [coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master [node-image]: https://badgen.net/npm/node/mime-db [node-url]: https://nodejs.org/en/download [npm-downloads-image]: https://badgen.net/npm/dm/mime-db [npm-url]: https://npmjs.org/package/mime-db [npm-version-image]: https://badgen.net/npm/v/mime-db
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/mime-db/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/mime-db/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 4090 }
2.1.35 / 2022-03-12 =================== * deps: [email protected] - Add extensions from IANA for more `image/*` types - Add extension `.asc` to `application/pgp-keys` - Add extensions to various XML types - Add new upstream MIME types 2.1.34 / 2021-11-08 =================== * deps: [email protected] - Add new upstream MIME types 2.1.33 / 2021-10-01 =================== * deps: [email protected] - Add deprecated iWorks mime types and extensions - Add new upstream MIME types 2.1.32 / 2021-07-27 =================== * deps: [email protected] - Add extension `.trig` to `application/trig` - Add new upstream MIME types 2.1.31 / 2021-06-01 =================== * deps: [email protected] - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` - Add new upstream MIME types 2.1.30 / 2021-04-02 =================== * deps: [email protected] - Add extension `.amr` to `audio/amr` - Remove ambigious extensions from IANA for `application/*+xml` types - Update primary extension to `.es` for `application/ecmascript` 2.1.29 / 2021-02-17 =================== * deps: [email protected] - Add extension `.amr` to `audio/amr` - Add extension `.m4s` to `video/iso.segment` - Add extension `.opus` to `audio/ogg` - Add new upstream MIME types 2.1.28 / 2021-01-01 =================== * deps: [email protected] - Add `application/ubjson` with extension `.ubj` - Add `image/avif` with extension `.avif` - Add `image/ktx2` with extension `.ktx2` - Add extension `.dbf` to `application/vnd.dbf` - Add extension `.rar` to `application/vnd.rar` - Add extension `.td` to `application/urc-targetdesc+xml` - Add new upstream MIME types - Fix extension of `application/vnd.apple.keynote` to be `.key` 2.1.27 / 2020-04-23 =================== * deps: [email protected] - Add charsets from IANA - Add extension `.cjs` to `application/node` - Add new upstream MIME types 2.1.26 / 2020-01-05 =================== * deps: [email protected] - Add `application/x-keepass2` with extension `.kdbx` - Add extension `.mxmf` to `audio/mobile-xmf` - Add extensions from IANA for `application/*+xml` types - Add new upstream MIME types 2.1.25 / 2019-11-12 =================== * deps: [email protected] - Add new upstream MIME types - Add `application/toml` with extension `.toml` - Add `image/vnd.ms-dds` with extension `.dds` 2.1.24 / 2019-04-20 =================== * deps: [email protected] - Add extensions from IANA for `model/*` types - Add `text/mdx` with extension `.mdx` 2.1.23 / 2019-04-17 =================== * deps: mime-db@~1.39.0 - Add extensions `.siv` and `.sieve` to `application/sieve` - Add new upstream MIME types 2.1.22 / 2019-02-14 =================== * deps: mime-db@~1.38.0 - Add extension `.nq` to `application/n-quads` - Add extension `.nt` to `application/n-triples` - Add new upstream MIME types 2.1.21 / 2018-10-19 =================== * deps: mime-db@~1.37.0 - Add extensions to HEIC image types - Add new upstream MIME types 2.1.20 / 2018-08-26 =================== * deps: mime-db@~1.36.0 - Add Apple file extensions from IANA - Add extensions from IANA for `image/*` types - Add new upstream MIME types 2.1.19 / 2018-07-17 =================== * deps: mime-db@~1.35.0 - Add extension `.csl` to `application/vnd.citationstyles.style+xml` - Add extension `.es` to `application/ecmascript` - Add extension `.owl` to `application/rdf+xml` - Add new upstream MIME types - Add UTF-8 as default charset for `text/turtle` 2.1.18 / 2018-02-16 =================== * deps: mime-db@~1.33.0 - Add `application/raml+yaml` with extension `.raml` - Add `application/wasm` with extension `.wasm` - Add `text/shex` with extension `.shex` - Add extensions for JPEG-2000 images - Add extensions from IANA for `message/*` types - Add new upstream MIME types - Update font MIME types - Update `text/hjson` to registered `application/hjson` 2.1.17 / 2017-09-01 =================== * deps: mime-db@~1.30.0 - Add `application/vnd.ms-outlook` - Add `application/x-arj` - Add extension `.mjs` to `application/javascript` - Add glTF types and extensions - Add new upstream MIME types - Add `text/x-org` - Add VirtualBox MIME types - Fix `source` records for `video/*` types that are IANA - Update `font/opentype` to registered `font/otf` 2.1.16 / 2017-07-24 =================== * deps: mime-db@~1.29.0 - Add `application/fido.trusted-apps+json` - Add extension `.wadl` to `application/vnd.sun.wadl+xml` - Add extension `.gz` to `application/gzip` - Add new upstream MIME types - Update extensions `.md` and `.markdown` to be `text/markdown` 2.1.15 / 2017-03-23 =================== * deps: mime-db@~1.27.0 - Add new mime types - Add `image/apng` 2.1.14 / 2017-01-14 =================== * deps: mime-db@~1.26.0 - Add new mime types 2.1.13 / 2016-11-18 =================== * deps: mime-db@~1.25.0 - Add new mime types 2.1.12 / 2016-09-18 =================== * deps: mime-db@~1.24.0 - Add new mime types - Add `audio/mp3` 2.1.11 / 2016-05-01 =================== * deps: mime-db@~1.23.0 - Add new mime types 2.1.10 / 2016-02-15 =================== * deps: mime-db@~1.22.0 - Add new mime types - Fix extension of `application/dash+xml` - Update primary extension for `audio/mp4` 2.1.9 / 2016-01-06 ================== * deps: mime-db@~1.21.0 - Add new mime types 2.1.8 / 2015-11-30 ================== * deps: mime-db@~1.20.0 - Add new mime types 2.1.7 / 2015-09-20 ================== * deps: mime-db@~1.19.0 - Add new mime types 2.1.6 / 2015-09-03 ================== * deps: mime-db@~1.18.0 - Add new mime types 2.1.5 / 2015-08-20 ================== * deps: mime-db@~1.17.0 - Add new mime types 2.1.4 / 2015-07-30 ================== * deps: mime-db@~1.16.0 - Add new mime types 2.1.3 / 2015-07-13 ================== * deps: mime-db@~1.15.0 - Add new mime types 2.1.2 / 2015-06-25 ================== * deps: mime-db@~1.14.0 - Add new mime types 2.1.1 / 2015-06-08 ================== * perf: fix deopt during mapping 2.1.0 / 2015-06-07 ================== * Fix incorrectly treating extension-less file name as extension - i.e. `'path/to/json'` will no longer return `application/json` * Fix `.charset(type)` to accept parameters * Fix `.charset(type)` to match case-insensitive * Improve generation of extension to MIME mapping * Refactor internals for readability and no argument reassignment * Prefer `application/*` MIME types from the same source * Prefer any type over `application/octet-stream` * deps: mime-db@~1.13.0 - Add nginx as a source - Add new mime types 2.0.14 / 2015-06-06 =================== * deps: mime-db@~1.12.0 - Add new mime types 2.0.13 / 2015-05-31 =================== * deps: mime-db@~1.11.0 - Add new mime types 2.0.12 / 2015-05-19 =================== * deps: mime-db@~1.10.0 - Add new mime types 2.0.11 / 2015-05-05 =================== * deps: mime-db@~1.9.1 - Add new mime types 2.0.10 / 2015-03-13 =================== * deps: mime-db@~1.8.0 - Add new mime types 2.0.9 / 2015-02-09 ================== * deps: mime-db@~1.7.0 - Add new mime types - Community extensions ownership transferred from `node-mime` 2.0.8 / 2015-01-29 ================== * deps: mime-db@~1.6.0 - Add new mime types 2.0.7 / 2014-12-30 ================== * deps: mime-db@~1.5.0 - Add new mime types - Fix various invalid MIME type entries 2.0.6 / 2014-12-30 ================== * deps: mime-db@~1.4.0 - Add new mime types - Fix various invalid MIME type entries - Remove example template MIME types 2.0.5 / 2014-12-29 ================== * deps: mime-db@~1.3.1 - Fix missing extensions 2.0.4 / 2014-12-10 ================== * deps: mime-db@~1.3.0 - Add new mime types 2.0.3 / 2014-11-09 ================== * deps: mime-db@~1.2.0 - Add new mime types 2.0.2 / 2014-09-28 ================== * deps: mime-db@~1.1.0 - Add new mime types - Update charsets 2.0.1 / 2014-09-07 ================== * Support Node.js 0.6 2.0.0 / 2014-09-02 ================== * Use `mime-db` * Remove `.define()` 1.0.2 / 2014-08-04 ================== * Set charset=utf-8 for `text/javascript` 1.0.1 / 2014-06-24 ================== * Add `text/jsx` type 1.0.0 / 2014-05-12 ================== * Return `false` for unknown types * Set charset=utf-8 for `application/json` 0.1.0 / 2014-05-02 ================== * Initial release
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/mime-types/HISTORY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/mime-types/HISTORY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 8811 }
# mime-types [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-version-image]][node-version-url] [![Build Status][ci-image]][ci-url] [![Test Coverage][coveralls-image]][coveralls-url] The ultimate javascript content-type utility. Similar to [the `[email protected]` module](https://www.npmjs.com/package/mime), except: - __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`, so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. - No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. - No `.define()` functionality - Bug fixes for `.lookup(path)` Otherwise, the API is compatible with `mime` 1.x. ## Install This is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/). Installation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): ```sh $ npm install mime-types ``` ## Adding Types All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db), so open a PR there if you'd like to add mime types. ## API ```js var mime = require('mime-types') ``` All functions return `false` if input is invalid or not found. ### mime.lookup(path) Lookup the content-type associated with a file. ```js mime.lookup('json') // 'application/json' mime.lookup('.md') // 'text/markdown' mime.lookup('file.html') // 'text/html' mime.lookup('folder/file.js') // 'application/javascript' mime.lookup('folder/.htaccess') // false mime.lookup('cats') // false ``` ### mime.contentType(type) Create a full content-type header given a content-type or extension. When given an extension, `mime.lookup` is used to get the matching content-type, otherwise the given content-type is used. Then if the content-type does not already have a `charset` parameter, `mime.charset` is used to get the default charset and add to the returned content-type. ```js mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' mime.contentType('file.json') // 'application/json; charset=utf-8' mime.contentType('text/html') // 'text/html; charset=utf-8' mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1' // from a full path mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' ``` ### mime.extension(type) Get the default extension for a content-type. ```js mime.extension('application/octet-stream') // 'bin' ``` ### mime.charset(type) Lookup the implied default charset of a content-type. ```js mime.charset('text/markdown') // 'UTF-8' ``` ### var type = mime.types[extension] A map of content-types by extension. ### [extensions...] = mime.extensions[type] A map of extensions by content-type. ## License [MIT](LICENSE) [ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci [ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master [coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master [node-version-image]: https://badgen.net/npm/node/mime-types [node-version-url]: https://nodejs.org/en/download [npm-downloads-image]: https://badgen.net/npm/dm/mime-types [npm-url]: https://npmjs.org/package/mime-types [npm-version-image]: https://badgen.net/npm/v/mime-types
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/mime-types/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/mime-types/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 3480 }
# Changelog ## v1.6.0 (24/11/2017) *No changelog for this release.* --- ## v2.0.4 (24/11/2017) - [**closed**] Switch to mime-score module for resolving extension contention issues. [#182](https://github.com/broofa/node-mime/issues/182) - [**closed**] Update mime-db to 1.31.0 in v1.x branch [#181](https://github.com/broofa/node-mime/issues/181) --- ## v1.5.0 (22/11/2017) - [**closed**] need ES5 version ready in npm package [#179](https://github.com/broofa/node-mime/issues/179) - [**closed**] mime-db no trace of iWork - pages / numbers / etc. [#178](https://github.com/broofa/node-mime/issues/178) - [**closed**] How it works in brownser ? [#176](https://github.com/broofa/node-mime/issues/176) - [**closed**] Missing `./Mime` [#175](https://github.com/broofa/node-mime/issues/175) - [**closed**] Vulnerable Regular Expression [#167](https://github.com/broofa/node-mime/issues/167) --- ## v2.0.3 (25/09/2017) *No changelog for this release.* --- ## v1.4.1 (25/09/2017) - [**closed**] Issue when bundling with webpack [#172](https://github.com/broofa/node-mime/issues/172) --- ## v2.0.2 (15/09/2017) - [**V2**] fs.readFileSync is not a function [#165](https://github.com/broofa/node-mime/issues/165) - [**closed**] The extension for video/quicktime should map to .mov, not .qt [#164](https://github.com/broofa/node-mime/issues/164) - [**V2**] [v2 Feedback request] Mime class API [#163](https://github.com/broofa/node-mime/issues/163) - [**V2**] [v2 Feedback request] Resolving conflicts over extensions [#162](https://github.com/broofa/node-mime/issues/162) - [**V2**] Allow callers to load module with official, full, or no defined types. [#161](https://github.com/broofa/node-mime/issues/161) - [**V2**] Use "facets" to resolve extension conflicts [#160](https://github.com/broofa/node-mime/issues/160) - [**V2**] Remove fs and path dependencies [#152](https://github.com/broofa/node-mime/issues/152) - [**V2**] Default content-type should not be application/octet-stream [#139](https://github.com/broofa/node-mime/issues/139) - [**V2**] reset mime-types [#124](https://github.com/broofa/node-mime/issues/124) - [**V2**] Extensionless paths should return null or false [#113](https://github.com/broofa/node-mime/issues/113) --- ## v2.0.1 (14/09/2017) - [**closed**] Changelog for v2.0 does not mention breaking changes [#171](https://github.com/broofa/node-mime/issues/171) - [**closed**] MIME breaking with 'class' declaration as it is without 'use strict mode' [#170](https://github.com/broofa/node-mime/issues/170) --- ## v2.0.0 (12/09/2017) - [**closed**] woff and woff2 [#168](https://github.com/broofa/node-mime/issues/168) --- ## v1.4.0 (28/08/2017) - [**closed**] support for ac3 voc files [#159](https://github.com/broofa/node-mime/issues/159) - [**closed**] Help understanding change from application/xml to text/xml [#158](https://github.com/broofa/node-mime/issues/158) - [**closed**] no longer able to override mimetype [#157](https://github.com/broofa/node-mime/issues/157) - [**closed**] application/vnd.adobe.photoshop [#147](https://github.com/broofa/node-mime/issues/147) - [**closed**] Directories should appear as something other than application/octet-stream [#135](https://github.com/broofa/node-mime/issues/135) - [**closed**] requested features [#131](https://github.com/broofa/node-mime/issues/131) - [**closed**] Make types.json loading optional? [#129](https://github.com/broofa/node-mime/issues/129) - [**closed**] Cannot find module './types.json' [#120](https://github.com/broofa/node-mime/issues/120) - [**V2**] .wav files show up as "audio/x-wav" instead of "audio/x-wave" [#118](https://github.com/broofa/node-mime/issues/118) - [**closed**] Don't be a pain in the ass for node community [#108](https://github.com/broofa/node-mime/issues/108) - [**closed**] don't make default_type global [#78](https://github.com/broofa/node-mime/issues/78) - [**closed**] mime.extension() fails if the content-type is parameterized [#74](https://github.com/broofa/node-mime/issues/74) --- ## v1.3.6 (11/05/2017) - [**closed**] .md should be text/markdown as of March 2016 [#154](https://github.com/broofa/node-mime/issues/154) - [**closed**] Error while installing mime [#153](https://github.com/broofa/node-mime/issues/153) - [**closed**] application/manifest+json [#149](https://github.com/broofa/node-mime/issues/149) - [**closed**] Dynamic adaptive streaming over HTTP (DASH) file extension typo [#141](https://github.com/broofa/node-mime/issues/141) - [**closed**] charsets image/png undefined [#140](https://github.com/broofa/node-mime/issues/140) - [**closed**] Mime-db dependency out of date [#130](https://github.com/broofa/node-mime/issues/130) - [**closed**] how to support plist? [#126](https://github.com/broofa/node-mime/issues/126) - [**closed**] how does .types file format look like? [#123](https://github.com/broofa/node-mime/issues/123) - [**closed**] Feature: support for expanding MIME patterns [#121](https://github.com/broofa/node-mime/issues/121) - [**closed**] DEBUG_MIME doesn't work [#117](https://github.com/broofa/node-mime/issues/117) --- ## v1.3.4 (06/02/2015) *No changelog for this release.* --- ## v1.3.3 (06/02/2015) *No changelog for this release.* --- ## v1.3.1 (05/02/2015) - [**closed**] Consider adding support for Handlebars .hbs file ending [#111](https://github.com/broofa/node-mime/issues/111) - [**closed**] Consider adding support for hjson. [#110](https://github.com/broofa/node-mime/issues/110) - [**closed**] Add mime type for Opus audio files [#94](https://github.com/broofa/node-mime/issues/94) - [**closed**] Consider making the `Requesting New Types` information more visible [#77](https://github.com/broofa/node-mime/issues/77) --- ## v1.3.0 (05/02/2015) - [**closed**] Add common name? [#114](https://github.com/broofa/node-mime/issues/114) - [**closed**] application/x-yaml [#104](https://github.com/broofa/node-mime/issues/104) - [**closed**] Add mime type for WOFF file format 2.0 [#102](https://github.com/broofa/node-mime/issues/102) - [**closed**] application/x-msi for .msi [#99](https://github.com/broofa/node-mime/issues/99) - [**closed**] Add mimetype for gettext translation files [#98](https://github.com/broofa/node-mime/issues/98) - [**closed**] collaborators [#88](https://github.com/broofa/node-mime/issues/88) - [**closed**] getting errot in installation of mime module...any1 can help? [#87](https://github.com/broofa/node-mime/issues/87) - [**closed**] should application/json's charset be utf8? [#86](https://github.com/broofa/node-mime/issues/86) - [**closed**] Add "license" and "licenses" to package.json [#81](https://github.com/broofa/node-mime/issues/81) - [**closed**] lookup with extension-less file on Windows returns wrong type [#68](https://github.com/broofa/node-mime/issues/68) --- ## v1.2.11 (15/08/2013) - [**closed**] Update mime.types [#65](https://github.com/broofa/node-mime/issues/65) - [**closed**] Publish a new version [#63](https://github.com/broofa/node-mime/issues/63) - [**closed**] README should state upfront that "application/octet-stream" is default for unknown extension [#55](https://github.com/broofa/node-mime/issues/55) - [**closed**] Suggested improvement to the charset API [#52](https://github.com/broofa/node-mime/issues/52) --- ## v1.2.10 (25/07/2013) - [**closed**] Mime type for woff files should be application/font-woff and not application/x-font-woff [#62](https://github.com/broofa/node-mime/issues/62) - [**closed**] node.types in conflict with mime.types [#51](https://github.com/broofa/node-mime/issues/51) --- ## v1.2.9 (17/01/2013) - [**closed**] Please update "mime" NPM [#49](https://github.com/broofa/node-mime/issues/49) - [**closed**] Please add semicolon [#46](https://github.com/broofa/node-mime/issues/46) - [**closed**] parse full mime types [#43](https://github.com/broofa/node-mime/issues/43) --- ## v1.2.8 (10/01/2013) - [**closed**] /js directory mime is application/javascript. Is it correct? [#47](https://github.com/broofa/node-mime/issues/47) - [**closed**] Add mime types for lua code. [#45](https://github.com/broofa/node-mime/issues/45) --- ## v1.2.7 (19/10/2012) - [**closed**] cannot install 1.2.7 via npm [#41](https://github.com/broofa/node-mime/issues/41) - [**closed**] Transfer ownership to @broofa [#36](https://github.com/broofa/node-mime/issues/36) - [**closed**] it's wrong to set charset to UTF-8 for text [#30](https://github.com/broofa/node-mime/issues/30) - [**closed**] Allow multiple instances of MIME types container [#27](https://github.com/broofa/node-mime/issues/27) --- ## v1.2.5 (16/02/2012) - [**closed**] When looking up a types, check hasOwnProperty [#23](https://github.com/broofa/node-mime/issues/23) - [**closed**] Bump version to 1.2.2 [#18](https://github.com/broofa/node-mime/issues/18) - [**closed**] No license [#16](https://github.com/broofa/node-mime/issues/16) - [**closed**] Some types missing that are used by html5/css3 [#13](https://github.com/broofa/node-mime/issues/13) - [**closed**] npm install fails for 1.2.1 [#12](https://github.com/broofa/node-mime/issues/12) - [**closed**] image/pjpeg + image/x-png [#10](https://github.com/broofa/node-mime/issues/10) - [**closed**] symlink [#8](https://github.com/broofa/node-mime/issues/8) - [**closed**] gzip [#2](https://github.com/broofa/node-mime/issues/2) - [**closed**] ALL CAPS filenames return incorrect mime type [#1](https://github.com/broofa/node-mime/issues/1)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/mime/CHANGELOG.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/mime/CHANGELOG.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 9470 }
# mime Comprehensive MIME type mapping API based on mime-db module. ## Install Install with [npm](http://github.com/isaacs/npm): npm install mime ## Contributing / Testing npm run test ## Command Line mime [path_string] E.g. > mime scripts/jquery.js application/javascript ## API - Queries ### mime.lookup(path) Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. ```js var mime = require('mime'); mime.lookup('/path/to/file.txt'); // => 'text/plain' mime.lookup('file.txt'); // => 'text/plain' mime.lookup('.TXT'); // => 'text/plain' mime.lookup('htm'); // => 'text/html' ``` ### mime.default_type Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) ### mime.extension(type) Get the default extension for `type` ```js mime.extension('text/html'); // => 'html' mime.extension('application/octet-stream'); // => 'bin' ``` ### mime.charsets.lookup() Map mime-type to charset ```js mime.charsets.lookup('text/plain'); // => 'UTF-8' ``` (The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) ## API - Defining Custom Types Custom type mappings can be added on a per-project basis via the following APIs. ### mime.define() Add custom mime/extension mappings ```js mime.define({ 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], 'application/x-my-type': ['x-mt', 'x-mtt'], // etc ... }); mime.lookup('x-sft'); // => 'text/x-some-format' ``` The first entry in the extensions array is returned by `mime.extension()`. E.g. ```js mime.extension('text/x-some-format'); // => 'x-sf' ``` ### mime.load(filepath) Load mappings from an Apache ".types" format file ```js mime.load('./my_project.types'); ``` The .types file format is simple - See the `types` dir for examples.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/mime/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/mime/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2118 }
# minimatch A minimal matching utility. This is the matching library used internally by npm. It works by converting glob expressions into JavaScript `RegExp` objects. ## Usage ```js // hybrid module, load with require() or import import { minimatch } from 'minimatch' // or: const { minimatch } = require('minimatch') minimatch('bar.foo', '*.foo') // true! minimatch('bar.foo', '*.bar') // false! minimatch('bar.foo', '*.+(bar|foo)', { debug: true }) // true, and noisy! ``` ## Features Supports these glob features: - Brace Expansion - Extended glob matching - "Globstar" `**` matching - [Posix character classes](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html), like `[[:alpha:]]`, supporting the full range of Unicode characters. For example, `[[:alpha:]]` will match against `'é'`, though `[a-zA-Z]` will not. Collating symbol and set matching is not supported, so `[[=e=]]` will _not_ match `'é'` and `[[.ch.]]` will not match `'ch'` in locales where `ch` is considered a single character. See: - `man sh` - `man bash` [Pattern Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) - `man 3 fnmatch` - `man 5 gitignore` ## Windows **Please only use forward-slashes in glob expressions.** Though windows uses either `/` or `\` as its path separator, only `/` characters are used by this glob implementation. You must use forward-slashes **only** in glob expressions. Back-slashes in patterns will always be interpreted as escape characters, not path separators. Note that `\` or `/` _will_ be interpreted as path separators in paths on Windows, and will match against `/` in glob expressions. So just always use `/` in patterns. ### UNC Paths On Windows, UNC paths like `//?/c:/...` or `//ComputerName/Share/...` are handled specially. - Patterns starting with a double-slash followed by some non-slash characters will preserve their double-slash. As a result, a pattern like `//*` will match `//x`, but not `/x`. - Patterns staring with `//?/<drive letter>:` will _not_ treat the `?` as a wildcard character. Instead, it will be treated as a normal string. - Patterns starting with `//?/<drive letter>:/...` will match file paths starting with `<drive letter>:/...`, and vice versa, as if the `//?/` was not present. This behavior only is present when the drive letters are a case-insensitive match to one another. The remaining portions of the path/pattern are compared case sensitively, unless `nocase:true` is set. Note that specifying a UNC path using `\` characters as path separators is always allowed in the file path argument, but only allowed in the pattern argument when `windowsPathsNoEscape: true` is set in the options. ## Minimatch Class Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require('minimatch').Minimatch var mm = new Minimatch(pattern, options) ``` ### Properties - `pattern` The original pattern the minimatch object represents. - `options` The options supplied to the constructor. - `set` A 2-dimensional array of regexp or string expressions. Each row in the array corresponds to a brace-expanded pattern. Each item in the row corresponds to a single path-part. For example, the pattern `{a,b/c}/d` would expand to a set of patterns like: [ [ a, d ] , [ b, c, d ] ] If a portion of the pattern doesn't have any "magic" in it (that is, it's something like `"foo"` rather than `fo*o?`), then it will be left as a string rather than converted to a regular expression. - `regexp` Created by the `makeRe` method. A single regular expression expressing the entire pattern. This is useful in cases where you wish to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. - `negate` True if the pattern is negated. - `comment` True if the pattern is a comment. - `empty` True if the pattern is `""`. ### Methods - `makeRe()` Generate the `regexp` member if necessary, and return it. Will return `false` if the pattern is invalid. - `match(fname)` Return true if the filename matches the pattern, or false otherwise. - `matchOne(fileArray, patternArray, partial)` Take a `/`-split filename, and match it against a single row in the `regExpSet`. This method is mainly for internal use, but is exposed so that it can be used by a glob-walker that needs to avoid excessive filesystem calls. - `hasMagic()` Returns true if the parsed pattern contains any magic characters. Returns false if all comparator parts are string literals. If the `magicalBraces` option is set on the constructor, then it will consider brace expansions which are not otherwise magical to be magic. If not set, then a pattern like `a{b,c}d` will return `false`, because neither `abd` nor `acd` contain any special glob characters. This does **not** mean that the pattern string can be used as a literal filename, as it may contain magic glob characters that are escaped. For example, the pattern `\\*` or `[*]` would not be considered to have magic, as the matching portion parses to the literal string `'*'` and would match a path named `'*'`, not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may be used to remove escape characters. All other methods are internal, and will be called as necessary. ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. ```javascript var isJS = minimatch(file, '*.js', { matchBase: true }) ``` ### minimatch.filter(pattern, options) Returns a function that tests its supplied argument, suitable for use with `Array.filter`. Example: ```javascript var javascripts = fileList.filter(minimatch.filter('*.js', { matchBase: true })) ``` ### minimatch.escape(pattern, options = {}) Escape all magic characters in a glob pattern, so that it will only ever match literal strings If the `windowsPathsNoEscape` option is used, then characters are escaped by wrapping in `[]`, because a magic character wrapped in a character class can only be satisfied by that exact character. Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped or unescaped. ### minimatch.unescape(pattern, options = {}) Un-escape a glob string that may contain some escaped characters. If the `windowsPathsNoEscape` option is used, then square-brace escapes are removed, but not backslash escapes. For example, it will turn the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`, because `\` is a path separator in `windowsPathsNoEscape` mode. When `windowsPathsNoEscape` is not set, then both brace escapes and backslash escapes are removed. Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped or unescaped. ### minimatch.match(list, pattern, options) Match against the list of files, in the style of fnmatch or glob. If nothing is matched, and options.nonull is set, then return a list containing the pattern itself. ```javascript var javascripts = minimatch.match(fileList, '*.js', { matchBase: true }) ``` ### minimatch.makeRe(pattern, options) Make a regular expression object from the pattern. ## Options All options are `false` by default. ### debug Dump a ton of stuff to stderr. ### nobrace Do not expand `{a,b}` and `{1..3}` brace sets. ### noglobstar Disable `**` matching against multiple folder names. ### dot Allow patterns to match filenames starting with a period, even if the pattern does not explicitly have a period in that spot. Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` is set. ### noext Disable "extglob" style patterns like `+(a|b)`. ### nocase Perform a case-insensitive match. ### nocaseMagicOnly When used with `{nocase: true}`, create regular expressions that are case-insensitive, but leave string match portions untouched. Has no effect when used without `{nocase: true}` Useful when some other form of case-insensitive matching is used, or if the original string representation is useful in some other way. ### nonull When a match is not found by `minimatch.match`, return a list containing the pattern itself if this option is set. When not set, an empty list is returned if there are no matches. ### magicalBraces This only affects the results of the `Minimatch.hasMagic` method. If the pattern contains brace expansions, such as `a{b,c}d`, but no other magic characters, then the `Minimatch.hasMagic()` method will return `false` by default. When this option set, it will return `true` for brace expansion as well as other magic glob characters. ### matchBase If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. ### nocomment Suppress the behavior of treating `#` at the start of a pattern as a comment. ### nonegate Suppress the behavior of treating a leading `!` character as negation. ### flipNegate Returns from negate expressions the same as if they were not negated. (Ie, true on a hit, false on a miss.) ### partial Compare a partial path to a pattern. As long as the parts of the path that are present are not contradicted by the pattern, it will be treated as a match. This is useful in applications where you're walking through a folder structure, and don't yet have the full path, but want to ensure that you do not walk down paths that can never be a match. For example, ```js minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a ``` ### windowsPathsNoEscape Use `\\` as a path separator _only_, and _never_ as an escape character. If set, all `\\` characters are replaced with `/` in the pattern. Note that this makes it **impossible** to match against paths containing literal glob pattern characters, but allows matching with patterns constructed using `path.join()` and `path.resolve()` on Windows platforms, mimicking the (buggy!) behavior of earlier versions on Windows. Please use with caution, and be mindful of [the caveat about Windows paths](#windows). For legacy reasons, this is also set if `options.allowWindowsEscape` is set to the exact value `false`. ### windowsNoMagicRoot When a pattern starts with a UNC path or drive letter, and in `nocase:true` mode, do not convert the root portions of the pattern into a case-insensitive regular expression, and instead leave them as strings. This is the default when the platform is `win32` and `nocase:true` is set. ### preserveMultipleSlashes By default, multiple `/` characters (other than the leading `//` in a UNC path, see "UNC Paths" above) are treated as a single `/`. That is, a pattern like `a///b` will match the file path `a/b`. Set `preserveMultipleSlashes: true` to suppress this behavior. ### optimizationLevel A number indicating the level of optimization that should be done to the pattern prior to parsing and using it for matches. Globstar parts `**` are always converted to `*` when `noglobstar` is set, and multiple adjacent `**` parts are converted into a single `**` (ie, `a/**/**/b` will be treated as `a/**/b`, as this is equivalent in all cases). - `0` - Make no further changes. In this mode, `.` and `..` are maintained in the pattern, meaning that they must also appear in the same position in the test path string. Eg, a pattern like `a/*/../c` will match the string `a/b/../c` but not the string `a/c`. - `1` - (default) Remove cases where a double-dot `..` follows a pattern portion that is not `**`, `.`, `..`, or empty `''`. For example, the pattern `./a/b/../*` is converted to `./a/*`, and so it will match the path string `./a/c`, but not the path string `./a/b/../c`. Dots and empty path portions in the pattern are preserved. - `2` (or higher) - Much more aggressive optimizations, suitable for use with file-walking cases: - Remove cases where a double-dot `..` follows a pattern portion that is not `**`, `.`, or empty `''`. Remove empty and `.` portions of the pattern, where safe to do so (ie, anywhere other than the last position, the first position, or the second position in a pattern starting with `/`, as this may indicate a UNC path on Windows). - Convert patterns containing `<pre>/**/../<p>/<rest>` into the equivalent `<pre>/{..,**}/<p>/<rest>`, where `<p>` is a a pattern portion other than `.`, `..`, `**`, or empty `''`. - Dedupe patterns where a `**` portion is present in one and omitted in another, and it is not the final path portion, and they are otherwise equivalent. So `{a/**/b,a/b}` becomes `a/**/b`, because `**` matches against an empty path portion. - Dedupe patterns where a `*` portion is present in one, and a non-dot pattern other than `**`, `.`, `..`, or `''` is in the same position in the other. So `a/{*,x}/b` becomes `a/*/b`, because `*` can match against `x`. While these optimizations improve the performance of file-walking use cases such as [glob](http://npm.im/glob) (ie, the reason this module exists), there are cases where it will fail to match a literal string that would have been matched in optimization level 1 or 0. Specifically, while the `Minimatch.match()` method will optimize the file path string in the same ways, resulting in the same matches, it will fail when tested with the regular expression provided by `Minimatch.makeRe()`, unless the path string is first processed with `minimatch.levelTwoFileOptimize()` or similar. ### platform When set to `win32`, this will trigger all windows-specific behaviors (special handling for UNC paths, and treating `\` as separators in file paths for comparison.) Defaults to the value of `process.platform`. ## Comparisons to other fnmatch/glob implementations While strict compliance with the existing standards is a worthwhile goal, some discrepancies exist between minimatch and other implementations. Some are intentional, and some are unavoidable. If the pattern starts with a `!` character, then it is negated. Set the `nonegate` flag to suppress this behavior, and treat leading `!` characters normally. This is perhaps relevant if you wish to start the pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` characters at the start of a pattern will negate the pattern multiple times. If a pattern starts with `#`, then it is treated as a comment, and will not match anything. Use `\#` to match a literal `#` at the start of a line, or set the `nocomment` flag to suppress this behavior. The double-star character `**` is supported by default, unless the `noglobstar` flag is set. This is supported in the manner of bsdglob and bash 4.1, where `**` only has special significance if it is the only thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but `a/**b` will not. If an escaped pattern has no matches, and the `nonull` flag is set, then minimatch.match returns the pattern as-provided, rather than interpreting the character escapes. For example, `minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than `"*a?"`. This is akin to setting the `nullglob` option in bash, except that it does not resolve escaped pattern characters. If brace expansion is not disabled, then it is performed before any other interpretation of the glob pattern. Thus, a pattern like `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are checked for validity. Since those two are valid, matching proceeds. Negated extglob patterns are handled as closely as possible to Bash semantics, but there are some cases with negative extglobs which are exceedingly difficult to express in a JavaScript regular expression. In particular the negated pattern `<start>!(<pattern>*|)*` will in bash match anything that does not start with `<start><pattern>`. However, `<start>!(<pattern>*)*` _will_ match paths starting with `<start><pattern>`, because the empty string can match against the negated portion. In this library, `<start>!(<pattern>*|)*` will _not_ match any pattern starting with `<start>`, due to a difference in precisely which patterns are considered "greedy" in Regular Expressions vs bash path expansion. This may be fixable, but not without incurring some complexity and performance costs, and the trade-off seems to not be worth pursuing. Note that `fnmatch(3)` in libc is an extremely naive string comparison matcher, which does not do anything special for slashes. This library is designed to be used in glob searching and file walkers, and so it does do special things with `/`. Thus, `foo*` will not match `foo/bar` in this library, even though it would in `fnmatch(3)`.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/minimatch/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/minimatch/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 16939 }
# minipass A _very_ minimal implementation of a [PassThrough stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) [It's very fast](https://docs.google.com/spreadsheets/d/1K_HR5oh3r80b8WVMWCPPjfuWXUgfkmhlX7FGI6JJ8tY/edit?usp=sharing) for objects, strings, and buffers. Supports `pipe()`ing (including multi-`pipe()` and backpressure transmission), buffering data until either a `data` event handler or `pipe()` is added (so you don't lose the first chunk), and most other cases where PassThrough is a good idea. There is a `read()` method, but it's much more efficient to consume data from this stream via `'data'` events or by calling `pipe()` into some other stream. Calling `read()` requires the buffer to be flattened in some cases, which requires copying memory. If you set `objectMode: true` in the options, then whatever is written will be emitted. Otherwise, it'll do a minimal amount of Buffer copying to ensure proper Streams semantics when `read(n)` is called. `objectMode` can only be set at instantiation. Attempting to write something other than a String or Buffer without having set `objectMode` in the options will throw an error. This is not a `through` or `through2` stream. It doesn't transform the data, it just passes it right through. If you want to transform the data, extend the class, and override the `write()` method. Once you're done transforming the data however you want, call `super.write()` with the transform output. For some examples of streams that extend Minipass in various ways, check out: - [minizlib](http://npm.im/minizlib) - [fs-minipass](http://npm.im/fs-minipass) - [tar](http://npm.im/tar) - [minipass-collect](http://npm.im/minipass-collect) - [minipass-flush](http://npm.im/minipass-flush) - [minipass-pipeline](http://npm.im/minipass-pipeline) - [tap](http://npm.im/tap) - [tap-parser](http://npm.im/tap-parser) - [treport](http://npm.im/treport) - [minipass-fetch](http://npm.im/minipass-fetch) - [pacote](http://npm.im/pacote) - [make-fetch-happen](http://npm.im/make-fetch-happen) - [cacache](http://npm.im/cacache) - [ssri](http://npm.im/ssri) - [npm-registry-fetch](http://npm.im/npm-registry-fetch) - [minipass-json-stream](http://npm.im/minipass-json-stream) - [minipass-sized](http://npm.im/minipass-sized) ## Usage in TypeScript The `Minipass` class takes three type template definitions: - `RType` the type being read, which defaults to `Buffer`. If `RType` is `string`, then the constructor _must_ get an options object specifying either an `encoding` or `objectMode: true`. If it's anything other than `string` or `Buffer`, then it _must_ get an options object specifying `objectMode: true`. - `WType` the type being written. If `RType` is `Buffer` or `string`, then this defaults to `ContiguousData` (Buffer, string, ArrayBuffer, or ArrayBufferView). Otherwise, it defaults to `RType`. - `Events` type mapping event names to the arguments emitted with that event, which extends `Minipass.Events`. To declare types for custom events in subclasses, extend the third parameter with your own event signatures. For example: ```js import { Minipass } from 'minipass' // a NDJSON stream that emits 'jsonError' when it can't stringify export interface Events extends Minipass.Events { jsonError: [e: Error] } export class NDJSONStream extends Minipass<string, any, Events> { constructor() { super({ objectMode: true }) } // data is type `any` because that's WType write(data, encoding, cb) { try { const json = JSON.stringify(data) return super.write(json + '\n', encoding, cb) } catch (er) { if (!er instanceof Error) { er = Object.assign(new Error('json stringify failed'), { cause: er, }) } // trying to emit with something OTHER than an error will // fail, because we declared the event arguments type. this.emit('jsonError', er) } } } const s = new NDJSONStream() s.on('jsonError', e => { // here, TS knows that e is an Error }) ``` Emitting/handling events that aren't declared in this way is fine, but the arguments will be typed as `unknown`. ## Differences from Node.js Streams There are several things that make Minipass streams different from (and in some ways superior to) Node.js core streams. Please read these caveats if you are familiar with node-core streams and intend to use Minipass streams in your programs. You can avoid most of these differences entirely (for a very small performance penalty) by setting `{async: true}` in the constructor options. ### Timing Minipass streams are designed to support synchronous use-cases. Thus, data is emitted as soon as it is available, always. It is buffered until read, but no longer. Another way to look at it is that Minipass streams are exactly as synchronous as the logic that writes into them. This can be surprising if your code relies on `PassThrough.write()` always providing data on the next tick rather than the current one, or being able to call `resume()` and not have the entire buffer disappear immediately. However, without this synchronicity guarantee, there would be no way for Minipass to achieve the speeds it does, or support the synchronous use cases that it does. Simply put, waiting takes time. This non-deferring approach makes Minipass streams much easier to reason about, especially in the context of Promises and other flow-control mechanisms. Example: ```js // hybrid module, either works import { Minipass } from 'minipass' // or: const { Minipass } = require('minipass') const stream = new Minipass() stream.on('data', () => console.log('data event')) console.log('before write') stream.write('hello') console.log('after write') // output: // before write // data event // after write ``` ### Exception: Async Opt-In If you wish to have a Minipass stream with behavior that more closely mimics Node.js core streams, you can set the stream in async mode either by setting `async: true` in the constructor options, or by setting `stream.async = true` later on. ```js // hybrid module, either works import { Minipass } from 'minipass' // or: const { Minipass } = require('minipass') const asyncStream = new Minipass({ async: true }) asyncStream.on('data', () => console.log('data event')) console.log('before write') asyncStream.write('hello') console.log('after write') // output: // before write // after write // data event <-- this is deferred until the next tick ``` Switching _out_ of async mode is unsafe, as it could cause data corruption, and so is not enabled. Example: ```js import { Minipass } from 'minipass' const stream = new Minipass({ encoding: 'utf8' }) stream.on('data', chunk => console.log(chunk)) stream.async = true console.log('before writes') stream.write('hello') setStreamSyncAgainSomehow(stream) // <-- this doesn't actually exist! stream.write('world') console.log('after writes') // hypothetical output would be: // before writes // world // after writes // hello // NOT GOOD! ``` To avoid this problem, once set into async mode, any attempt to make the stream sync again will be ignored. ```js const { Minipass } = require('minipass') const stream = new Minipass({ encoding: 'utf8' }) stream.on('data', chunk => console.log(chunk)) stream.async = true console.log('before writes') stream.write('hello') stream.async = false // <-- no-op, stream already async stream.write('world') console.log('after writes') // actual output: // before writes // after writes // hello // world ``` ### No High/Low Water Marks Node.js core streams will optimistically fill up a buffer, returning `true` on all writes until the limit is hit, even if the data has nowhere to go. Then, they will not attempt to draw more data in until the buffer size dips below a minimum value. Minipass streams are much simpler. The `write()` method will return `true` if the data has somewhere to go (which is to say, given the timing guarantees, that the data is already there by the time `write()` returns). If the data has nowhere to go, then `write()` returns false, and the data sits in a buffer, to be drained out immediately as soon as anyone consumes it. Since nothing is ever buffered unnecessarily, there is much less copying data, and less bookkeeping about buffer capacity levels. ### Hazards of Buffering (or: Why Minipass Is So Fast) Since data written to a Minipass stream is immediately written all the way through the pipeline, and `write()` always returns true/false based on whether the data was fully flushed, backpressure is communicated immediately to the upstream caller. This minimizes buffering. Consider this case: ```js const { PassThrough } = require('stream') const p1 = new PassThrough({ highWaterMark: 1024 }) const p2 = new PassThrough({ highWaterMark: 1024 }) const p3 = new PassThrough({ highWaterMark: 1024 }) const p4 = new PassThrough({ highWaterMark: 1024 }) p1.pipe(p2).pipe(p3).pipe(p4) p4.on('data', () => console.log('made it through')) // this returns false and buffers, then writes to p2 on next tick (1) // p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) // p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) // p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' // on next tick (4) // p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and // 'drain' on next tick (5) // p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) // p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next // tick (7) p1.write(Buffer.alloc(2048)) // returns false ``` Along the way, the data was buffered and deferred at each stage, and multiple event deferrals happened, for an unblocked pipeline where it was perfectly safe to write all the way through! Furthermore, setting a `highWaterMark` of `1024` might lead someone reading the code to think an advisory maximum of 1KiB is being set for the pipeline. However, the actual advisory buffering level is the _sum_ of `highWaterMark` values, since each one has its own bucket. Consider the Minipass case: ```js const m1 = new Minipass() const m2 = new Minipass() const m3 = new Minipass() const m4 = new Minipass() m1.pipe(m2).pipe(m3).pipe(m4) m4.on('data', () => console.log('made it through')) // m1 is flowing, so it writes the data to m2 immediately // m2 is flowing, so it writes the data to m3 immediately // m3 is flowing, so it writes the data to m4 immediately // m4 is flowing, so it fires the 'data' event immediately, returns true // m4's write returned true, so m3 is still flowing, returns true // m3's write returned true, so m2 is still flowing, returns true // m2's write returned true, so m1 is still flowing, returns true // No event deferrals or buffering along the way! m1.write(Buffer.alloc(2048)) // returns true ``` It is extremely unlikely that you _don't_ want to buffer any data written, or _ever_ buffer data that can be flushed all the way through. Neither node-core streams nor Minipass ever fail to buffer written data, but node-core streams do a lot of unnecessary buffering and pausing. As always, the faster implementation is the one that does less stuff and waits less time to do it. ### Immediately emit `end` for empty streams (when not paused) If a stream is not paused, and `end()` is called before writing any data into it, then it will emit `end` immediately. If you have logic that occurs on the `end` event which you don't want to potentially happen immediately (for example, closing file descriptors, moving on to the next entry in an archive parse stream, etc.) then be sure to call `stream.pause()` on creation, and then `stream.resume()` once you are ready to respond to the `end` event. However, this is _usually_ not a problem because: ### Emit `end` When Asked One hazard of immediately emitting `'end'` is that you may not yet have had a chance to add a listener. In order to avoid this hazard, Minipass streams safely re-emit the `'end'` event if a new listener is added after `'end'` has been emitted. Ie, if you do `stream.on('end', someFunction)`, and the stream has already emitted `end`, then it will call the handler right away. (You can think of this somewhat like attaching a new `.then(fn)` to a previously-resolved Promise.) To prevent calling handlers multiple times who would not expect multiple ends to occur, all listeners are removed from the `'end'` event whenever it is emitted. ### Emit `error` When Asked The most recent error object passed to the `'error'` event is stored on the stream. If a new `'error'` event handler is added, and an error was previously emitted, then the event handler will be called immediately (or on `process.nextTick` in the case of async streams). This makes it much more difficult to end up trying to interact with a broken stream, if the error handler is added after an error was previously emitted. ### Impact of "immediate flow" on Tee-streams A "tee stream" is a stream piping to multiple destinations: ```js const tee = new Minipass() t.pipe(dest1) t.pipe(dest2) t.write('foo') // goes to both destinations ``` Since Minipass streams _immediately_ process any pending data through the pipeline when a new pipe destination is added, this can have surprising effects, especially when a stream comes in from some other function and may or may not have data in its buffer. ```js // WARNING! WILL LOSE DATA! const src = new Minipass() src.write('foo') src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone src.pipe(dest2) // gets nothing! ``` One solution is to create a dedicated tee-stream junction that pipes to both locations, and then pipe to _that_ instead. ```js // Safe example: tee to both places const src = new Minipass() src.write('foo') const tee = new Minipass() tee.pipe(dest1) tee.pipe(dest2) src.pipe(tee) // tee gets 'foo', pipes to both locations ``` The same caveat applies to `on('data')` event listeners. The first one added will _immediately_ receive all of the data, leaving nothing for the second: ```js // WARNING! WILL LOSE DATA! const src = new Minipass() src.write('foo') src.on('data', handler1) // receives 'foo' right away src.on('data', handler2) // nothing to see here! ``` Using a dedicated tee-stream can be used in this case as well: ```js // Safe example: tee to both data handlers const src = new Minipass() src.write('foo') const tee = new Minipass() tee.on('data', handler1) tee.on('data', handler2) src.pipe(tee) ``` All of the hazards in this section are avoided by setting `{ async: true }` in the Minipass constructor, or by setting `stream.async = true` afterwards. Note that this does add some overhead, so should only be done in cases where you are willing to lose a bit of performance in order to avoid having to refactor program logic. ## USAGE It's a stream! Use it like a stream and it'll most likely do what you want. ```js import { Minipass } from 'minipass' const mp = new Minipass(options) // options is optional mp.write('foo') mp.pipe(someOtherStream) mp.end('bar') ``` ### OPTIONS - `encoding` How would you like the data coming _out_ of the stream to be encoded? Accepts any values that can be passed to `Buffer.toString()`. - `objectMode` Emit data exactly as it comes in. This will be flipped on by default if you write() something other than a string or Buffer at any point. Setting `objectMode: true` will prevent setting any encoding value. - `async` Defaults to `false`. Set to `true` to defer data emission until next tick. This reduces performance slightly, but makes Minipass streams use timing behavior closer to Node core streams. See [Timing](#timing) for more details. - `signal` An `AbortSignal` that will cause the stream to unhook itself from everything and become as inert as possible. Note that providing a `signal` parameter will make `'error'` events no longer throw if they are unhandled, but they will still be emitted to handlers if any are attached. ### API Implements the user-facing portions of Node.js's `Readable` and `Writable` streams. ### Methods - `write(chunk, [encoding], [callback])` - Put data in. (Note that, in the base Minipass class, the same data will come out.) Returns `false` if the stream will buffer the next write, or true if it's still in "flowing" mode. - `end([chunk, [encoding]], [callback])` - Signal that you have no more data to write. This will queue an `end` event to be fired when all the data has been consumed. - `pause()` - No more data for a while, please. This also prevents `end` from being emitted for empty streams until the stream is resumed. - `resume()` - Resume the stream. If there's data in the buffer, it is all discarded. Any buffered events are immediately emitted. - `pipe(dest)` - Send all output to the stream provided. When data is emitted, it is immediately written to any and all pipe destinations. (Or written on next tick in `async` mode.) - `unpipe(dest)` - Stop piping to the destination stream. This is immediate, meaning that any asynchronously queued data will _not_ make it to the destination when running in `async` mode. - `options.end` - Boolean, end the destination stream when the source stream ends. Default `true`. - `options.proxyErrors` - Boolean, proxy `error` events from the source stream to the destination stream. Note that errors are _not_ proxied after the pipeline terminates, either due to the source emitting `'end'` or manually unpiping with `src.unpipe(dest)`. Default `false`. - `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. Some events are given special treatment, however. (See below under "events".) - `promise()` - Returns a Promise that resolves when the stream emits `end`, or rejects if the stream emits `error`. - `collect()` - Return a Promise that resolves on `end` with an array containing each chunk of data that was emitted, or rejects if the stream emits `error`. Note that this consumes the stream data. - `concat()` - Same as `collect()`, but concatenates the data into a single Buffer object. Will reject the returned promise if the stream is in objectMode, or if it goes into objectMode by the end of the data. - `read(n)` - Consume `n` bytes of data out of the buffer. If `n` is not provided, then consume all of it. If `n` bytes are not available, then it returns null. **Note** consuming streams in this way is less efficient, and can lead to unnecessary Buffer copying. - `destroy([er])` - Destroy the stream. If an error is provided, then an `'error'` event is emitted. If the stream has a `close()` method, and has not emitted a `'close'` event yet, then `stream.close()` will be called. Any Promises returned by `.promise()`, `.collect()` or `.concat()` will be rejected. After being destroyed, writing to the stream will emit an error. No more data will be emitted if the stream is destroyed, even if it was previously buffered. ### Properties - `bufferLength` Read-only. Total number of bytes buffered, or in the case of objectMode, the total number of objects. - `encoding` Read-only. The encoding that has been set. - `flowing` Read-only. Boolean indicating whether a chunk written to the stream will be immediately emitted. - `emittedEnd` Read-only. Boolean indicating whether the end-ish events (ie, `end`, `prefinish`, `finish`) have been emitted. Note that listening on any end-ish event will immediateyl re-emit it if it has already been emitted. - `writable` Whether the stream is writable. Default `true`. Set to `false` when `end()` - `readable` Whether the stream is readable. Default `true`. - `pipes` An array of Pipe objects referencing streams that this stream is piping into. - `destroyed` A getter that indicates whether the stream was destroyed. - `paused` True if the stream has been explicitly paused, otherwise false. - `objectMode` Indicates whether the stream is in `objectMode`. - `aborted` Readonly property set when the `AbortSignal` dispatches an `abort` event. ### Events - `data` Emitted when there's data to read. Argument is the data to read. This is never emitted while not flowing. If a listener is attached, that will resume the stream. - `end` Emitted when there's no more data to read. This will be emitted immediately for empty streams when `end()` is called. If a listener is attached, and `end` was already emitted, then it will be emitted again. All listeners are removed when `end` is emitted. - `prefinish` An end-ish event that follows the same logic as `end` and is emitted in the same conditions where `end` is emitted. Emitted after `'end'`. - `finish` An end-ish event that follows the same logic as `end` and is emitted in the same conditions where `end` is emitted. Emitted after `'prefinish'`. - `close` An indication that an underlying resource has been released. Minipass does not emit this event, but will defer it until after `end` has been emitted, since it throws off some stream libraries otherwise. - `drain` Emitted when the internal buffer empties, and it is again suitable to `write()` into the stream. - `readable` Emitted when data is buffered and ready to be read by a consumer. - `resume` Emitted when stream changes state from buffering to flowing mode. (Ie, when `resume` is called, `pipe` is called, or a `data` event listener is added.) ### Static Methods - `Minipass.isStream(stream)` Returns `true` if the argument is a stream, and false otherwise. To be considered a stream, the object must be either an instance of Minipass, or an EventEmitter that has either a `pipe()` method, or both `write()` and `end()` methods. (Pretty much any stream in node-land will return `true` for this.) ## EXAMPLES Here are some examples of things you can do with Minipass streams. ### simple "are you done yet" promise ```js mp.promise().then( () => { // stream is finished }, er => { // stream emitted an error } ) ``` ### collecting ```js mp.collect().then(all => { // all is an array of all the data emitted // encoding is supported in this case, so // so the result will be a collection of strings if // an encoding is specified, or buffers/objects if not. // // In an async function, you may do // const data = await stream.collect() }) ``` ### collecting into a single blob This is a bit slower because it concatenates the data into one chunk for you, but if you're going to do it yourself anyway, it's convenient this way: ```js mp.concat().then(onebigchunk => { // onebigchunk is a string if the stream // had an encoding set, or a buffer otherwise. }) ``` ### iteration You can iterate over streams synchronously or asynchronously in platforms that support it. Synchronous iteration will end when the currently available data is consumed, even if the `end` event has not been reached. In string and buffer mode, the data is concatenated, so unless multiple writes are occurring in the same tick as the `read()`, sync iteration loops will generally only have a single iteration. To consume chunks in this way exactly as they have been written, with no flattening, create the stream with the `{ objectMode: true }` option. ```js const mp = new Minipass({ objectMode: true }) mp.write('a') mp.write('b') for (let letter of mp) { console.log(letter) // a, b } mp.write('c') mp.write('d') for (let letter of mp) { console.log(letter) // c, d } mp.write('e') mp.end() for (let letter of mp) { console.log(letter) // e } for (let letter of mp) { console.log(letter) // nothing } ``` Asynchronous iteration will continue until the end event is reached, consuming all of the data. ```js const mp = new Minipass({ encoding: 'utf8' }) // some source of some data let i = 5 const inter = setInterval(() => { if (i-- > 0) mp.write(Buffer.from('foo\n', 'utf8')) else { mp.end() clearInterval(inter) } }, 100) // consume the data with asynchronous iteration async function consume() { for await (let chunk of mp) { console.log(chunk) } return 'ok' } consume().then(res => console.log(res)) // logs `foo\n` 5 times, and then `ok` ``` ### subclass that `console.log()`s everything written into it ```js class Logger extends Minipass { write(chunk, encoding, callback) { console.log('WRITE', chunk, encoding) return super.write(chunk, encoding, callback) } end(chunk, encoding, callback) { console.log('END', chunk, encoding) return super.end(chunk, encoding, callback) } } someSource.pipe(new Logger()).pipe(someDest) ``` ### same thing, but using an inline anonymous class ```js // js classes are fun someSource .pipe( new (class extends Minipass { emit(ev, ...data) { // let's also log events, because debugging some weird thing console.log('EMIT', ev) return super.emit(ev, ...data) } write(chunk, encoding, callback) { console.log('WRITE', chunk, encoding) return super.write(chunk, encoding, callback) } end(chunk, encoding, callback) { console.log('END', chunk, encoding) return super.end(chunk, encoding, callback) } })() ) .pipe(someDest) ``` ### subclass that defers 'end' for some reason ```js class SlowEnd extends Minipass { emit(ev, ...args) { if (ev === 'end') { console.log('going to end, hold on a sec') setTimeout(() => { console.log('ok, ready to end now') super.emit('end', ...args) }, 100) return true } else { return super.emit(ev, ...args) } } } ``` ### transform that creates newline-delimited JSON ```js class NDJSONEncode extends Minipass { write(obj, cb) { try { // JSON.stringify can throw, emit an error on that return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) } catch (er) { this.emit('error', er) } } end(obj, cb) { if (typeof obj === 'function') { cb = obj obj = undefined } if (obj !== undefined) { this.write(obj) } return super.end(cb) } } ``` ### transform that parses newline-delimited JSON ```js class NDJSONDecode extends Minipass { constructor(options) { // always be in object mode, as far as Minipass is concerned super({ objectMode: true }) this._jsonBuffer = '' } write(chunk, encoding, cb) { if ( typeof chunk === 'string' && typeof encoding === 'string' && encoding !== 'utf8' ) { chunk = Buffer.from(chunk, encoding).toString() } else if (Buffer.isBuffer(chunk)) { chunk = chunk.toString() } if (typeof encoding === 'function') { cb = encoding } const jsonData = (this._jsonBuffer + chunk).split('\n') this._jsonBuffer = jsonData.pop() for (let i = 0; i < jsonData.length; i++) { try { // JSON.parse can throw, emit an error on that super.write(JSON.parse(jsonData[i])) } catch (er) { this.emit('error', er) continue } } if (cb) cb() } } ```
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/minipass/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/minipass/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 27158 }
<p align="center"> <img src="https://i.imgur.com/BqsX9NT.png" width="300" height="300" alt="mitt"> <br> <a href="https://www.npmjs.org/package/mitt"><img src="https://img.shields.io/npm/v/mitt.svg" alt="npm"></a> <img src="https://github.com/developit/mitt/workflows/CI/badge.svg" alt="build status"> <a href="https://unpkg.com/mitt/dist/mitt.js"><img src="https://img.badgesize.io/https://unpkg.com/mitt/dist/mitt.js?compression=gzip" alt="gzip size"></a> </p> # Mitt > Tiny 200b functional event emitter / pubsub. - **Microscopic:** weighs less than 200 bytes gzipped - **Useful:** a wildcard `"*"` event type listens to all events - **Familiar:** same names & ideas as [Node's EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) - **Functional:** methods don't rely on `this` - **Great Name:** somehow [mitt](https://npm.im/mitt) wasn't taken Mitt was made for the browser, but works in any JavaScript runtime. It has no dependencies and supports IE9+. ## Table of Contents - [Install](#install) - [Usage](#usage) - [Examples & Demos](#examples--demos) - [API](#api) - [Contribute](#contribute) - [License](#license) ## Install This project uses [node](http://nodejs.org) and [npm](https://npmjs.com). Go check them out if you don't have them locally installed. ```sh $ npm install --save mitt ``` Then with a module bundler like [rollup](http://rollupjs.org/) or [webpack](https://webpack.js.org/), use as you would anything else: ```javascript // using ES6 modules import mitt from 'mitt' // using CommonJS modules var mitt = require('mitt') ``` The [UMD](https://github.com/umdjs/umd) build is also available on [unpkg](https://unpkg.com): ```html <script src="https://unpkg.com/mitt/dist/mitt.umd.js"></script> ``` You can find the library on `window.mitt`. ## Usage ```js import mitt from 'mitt' const emitter = mitt() // listen to an event emitter.on('foo', e => console.log('foo', e) ) // listen to all events emitter.on('*', (type, e) => console.log(type, e) ) // fire an event emitter.emit('foo', { a: 'b' }) // clearing all events emitter.all.clear() // working with handler references: function onFoo() {} emitter.on('foo', onFoo) // listen emitter.off('foo', onFoo) // unlisten ``` ### Typescript Set `"strict": true` in your tsconfig.json to get improved type inference for `mitt` instance methods. ```ts import mitt from 'mitt'; type Events = { foo: string; bar?: number; }; const emitter = mitt<Events>(); // inferred as Emitter<Events> emitter.on('foo', (e) => {}); // 'e' has inferred type 'string' emitter.emit('foo', 42); // Error: Argument of type 'number' is not assignable to parameter of type 'string'. (2345) ``` Alternatively, you can use the provided `Emitter` type: ```ts import mitt, { Emitter } from 'mitt'; type Events = { foo: string; bar?: number; }; const emitter: Emitter<Events> = mitt<Events>(); ``` ## Examples & Demos <a href="http://codepen.io/developit/pen/rjMEwW?editors=0110"> <b>Preact + Mitt Codepen Demo</b> <br> <img src="https://i.imgur.com/CjBgOfJ.png" width="278" alt="preact + mitt preview"> </a> * * * ## API <!-- Generated by documentation.js. Update this documentation by updating the source code. --> #### Table of Contents - [mitt](#mitt) - [all](#all) - [on](#on) - [Parameters](#parameters) - [off](#off) - [Parameters](#parameters-1) - [emit](#emit) - [Parameters](#parameters-2) ### mitt Mitt: Tiny (~200b) functional event emitter / pubsub. Returns **Mitt** ### all A Map of event names to registered handler functions. ### on Register an event handler for the given type. #### Parameters - `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol))** Type of event to listen for, or `'*'` for all events - `handler` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Function to call in response to given event ### off Remove an event handler for the given type. If `handler` is omitted, all handlers of the given type are removed. #### Parameters - `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol))** Type of event to unregister `handler` from, or `'*'` - `handler` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** Handler function to remove ### emit Invoke all handlers for the given type. If present, `'*'` handlers are invoked after type-matched handlers. Note: Manually firing '\*' handlers is not supported. #### Parameters - `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol))** The event type to invoke - `evt` **Any?** Any value (object is recommended and powerful), passed to each handler ## Contribute First off, thanks for taking the time to contribute! Now, take a moment to be sure your contributions make sense to everyone else. ### Reporting Issues Found a problem? Want a new feature? First of all see if your issue or idea has [already been reported](../../issues). If don't, just open a [new clear and descriptive issue](../../issues/new). ### Submitting pull requests Pull requests are the greatest contributions, so be sure they are focused in scope, and do avoid unrelated commits. - Fork it! - Clone your fork: `git clone https://github.com/<your-username>/mitt` - Navigate to the newly cloned directory: `cd mitt` - Create a new branch for the new feature: `git checkout -b my-new-feature` - Install the tools necessary for development: `npm install` - Make your changes. - Commit your changes: `git commit -am 'Add some feature'` - Push to the branch: `git push origin my-new-feature` - Submit a pull request with full remarks documenting your changes. ## License [MIT License](https://opensource.org/licenses/MIT) © [Jason Miller](https://jasonformat.com/)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/mitt/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/mitt/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 6272 }
The MIT License (MIT) Copyright (c) 2018 [Framer](https://www.framer.com?utm_source=motion-license) B.V. 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.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/motion-dom/LICENSE.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/motion-dom/LICENSE.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1129 }
The MIT License (MIT) Copyright (c) 2018 [Framer](https://www.framer.com?utm_source=motion-license) B.V. 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.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/motion-utils/LICENSE.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/motion-utils/LICENSE.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1129 }
The MIT License (MIT) Copyright (c) 2020 Vercel, Inc. 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.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/ms/license.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/ms/license.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1078 }
# ms ![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) Use this package to easily convert various time formats to milliseconds. ## Examples ```js ms('2 days') // 172800000 ms('1d') // 86400000 ms('10h') // 36000000 ms('2.5 hrs') // 9000000 ms('2h') // 7200000 ms('1m') // 60000 ms('5s') // 5000 ms('1y') // 31557600000 ms('100') // 100 ms('-3 days') // -259200000 ms('-1h') // -3600000 ms('-200') // -200 ``` ### Convert from Milliseconds ```js ms(60000) // "1m" ms(2 * 60000) // "2m" ms(-3 * 60000) // "-3m" ms(ms('10 hours')) // "10h" ``` ### Time Format Written-Out ```js ms(60000, { long: true }) // "1 minute" ms(2 * 60000, { long: true }) // "2 minutes" ms(-3 * 60000, { long: true }) // "-3 minutes" ms(ms('10 hours'), { long: true }) // "10 hours" ``` ## Features - Works both in [Node.js](https://nodejs.org) and in the browser - If a number is supplied to `ms`, a string with a unit is returned - If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) - If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned ## Related Packages - [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. ## Caught a Bug? 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device 2. Link the package to the global module directory: `npm link` 3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! As always, you can run the tests using: `npm test`
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/ms/readme.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/ms/readme.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1885 }
2.7.0 / 2017-09-13 ================== * feat: support fs.copyFile (#58) 2.6.0 / 2016-11-22 ================== * Added fdatasync to fs api (#46) 2.5.0 / 2016-11-04 ================== * feat: support fs.mkdtemp 2.4.0 / 2016-03-23 ================== * add `fs.truncate()` [#34](https://github.com/normalize/mz/pull/34) 2.3.1 / 2016-02-01 ================== * update `any-promise@v1` 2.3.0 / 2016-01-30 ================== * feat(package): switch to `any-promise` to support more promise engines 2.2.0 / 2016-01-24 ================== * feat(package): add index.js to files 2.1.0 / 2015-10-15 ================== * support for readline library 2.0.0 / 2015-05-24 ================== * support callbacks as well 1.2.0 / 2014-12-16 ================== * refactor promisification to `thenify` and `thenify-all` 1.1.0 / 2014-11-14 ================== * use `graceful-fs` if available 1.0.1 / 2014-08-18 ================== * don't use `bluebird.promisify()` - unnecessarily wraps runtime errors, causing issues 1.0.0 / 2014-06-18 ================== * use `bluebird` by default if found * support node 0.8
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/mz/HISTORY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/mz/HISTORY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1135 }
# MZ - Modernize node.js [![NPM version][npm-image]][npm-url] [![Build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url] [![Dependency Status][david-image]][david-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] Modernize node.js to current ECMAScript specifications! node.js will not update their API to ES6+ [for a while](https://github.com/joyent/node/issues/7549). This library is a wrapper for various aspects of node.js' API. ## Installation and Usage Set `mz` as a dependency and install it. ```bash npm i mz ``` Then prefix the relevant `require()`s with `mz/`: ```js var fs = require('mz/fs') fs.exists(__filename).then(function (exists) { if (exists) // do something }) ``` With ES2017, this will allow you to use async functions cleanly with node's core API: ```js const fs = require('mz/fs') async function doSomething () { if (await fs.exists(__filename)) // do something } ``` ## Promisification Many node methods are converted into promises. Any properties that are deprecated or aren't asynchronous will simply be proxied. The modules wrapped are: - `child_process` - `crypto` - `dns` - `fs` (uses `graceful-fs` if available) - `readline` - `zlib` ```js var exec = require('mz/child_process').exec exec('node --version').then(function (stdout) { console.log(stdout) }) ``` ## Promise Engine `mz` uses [`any-promise`](https://github.com/kevinbeaty/any-promise). ## FAQ ### Can I use this in production? Yes, Node 4.x ships with stable promises support. For older engines, you should probably install your own promise implementation and register it with `require('any-promise/register')('bluebird')`. ### Will this make my app faster? Nope, probably slower actually. ### Can I add more features? Sure. Open an issue. Currently, the plans are to eventually support: - New APIs in node.js that are not available in older versions of node - ECMAScript7 Streams [bluebird]: https://github.com/petkaantonov/bluebird [npm-image]: https://img.shields.io/npm/v/mz.svg?style=flat-square [npm-url]: https://npmjs.org/package/mz [github-tag]: http://img.shields.io/github/tag/normalize/mz.svg?style=flat-square [github-url]: https://github.com/normalize/mz/tags [travis-image]: https://img.shields.io/travis/normalize/mz.svg?style=flat-square [travis-url]: https://travis-ci.org/normalize/mz [coveralls-image]: https://img.shields.io/coveralls/normalize/mz.svg?style=flat-square [coveralls-url]: https://coveralls.io/r/normalize/mz?branch=master [david-image]: http://img.shields.io/david/normalize/mz.svg?style=flat-square [david-url]: https://david-dm.org/normalize/mz [license-image]: http://img.shields.io/npm/l/mz.svg?style=flat-square [license-url]: LICENSE [downloads-image]: http://img.shields.io/npm/dm/mz.svg?style=flat-square [downloads-url]: https://npmjs.org/package/mz
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/mz/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/mz/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2901 }
# Nano ID <img src="https://ai.github.io/nanoid/logo.svg" align="right" alt="Nano ID logo by Anton Lovchikov" width="180" height="94"> **English** | [Русский](./README.ru.md) | [简体中文](./README.zh-CN.md) | [Bahasa Indonesia](./README.id-ID.md) A tiny, secure, URL-friendly, unique string ID generator for JavaScript. > “An amazing level of senseless perfectionism, > which is simply impossible not to respect.” * **Small.** 130 bytes (minified and gzipped). No dependencies. [Size Limit] controls the size. * **Fast.** It is 2 times faster than UUID. * **Safe.** It uses hardware random generator. Can be used in clusters. * **Short IDs.** It uses a larger alphabet than UUID (`A-Za-z0-9_-`). So ID size was reduced from 36 to 21 symbols. * **Portable.** Nano ID was ported to [20 programming languages](#other-programming-languages). ```js import { nanoid } from 'nanoid' model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT" ``` Supports modern browsers, IE [with Babel], Node.js and React Native. [online tool]: https://gitpod.io/#https://github.com/ai/nanoid/ [with Babel]: https://developer.epages.com/blog/coding/how-to-transpile-node-modules-with-babel-and-webpack-in-a-monorepo/ [Size Limit]: https://github.com/ai/size-limit <a href="https://evilmartians.com/?utm_source=nanoid"> <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54"> </a> ## Docs Read full docs **[here](https://github.com/ai/nanoid#readme)**.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/nanoid/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/nanoid/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1523 }
0.6.3 / 2022-01-22 ================== * Revert "Lazy-load modules from main entry point" 0.6.2 / 2019-04-29 ================== * Fix sorting charset, encoding, and language with extra parameters 0.6.1 / 2016-05-02 ================== * perf: improve `Accept` parsing speed * perf: improve `Accept-Charset` parsing speed * perf: improve `Accept-Encoding` parsing speed * perf: improve `Accept-Language` parsing speed 0.6.0 / 2015-09-29 ================== * Fix including type extensions in parameters in `Accept` parsing * Fix parsing `Accept` parameters with quoted equals * Fix parsing `Accept` parameters with quoted semicolons * Lazy-load modules from main entry point * perf: delay type concatenation until needed * perf: enable strict mode * perf: hoist regular expressions * perf: remove closures getting spec properties * perf: remove a closure from media type parsing * perf: remove property delete from media type parsing 0.5.3 / 2015-05-10 ================== * Fix media type parameter matching to be case-insensitive 0.5.2 / 2015-05-06 ================== * Fix comparing media types with quoted values * Fix splitting media types with quoted commas 0.5.1 / 2015-02-14 ================== * Fix preference sorting to be stable for long acceptable lists 0.5.0 / 2014-12-18 ================== * Fix list return order when large accepted list * Fix missing identity encoding when q=0 exists * Remove dynamic building of Negotiator class 0.4.9 / 2014-10-14 ================== * Fix error when media type has invalid parameter 0.4.8 / 2014-09-28 ================== * Fix all negotiations to be case-insensitive * Stable sort preferences of same quality according to client order * Support Node.js 0.6 0.4.7 / 2014-06-24 ================== * Handle invalid provided languages * Handle invalid provided media types 0.4.6 / 2014-06-11 ================== * Order by specificity when quality is the same 0.4.5 / 2014-05-29 ================== * Fix regression in empty header handling 0.4.4 / 2014-05-29 ================== * Fix behaviors when headers are not present 0.4.3 / 2014-04-16 ================== * Handle slashes on media params correctly 0.4.2 / 2014-02-28 ================== * Fix media type sorting * Handle media types params strictly 0.4.1 / 2014-01-16 ================== * Use most specific matches 0.4.0 / 2014-01-09 ================== * Remove preferred prefix from methods
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/negotiator/HISTORY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/negotiator/HISTORY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2498 }
# negotiator [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Node.js Version][node-version-image]][node-version-url] [![Build Status][github-actions-ci-image]][github-actions-ci-url] [![Test Coverage][coveralls-image]][coveralls-url] An HTTP content negotiator for Node.js ## Installation ```sh $ npm install negotiator ``` ## API ```js var Negotiator = require('negotiator') ``` ### Accept Negotiation ```js availableMediaTypes = ['text/html', 'text/plain', 'application/json'] // The negotiator constructor receives a request object negotiator = new Negotiator(request) // Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8' negotiator.mediaTypes() // -> ['text/html', 'image/jpeg', 'application/*'] negotiator.mediaTypes(availableMediaTypes) // -> ['text/html', 'application/json'] negotiator.mediaType(availableMediaTypes) // -> 'text/html' ``` You can check a working example at `examples/accept.js`. #### Methods ##### mediaType() Returns the most preferred media type from the client. ##### mediaType(availableMediaType) Returns the most preferred media type from a list of available media types. ##### mediaTypes() Returns an array of preferred media types ordered by the client preference. ##### mediaTypes(availableMediaTypes) Returns an array of preferred media types ordered by priority from a list of available media types. ### Accept-Language Negotiation ```js negotiator = new Negotiator(request) availableLanguages = ['en', 'es', 'fr'] // Let's say Accept-Language header is 'en;q=0.8, es, pt' negotiator.languages() // -> ['es', 'pt', 'en'] negotiator.languages(availableLanguages) // -> ['es', 'en'] language = negotiator.language(availableLanguages) // -> 'es' ``` You can check a working example at `examples/language.js`. #### Methods ##### language() Returns the most preferred language from the client. ##### language(availableLanguages) Returns the most preferred language from a list of available languages. ##### languages() Returns an array of preferred languages ordered by the client preference. ##### languages(availableLanguages) Returns an array of preferred languages ordered by priority from a list of available languages. ### Accept-Charset Negotiation ```js availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5'] negotiator = new Negotiator(request) // Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2' negotiator.charsets() // -> ['utf-8', 'iso-8859-1', 'utf-7'] negotiator.charsets(availableCharsets) // -> ['utf-8', 'iso-8859-1'] negotiator.charset(availableCharsets) // -> 'utf-8' ``` You can check a working example at `examples/charset.js`. #### Methods ##### charset() Returns the most preferred charset from the client. ##### charset(availableCharsets) Returns the most preferred charset from a list of available charsets. ##### charsets() Returns an array of preferred charsets ordered by the client preference. ##### charsets(availableCharsets) Returns an array of preferred charsets ordered by priority from a list of available charsets. ### Accept-Encoding Negotiation ```js availableEncodings = ['identity', 'gzip'] negotiator = new Negotiator(request) // Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5' negotiator.encodings() // -> ['gzip', 'identity', 'compress'] negotiator.encodings(availableEncodings) // -> ['gzip', 'identity'] negotiator.encoding(availableEncodings) // -> 'gzip' ``` You can check a working example at `examples/encoding.js`. #### Methods ##### encoding() Returns the most preferred encoding from the client. ##### encoding(availableEncodings) Returns the most preferred encoding from a list of available encodings. ##### encodings() Returns an array of preferred encodings ordered by the client preference. ##### encodings(availableEncodings) Returns an array of preferred encodings ordered by priority from a list of available encodings. ## See Also The [accepts](https://npmjs.org/package/accepts#readme) module builds on this module and provides an alternative interface, mime type validation, and more. ## License [MIT](LICENSE) [npm-image]: https://img.shields.io/npm/v/negotiator.svg [npm-url]: https://npmjs.org/package/negotiator [node-version-image]: https://img.shields.io/node/v/negotiator.svg [node-version-url]: https://nodejs.org/en/download/ [coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg [coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master [downloads-image]: https://img.shields.io/npm/dm/negotiator.svg [downloads-url]: https://npmjs.org/package/negotiator [github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/negotiator/ci/master?label=ci [github-actions-ci-url]: https://github.com/jshttp/negotiator/actions/workflows/ci.yml
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/negotiator/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/negotiator/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 4900 }
# node-gyp-build > Build tool and bindings loader for [`node-gyp`][node-gyp] that supports prebuilds. ``` npm install node-gyp-build ``` [![Test](https://github.com/prebuild/node-gyp-build/actions/workflows/test.yml/badge.svg)](https://github.com/prebuild/node-gyp-build/actions/workflows/test.yml) Use together with [`prebuildify`][prebuildify] to easily support prebuilds for your native modules. ## Usage > **Note.** Prebuild names have changed in [`prebuildify@3`][prebuildify] and `node-gyp-build@4`. Please see the documentation below. `node-gyp-build` works similar to [`node-gyp build`][node-gyp] except that it will check if a build or prebuild is present before rebuilding your project. It's main intended use is as an npm install script and bindings loader for native modules that bundle prebuilds using [`prebuildify`][prebuildify]. First add `node-gyp-build` as an install script to your native project ``` js { ... "scripts": { "install": "node-gyp-build" } } ``` Then in your `index.js`, instead of using the [`bindings`](https://www.npmjs.com/package/bindings) module use `node-gyp-build` to load your binding. ``` js var binding = require('node-gyp-build')(__dirname) ``` If you do these two things and bundle prebuilds with [`prebuildify`][prebuildify] your native module will work for most platforms without having to compile on install time AND will work in both node and electron without the need to recompile between usage. Users can override `node-gyp-build` and force compiling by doing `npm install --build-from-source`. Prebuilds will be attempted loaded from `MODULE_PATH/prebuilds/...` and then next `EXEC_PATH/prebuilds/...` (the latter allowing use with `zeit/pkg`) ## Supported prebuild names If so desired you can bundle more specific flavors, for example `musl` builds to support Alpine, or targeting a numbered ARM architecture version. These prebuilds can be bundled in addition to generic prebuilds; `node-gyp-build` will try to find the most specific flavor first. Prebuild filenames are composed of _tags_. The runtime tag takes precedence, as does an `abi` tag over `napi`. For more details on tags, please see [`prebuildify`][prebuildify]. Values for the `libc` and `armv` tags are auto-detected but can be overridden through the `LIBC` and `ARM_VERSION` environment variables, respectively. ## License MIT [prebuildify]: https://github.com/prebuild/prebuildify [node-gyp]: https://www.npmjs.com/package/node-gyp
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/node-gyp-build/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/node-gyp-build/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2484 }
## Security contact information To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/node-gyp-build/SECURITY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/node-gyp-build/SECURITY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 192 }
# Node.js releases data All data is located in `data` directory. `data/processed` contains `envs.json` with node.js releases data preprocessed to be used by [Browserslist](https://github.com/ai/browserslist) and other projects. Each version in this file contains only necessary info: version, release date, LTS flag/name, and security flag. `data/release-schedule` contains `release-schedule.json` with node.js releases date and end of life date. ## Installation ```bash npm install node-releases ```
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/node-releases/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/node-releases/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 504 }
# normalize-path [![NPM version](https://img.shields.io/npm/v/normalize-path.svg?style=flat)](https://www.npmjs.com/package/normalize-path) [![NPM monthly downloads](https://img.shields.io/npm/dm/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![NPM total downloads](https://img.shields.io/npm/dt/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/normalize-path.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/normalize-path) > Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled. Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save normalize-path ``` ## Usage ```js const normalize = require('normalize-path'); console.log(normalize('\\foo\\bar\\baz\\')); //=> '/foo/bar/baz' ``` **win32 namespaces** ```js console.log(normalize('\\\\?\\UNC\\Server01\\user\\docs\\Letter.txt')); //=> '//?/UNC/Server01/user/docs/Letter.txt' console.log(normalize('\\\\.\\CdRomX')); //=> '//./CdRomX' ``` **Consecutive slashes** Condenses multiple consecutive forward slashes (except for leading slashes in win32 namespaces) to a single slash. ```js console.log(normalize('.//foo//bar///////baz/')); //=> './foo/bar/baz' ``` ### Trailing slashes By default trailing slashes are removed. Pass `false` as the last argument to disable this behavior and _**keep** trailing slashes_: ```js console.log(normalize('foo\\bar\\baz\\', false)); //=> 'foo/bar/baz/' console.log(normalize('./foo/bar/baz/', false)); //=> './foo/bar/baz/' ``` ## Release history ### v3.0 No breaking changes in this release. * a check was added to ensure that [win32 namespaces](https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces) are handled properly by win32 `path.parse()` after a path has been normalized by this library. * a minor optimization was made to simplify how the trailing separator was handled ## About <details> <summary><strong>Contributing</strong></summary> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). </details> <details> <summary><strong>Running Tests</strong></summary> Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: ```sh $ npm install && npm test ``` </details> <details> <summary><strong>Building docs</strong></summary> _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ To generate the readme, run the following command: ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` </details> ### Related projects Other useful path-related libraries: * [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path "Return true if a file path contains the given path.") * [is-absolute](https://www.npmjs.com/package/is-absolute): Returns true if a file path is absolute. Does not rely on the path module… [more](https://github.com/jonschlinkert/is-absolute) | [homepage](https://github.com/jonschlinkert/is-absolute "Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native `path.isAbolute`.") * [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") * [parse-filepath](https://www.npmjs.com/package/parse-filepath): Pollyfill for node.js `path.parse`, parses a filepath into an object. | [homepage](https://github.com/jonschlinkert/parse-filepath "Pollyfill for node.js `path.parse`, parses a filepath into an object.") * [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with "Return `true` if a file path ends with the given string/suffix.") * [unixify](https://www.npmjs.com/package/unixify): Convert Windows file paths to unix paths. | [homepage](https://github.com/jonschlinkert/unixify "Convert Windows file paths to unix paths.") ### Contributors | **Commits** | **Contributor** | | --- | --- | | 35 | [jonschlinkert](https://github.com/jonschlinkert) | | 1 | [phated](https://github.com/phated) | ### Author **Jon Schlinkert** * [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) * [GitHub Profile](https://github.com/jonschlinkert) * [Twitter Profile](https://twitter.com/jonschlinkert) ### License Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT License](LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 19, 2018._
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/normalize-path/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/normalize-path/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 5438 }
# normalize-range Utility for normalizing a numeric range, with a wrapping function useful for polar coordinates. [![Build Status](https://travis-ci.org/jamestalmage/normalize-range.svg?branch=master)](https://travis-ci.org/jamestalmage/normalize-range) [![Coverage Status](https://coveralls.io/repos/jamestalmage/normalize-range/badge.svg?branch=master&service=github)](https://coveralls.io/github/jamestalmage/normalize-range?branch=master) [![Code Climate](https://codeclimate.com/github/jamestalmage/normalize-range/badges/gpa.svg)](https://codeclimate.com/github/jamestalmage/normalize-range) [![Dependency Status](https://david-dm.org/jamestalmage/normalize-range.svg)](https://david-dm.org/jamestalmage/normalize-range) [![devDependency Status](https://david-dm.org/jamestalmage/normalize-range/dev-status.svg)](https://david-dm.org/jamestalmage/normalize-range#info=devDependencies) [![NPM](https://nodei.co/npm/normalize-range.png)](https://nodei.co/npm/normalize-range/) ## Usage ```js var nr = require('normalize-range'); nr.wrap(0, 360, 400); //=> 40 nr.wrap(0, 360, -90); //=> 270 nr.limit(0, 100, 500); //=> 100 nr.limit(0, 100, -20); //=> 0 // There is a convenient currying function var wrapAngle = nr.curry(0, 360).wrap; var limitTo10 = nr.curry(0, 10).limit; wrapAngle(-30); //=> 330 ``` ## API ### wrap(min, max, value) Normalizes a values that "wraps around". For example, in a polar coordinate system, 270˚ can also be represented as -90˚. For wrapping purposes we assume `max` is functionally equivalent to `min`, and that `wrap(max + 1) === wrap(min + 1)`. Wrap always assumes that `min` is *inclusive*, and `max` is *exclusive*. In other words, if `value === max` the function will wrap it, and return `min`, but `min` will not be wrapped. ```js nr.wrap(0, 360, 0) === 0; nr.wrap(0, 360, 360) === 0; nr.wrap(0, 360, 361) === 1; nr.wrap(0, 360, -1) === 359; ``` You are not restricted to whole numbers, and ranges can be negative. ```js var π = Math.PI; var radianRange = nr.curry(-π, π); redianRange.wrap(0) === 0; nr.wrap(π) === -π; nr.wrap(4 * π / 3) === -2 * π / 3; ``` ### limit(min, max, value) Normalize the value by bringing it within the range. If `value` is greater than `max`, `max` will be returned. If `value` is less than `min`, `min` will be returned. Otherwise, `value` is returned unaltered. Both ends of this range are *inclusive*. ### test(min, max, value, [minExclusive], [maxExclusive]) Returns `true` if `value` is within the range, `false` otherwise. It defaults to `inclusive` on both ends of the range, but that can be changed by setting `minExclusive` and/or `maxExclusive` to a truthy value. ### validate(min, max, value, [minExclusive], [maxExclusive]) Returns `value` or throws an error if `value` is outside the specified range. ### name(min, max, value, [minExclusive], [maxExclusive]) Returns a string representing this range in [range notation](https://en.wikipedia.org/wiki/Interval_(mathematics)#Classification_of_intervals). ### curry(min, max, [minExclusive], [maxExclusive]) Convenience method for currying all method arguments except `value`. ```js var angle = require('normalize-range').curry(-180, 180, false, true); angle.wrap(270) //=> -90 angle.limit(200) //=> 180 angle.test(0) //=> true angle.validate(300) //=> throws an Error angle.toString() // or angle.name() //=> "[-180,180)" ``` #### min *Required* Type: `number` The minimum value (inclusive) of the range. #### max *Required* Type: `number` The maximum value (exclusive) of the range. #### value *Required* Type: `number` The value to be normalized. #### returns Type: `number` The normalized value. ## Building and Releasing - `npm test`: tests, linting, coverage and style checks. - `npm run watch`: autotest mode for active development. - `npm run debug`: run tests without coverage (istanbul can obscure line #'s) Release via `cut-release` tool. ## License MIT © [James Talmage](http://github.com/jamestalmage)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/normalize-range/readme.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/normalize-range/readme.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 4002 }
# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) > ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) ## Use the built-in Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), support `Object.assign()` :tada:. If you target only those environments, then by all means, use `Object.assign()` instead of this package. ## Install ``` $ npm install --save object-assign ``` ## Usage ```js const objectAssign = require('object-assign'); objectAssign({foo: 0}, {bar: 1}); //=> {foo: 0, bar: 1} // multiple sources objectAssign({foo: 0}, {bar: 1}, {baz: 2}); //=> {foo: 0, bar: 1, baz: 2} // overwrites equal keys objectAssign({foo: 0}, {foo: 1}, {foo: 2}); //=> {foo: 2} // ignores null and undefined sources objectAssign({foo: 0}, null, {bar: 1}, undefined); //=> {foo: 0, bar: 1} ``` ## API ### objectAssign(target, [source, ...]) Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. ## Resources - [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) ## Related - [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` ## License MIT © [Sindre Sorhus](https://sindresorhus.com)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/object-assign/readme.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/object-assign/readme.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1500 }
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [v1.13.2](https://github.com/inspect-js/object-inspect/compare/v1.13.1...v1.13.2) - 2024-06-21 ### Commits - [readme] update badges [`8a51e6b`](https://github.com/inspect-js/object-inspect/commit/8a51e6bedaf389ec40cc4659e9df53e8543d176e) - [Dev Deps] update `@ljharb/eslint-config`, `tape` [`ef05f58`](https://github.com/inspect-js/object-inspect/commit/ef05f58c9761a41416ab907299bf0fa79517014b) - [Dev Deps] update `error-cause`, `has-tostringtag`, `tape` [`c0c6c26`](https://github.com/inspect-js/object-inspect/commit/c0c6c26c44cee6671f7c5d43d2b91d27c5c00d90) - [Fix] Don't throw when `global` is not defined [`d4d0965`](https://github.com/inspect-js/object-inspect/commit/d4d096570f7dbd0e03266a96de11d05eb7b63e0f) - [meta] add missing `engines.node` [`17a352a`](https://github.com/inspect-js/object-inspect/commit/17a352af6fe1ba6b70a19081674231eb1a50c940) - [Dev Deps] update `globalthis` [`9c08884`](https://github.com/inspect-js/object-inspect/commit/9c08884aa662a149e2f11403f413927736b97da7) - [Dev Deps] update `error-cause` [`6af352d`](https://github.com/inspect-js/object-inspect/commit/6af352d7c3929a4cc4c55768c27bf547a5e900f4) - [Dev Deps] update `npmignore` [`94e617d`](https://github.com/inspect-js/object-inspect/commit/94e617d38831722562fa73dff4c895746861d267) - [Dev Deps] update `mock-property` [`2ac24d7`](https://github.com/inspect-js/object-inspect/commit/2ac24d7e58cd388ad093c33249e413e05bbfd6c3) - [Dev Deps] update `tape` [`46125e5`](https://github.com/inspect-js/object-inspect/commit/46125e58f1d1dcfb170ed3d1ea69da550ea8d77b) ## [v1.13.1](https://github.com/inspect-js/object-inspect/compare/v1.13.0...v1.13.1) - 2023-10-19 ### Commits - [Fix] in IE 8, global can !== window despite them being prototypes of each other [`30d0859`](https://github.com/inspect-js/object-inspect/commit/30d0859dc4606cf75c2410edcd5d5c6355f8d372) ## [v1.13.0](https://github.com/inspect-js/object-inspect/compare/v1.12.3...v1.13.0) - 2023-10-14 ### Commits - [New] add special handling for the global object [`431bab2`](https://github.com/inspect-js/object-inspect/commit/431bab21a490ee51d35395966a504501e8c685da) - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`fd4f619`](https://github.com/inspect-js/object-inspect/commit/fd4f6193562b4b0e95dcf5c0201b4e8cbbc4f58d) - [Dev Deps] update `mock-property`, `tape` [`b453f6c`](https://github.com/inspect-js/object-inspect/commit/b453f6ceeebf8a1b738a1029754092e0367a4134) - [Dev Deps] update `error-cause` [`e8ffc57`](https://github.com/inspect-js/object-inspect/commit/e8ffc577d73b92bb6a4b00c44f14e3319e374888) - [Dev Deps] update `tape` [`054b8b9`](https://github.com/inspect-js/object-inspect/commit/054b8b9b98633284cf989e582450ebfbbe53503c) - [Dev Deps] temporarily remove `aud` due to breaking change in transitive deps [`2476845`](https://github.com/inspect-js/object-inspect/commit/2476845e0678dd290c541c81cd3dec8420782c52) - [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` [`383fa5e`](https://github.com/inspect-js/object-inspect/commit/383fa5eebc0afd705cc778a4b49d8e26452e49a8) - [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm &lt; 6 [`68c244c`](https://github.com/inspect-js/object-inspect/commit/68c244c5174cdd877e5dcb8ee90aa3f44b2f25be) ## [v1.12.3](https://github.com/inspect-js/object-inspect/compare/v1.12.2...v1.12.3) - 2023-01-12 ### Commits - [Fix] in eg FF 24, collections lack forEach [`75fc226`](https://github.com/inspect-js/object-inspect/commit/75fc22673c82d45f28322b1946bb0eb41b672b7f) - [actions] update rebase action to use reusable workflow [`250a277`](https://github.com/inspect-js/object-inspect/commit/250a277a095e9dacc029ab8454dcfc15de549dcd) - [Dev Deps] update `aud`, `es-value-fixtures`, `tape` [`66a19b3`](https://github.com/inspect-js/object-inspect/commit/66a19b3209ccc3c5ef4b34c3cb0160e65d1ce9d5) - [Dev Deps] update `@ljharb/eslint-config`, `aud`, `error-cause` [`c43d332`](https://github.com/inspect-js/object-inspect/commit/c43d3324b48384a16fd3dc444e5fc589d785bef3) - [Tests] add `@pkgjs/support` to `postlint` [`e2618d2`](https://github.com/inspect-js/object-inspect/commit/e2618d22a7a3fa361b6629b53c1752fddc9c4d80) ## [v1.12.2](https://github.com/inspect-js/object-inspect/compare/v1.12.1...v1.12.2) - 2022-05-26 ### Commits - [Fix] use `util.inspect` for a custom inspection symbol method [`e243bf2`](https://github.com/inspect-js/object-inspect/commit/e243bf2eda6c4403ac6f1146fddb14d12e9646c1) - [meta] add support info [`ca20ba3`](https://github.com/inspect-js/object-inspect/commit/ca20ba35713c17068ca912a86c542f5e8acb656c) - [Fix] ignore `cause` in node v16.9 and v16.10 where it has a bug [`86aa553`](https://github.com/inspect-js/object-inspect/commit/86aa553a4a455562c2c56f1540f0bf857b9d314b) ## [v1.12.1](https://github.com/inspect-js/object-inspect/compare/v1.12.0...v1.12.1) - 2022-05-21 ### Commits - [Tests] use `mock-property` [`4ec8893`](https://github.com/inspect-js/object-inspect/commit/4ec8893ea9bfd28065ca3638cf6762424bf44352) - [meta] use `npmignore` to autogenerate an npmignore file [`07f868c`](https://github.com/inspect-js/object-inspect/commit/07f868c10bd25a9d18686528339bb749c211fc9a) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`b05244b`](https://github.com/inspect-js/object-inspect/commit/b05244b4f331e00c43b3151bc498041be77ccc91) - [Dev Deps] update `@ljharb/eslint-config`, `error-cause`, `es-value-fixtures`, `functions-have-names`, `tape` [`d037398`](https://github.com/inspect-js/object-inspect/commit/d037398dcc5d531532e4c19c4a711ed677f579c1) - [Fix] properly handle callable regexes in older engines [`848fe48`](https://github.com/inspect-js/object-inspect/commit/848fe48bd6dd0064ba781ee6f3c5e54a94144c37) ## [v1.12.0](https://github.com/inspect-js/object-inspect/compare/v1.11.1...v1.12.0) - 2021-12-18 ### Commits - [New] add `numericSeparator` boolean option [`2d2d537`](https://github.com/inspect-js/object-inspect/commit/2d2d537f5359a4300ce1c10241369f8024f89e11) - [Robustness] cache more prototype methods [`191533d`](https://github.com/inspect-js/object-inspect/commit/191533da8aec98a05eadd73a5a6e979c9c8653e8) - [New] ensure an Error’s `cause` is displayed [`53bc2ce`](https://github.com/inspect-js/object-inspect/commit/53bc2cee4e5a9cc4986f3cafa22c0685f340715e) - [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`bc164b6`](https://github.com/inspect-js/object-inspect/commit/bc164b6e2e7d36b263970f16f54de63048b84a36) - [Robustness] cache `RegExp.prototype.test` [`a314ab8`](https://github.com/inspect-js/object-inspect/commit/a314ab8271b905cbabc594c82914d2485a8daf12) - [meta] fix auto-changelog settings [`5ed0983`](https://github.com/inspect-js/object-inspect/commit/5ed0983be72f73e32e2559997517a95525c7e20d) ## [v1.11.1](https://github.com/inspect-js/object-inspect/compare/v1.11.0...v1.11.1) - 2021-12-05 ### Commits - [meta] add `auto-changelog` [`7dbdd22`](https://github.com/inspect-js/object-inspect/commit/7dbdd228401d6025d8b7391476d88aee9ea9bbdf) - [actions] reuse common workflows [`c8823bc`](https://github.com/inspect-js/object-inspect/commit/c8823bc0a8790729680709d45fb6e652432e91aa) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`7532b12`](https://github.com/inspect-js/object-inspect/commit/7532b120598307497b712890f75af8056f6d37a6) - [Refactor] use `has-tostringtag` to behave correctly in the presence of symbol shams [`94abb5d`](https://github.com/inspect-js/object-inspect/commit/94abb5d4e745bf33253942dea86b3e538d2ff6c6) - [actions] update codecov uploader [`5ed5102`](https://github.com/inspect-js/object-inspect/commit/5ed51025267a00e53b1341357315490ac4eb0874) - [Dev Deps] update `eslint`, `tape` [`37b2ad2`](https://github.com/inspect-js/object-inspect/commit/37b2ad26c08d94bfd01d5d07069a0b28ef4e2ad7) - [meta] add `sideEffects` flag [`d341f90`](https://github.com/inspect-js/object-inspect/commit/d341f905ef8bffa6a694cda6ddc5ba343532cd4f) ## [v1.11.0](https://github.com/inspect-js/object-inspect/compare/v1.10.3...v1.11.0) - 2021-07-12 ### Commits - [New] `customInspect`: add `symbol` option, to mimic modern util.inspect behavior [`e973a6e`](https://github.com/inspect-js/object-inspect/commit/e973a6e21f8140c5837cf25e9d89bdde88dc3120) - [Dev Deps] update `eslint` [`05f1cb3`](https://github.com/inspect-js/object-inspect/commit/05f1cb3cbcfe1f238e8b51cf9bc294305b7ed793) ## [v1.10.3](https://github.com/inspect-js/object-inspect/compare/v1.10.2...v1.10.3) - 2021-05-07 ### Commits - [Fix] handle core-js Symbol shams [`4acfc2c`](https://github.com/inspect-js/object-inspect/commit/4acfc2c4b503498759120eb517abad6d51c9c5d6) - [readme] update badges [`95c323a`](https://github.com/inspect-js/object-inspect/commit/95c323ad909d6cbabb95dd6015c190ba6db9c1f2) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud` [`cb38f48`](https://github.com/inspect-js/object-inspect/commit/cb38f485de6ec7a95109b5a9bbd0a1deba2f6611) ## [v1.10.2](https://github.com/inspect-js/object-inspect/compare/v1.10.1...v1.10.2) - 2021-04-17 ### Commits - [Fix] use a robust check for a boxed Symbol [`87f12d6`](https://github.com/inspect-js/object-inspect/commit/87f12d6e69ce530be04659c81a4cd502943acac5) ## [v1.10.1](https://github.com/inspect-js/object-inspect/compare/v1.10.0...v1.10.1) - 2021-04-17 ### Commits - [Fix] use a robust check for a boxed bigint [`d5ca829`](https://github.com/inspect-js/object-inspect/commit/d5ca8298b6d2e5c7b9334a5b21b96ed95d225c91) ## [v1.10.0](https://github.com/inspect-js/object-inspect/compare/v1.9.0...v1.10.0) - 2021-04-17 ### Commits - [Tests] increase coverage [`d8abb8a`](https://github.com/inspect-js/object-inspect/commit/d8abb8a62c2f084919df994a433b346e0d87a227) - [actions] use `node/install` instead of `node/run`; use `codecov` action [`4bfec2e`](https://github.com/inspect-js/object-inspect/commit/4bfec2e30aaef6ddef6cbb1448306f9f8b9520b7) - [New] respect `Symbol.toStringTag` on objects [`799b58f`](https://github.com/inspect-js/object-inspect/commit/799b58f536a45e4484633a8e9daeb0330835f175) - [Fix] do not allow Symbol.toStringTag to masquerade as builtins [`d6c5b37`](https://github.com/inspect-js/object-inspect/commit/d6c5b37d7e94427796b82432fb0c8964f033a6ab) - [New] add `WeakRef` support [`b6d898e`](https://github.com/inspect-js/object-inspect/commit/b6d898ee21868c780a7ee66b28532b5b34ed7f09) - [meta] do not publish github action workflow files [`918cdfc`](https://github.com/inspect-js/object-inspect/commit/918cdfc4b6fe83f559ff6ef04fe66201e3ff5cbd) - [meta] create `FUNDING.yml` [`0bb5fc5`](https://github.com/inspect-js/object-inspect/commit/0bb5fc516dbcd2cd728bd89cee0b580acc5ce301) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`22c8dc0`](https://github.com/inspect-js/object-inspect/commit/22c8dc0cac113d70f4781e49a950070923a671be) - [meta] use `prepublishOnly` script for npm 7+ [`e52ee09`](https://github.com/inspect-js/object-inspect/commit/e52ee09e8050b8dbac94ef57f786675567728223) - [Dev Deps] update `eslint` [`7c4e6fd`](https://github.com/inspect-js/object-inspect/commit/7c4e6fdedcd27cc980e13c9ad834d05a96f3d40c) ## [v1.9.0](https://github.com/inspect-js/object-inspect/compare/v1.8.0...v1.9.0) - 2020-11-30 ### Commits - [Tests] migrate tests to Github Actions [`d262251`](https://github.com/inspect-js/object-inspect/commit/d262251e13e16d3490b5473672f6b6d6ff86675d) - [New] add enumerable own Symbols to plain object output [`ee60c03`](https://github.com/inspect-js/object-inspect/commit/ee60c033088cff9d33baa71e59a362a541b48284) - [Tests] add passing tests [`01ac3e4`](https://github.com/inspect-js/object-inspect/commit/01ac3e4b5a30f97875a63dc9b1416b3bd626afc9) - [actions] add "Require Allow Edits" action [`c2d7746`](https://github.com/inspect-js/object-inspect/commit/c2d774680cde4ca4af332d84d4121b26f798ba9e) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `core-js` [`70058de`](https://github.com/inspect-js/object-inspect/commit/70058de1579fc54d1d15ed6c2dbe246637ce70ff) - [Fix] hex characters in strings should be uppercased, to match node `assert` [`6ab8faa`](https://github.com/inspect-js/object-inspect/commit/6ab8faaa0abc08fe7a8e2afd8b39c6f1f0e00113) - [Tests] run `nyc` on all tests [`4c47372`](https://github.com/inspect-js/object-inspect/commit/4c473727879ddc8e28b599202551ddaaf07b6210) - [Tests] node 0.8 has an unpredictable property order; fix `groups` test by removing property [`f192069`](https://github.com/inspect-js/object-inspect/commit/f192069a978a3b60e6f0e0d45ac7df260ab9a778) - [New] add enumerable properties to Function inspect result, per node’s `assert` [`fd38e1b`](https://github.com/inspect-js/object-inspect/commit/fd38e1bc3e2a1dc82091ce3e021917462eee64fc) - [Tests] fix tests for node &lt; 10, due to regex match `groups` [`2ac6462`](https://github.com/inspect-js/object-inspect/commit/2ac6462cc4f72eaa0b63a8cfee9aabe3008b2330) - [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`44b59e2`](https://github.com/inspect-js/object-inspect/commit/44b59e2676a7f825ef530dfd19dafb599e3b9456) - [Robustness] cache `Symbol.prototype.toString` [`f3c2074`](https://github.com/inspect-js/object-inspect/commit/f3c2074d8f32faf8292587c07c9678ea931703dd) - [Dev Deps] update `eslint` [`9411294`](https://github.com/inspect-js/object-inspect/commit/94112944b9245e3302e25453277876402d207e7f) - [meta] `require-allow-edits` no longer requires an explicit github token [`36c0220`](https://github.com/inspect-js/object-inspect/commit/36c02205de3c2b0e84d53777c5c9fd54a36c48ab) - [actions] update rebase checkout action to v2 [`55a39a6`](https://github.com/inspect-js/object-inspect/commit/55a39a64e944f19c6a7d8efddf3df27700f20d14) - [actions] switch Automatic Rebase workflow to `pull_request_target` event [`f59fd3c`](https://github.com/inspect-js/object-inspect/commit/f59fd3cf406c3a7c7ece140904a80bbc6bacfcca) - [Dev Deps] update `eslint` [`a492bec`](https://github.com/inspect-js/object-inspect/commit/a492becec644b0155c9c4bc1caf6f9fac11fb2c7) ## [v1.8.0](https://github.com/inspect-js/object-inspect/compare/v1.7.0...v1.8.0) - 2020-06-18 ### Fixed - [New] add `indent` option [`#27`](https://github.com/inspect-js/object-inspect/issues/27) ### Commits - [Tests] add codecov [`4324cbb`](https://github.com/inspect-js/object-inspect/commit/4324cbb1a2bd7710822a4151ff373570db22453e) - [New] add `maxStringLength` option [`b3995cb`](https://github.com/inspect-js/object-inspect/commit/b3995cb71e15b5ee127a3094c43994df9d973502) - [New] add `customInspect` option, to disable custom inspect methods [`28b9179`](https://github.com/inspect-js/object-inspect/commit/28b9179ee802bb3b90810100c11637db90c2fb6d) - [Tests] add Date and RegExp tests [`3b28eca`](https://github.com/inspect-js/object-inspect/commit/3b28eca57b0367aeadffac604ea09e8bdae7d97b) - [actions] add automatic rebasing / merge commit blocking [`0d9c6c0`](https://github.com/inspect-js/object-inspect/commit/0d9c6c044e83475ff0bfffb9d35b149834c83a2e) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape`; add `aud` [`7c204f2`](https://github.com/inspect-js/object-inspect/commit/7c204f22b9e41bc97147f4d32d4cb045b17769a6) - [readme] fix repo URLs, remove testling [`34ca9a0`](https://github.com/inspect-js/object-inspect/commit/34ca9a0dabfe75bd311f806a326fadad029909a3) - [Fix] when truncating a deep array, note it as `[Array]` instead of just `[Object]` [`f74c82d`](https://github.com/inspect-js/object-inspect/commit/f74c82dd0b35386445510deb250f34c41be3ec0e) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`1a8a5ea`](https://github.com/inspect-js/object-inspect/commit/1a8a5ea069ea2bee89d77caedad83ffa23d35711) - [Fix] do not be fooled by a function’s own `toString` method [`7cb5c65`](https://github.com/inspect-js/object-inspect/commit/7cb5c657a976f94715c19c10556a30f15bb7d5d7) - [patch] indicate explicitly that anon functions are anonymous, to match node [`81ebdd4`](https://github.com/inspect-js/object-inspect/commit/81ebdd4215005144074bbdff3f6bafa01407910a) - [Dev Deps] loosen the `core-js` dep [`e7472e8`](https://github.com/inspect-js/object-inspect/commit/e7472e8e242117670560bd995830c2a4d12080f5) - [Dev Deps] update `tape` [`699827e`](https://github.com/inspect-js/object-inspect/commit/699827e6b37258b5203c33c78c009bf4b0e6a66d) - [meta] add `safe-publish-latest` [`c5d2868`](https://github.com/inspect-js/object-inspect/commit/c5d2868d6eb33c472f37a20f89ceef2787046088) - [Dev Deps] update `@ljharb/eslint-config` [`9199501`](https://github.com/inspect-js/object-inspect/commit/919950195d486114ccebacbdf9d74d7f382693b0) ## [v1.7.0](https://github.com/inspect-js/object-inspect/compare/v1.6.0...v1.7.0) - 2019-11-10 ### Commits - [Tests] use shared travis-ci configs [`19899ed`](https://github.com/inspect-js/object-inspect/commit/19899edbf31f4f8809acf745ce34ad1ce1bfa63b) - [Tests] add linting [`a00f057`](https://github.com/inspect-js/object-inspect/commit/a00f057d917f66ea26dd37769c6b810ec4af97e8) - [Tests] lint last file [`2698047`](https://github.com/inspect-js/object-inspect/commit/2698047b58af1e2e88061598ef37a75f228dddf6) - [Tests] up to `node` `v12.7`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`589e87a`](https://github.com/inspect-js/object-inspect/commit/589e87a99cadcff4b600e6a303418e9d922836e8) - [New] add support for `WeakMap` and `WeakSet` [`3ddb3e4`](https://github.com/inspect-js/object-inspect/commit/3ddb3e4e0c8287130c61a12e0ed9c104b1549306) - [meta] clean up license so github can detect it properly [`27527bb`](https://github.com/inspect-js/object-inspect/commit/27527bb801520c9610c68cc3b55d6f20a2bee56d) - [Tests] cover `util.inspect.custom` [`36d47b9`](https://github.com/inspect-js/object-inspect/commit/36d47b9c59056a57ef2f1491602c726359561800) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape` [`b614eaa`](https://github.com/inspect-js/object-inspect/commit/b614eaac901da0e5c69151f534671f990a94cace) - [Tests] fix coverage thresholds [`7b7b176`](https://github.com/inspect-js/object-inspect/commit/7b7b176e15f8bd6e8b2f261ff5a493c2fe78d9c2) - [Tests] bigint tests now can run on unflagged node [`063af31`](https://github.com/inspect-js/object-inspect/commit/063af31ce9cd13c202e3b67c07ba06dc9b7c0f81) - [Refactor] add early bailout to `isMap` and `isSet` checks [`fc51047`](https://github.com/inspect-js/object-inspect/commit/fc5104714a3671d37e225813db79470d6335683b) - [meta] add `funding` field [`7f9953a`](https://github.com/inspect-js/object-inspect/commit/7f9953a113eec7b064a6393cf9f90ba15f1d131b) - [Tests] Fix invalid strict-mode syntax with hexadecimal [`a8b5425`](https://github.com/inspect-js/object-inspect/commit/a8b542503b4af1599a275209a1a99f5fdedb1ead) - [Dev Deps] update `@ljharb/eslint-config` [`98df157`](https://github.com/inspect-js/object-inspect/commit/98df1577314d9188a3fc3f17fdcf2fba697ae1bd) - add copyright to LICENSE [`bb69fd0`](https://github.com/inspect-js/object-inspect/commit/bb69fd017a062d299e44da1f9b2c7dcd67f621e6) - [Tests] use `npx aud` in `posttest` [`4838353`](https://github.com/inspect-js/object-inspect/commit/4838353593974cf7f905b9ef04c03c094f0cdbe2) - [Tests] move `0.6` to allowed failures, because it won‘t build on travis [`1bff32a`](https://github.com/inspect-js/object-inspect/commit/1bff32aa52e8aea687f0856b28ba754b3e43ebf7) ## [v1.6.0](https://github.com/inspect-js/object-inspect/compare/v1.5.0...v1.6.0) - 2018-05-02 ### Commits - [New] add support for boxed BigInt primitives [`356c66a`](https://github.com/inspect-js/object-inspect/commit/356c66a410e7aece7162c8319880a5ef647beaa9) - [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9` [`c77b65b`](https://github.com/inspect-js/object-inspect/commit/c77b65bba593811b906b9ec57561c5cba92e2db3) - [New] Add support for upcoming `BigInt` [`1ac548e`](https://github.com/inspect-js/object-inspect/commit/1ac548e4b27e26466c28c9a5e63e5d4e0591c31f) - [Tests] run bigint tests in CI with --harmony-bigint flag [`d31b738`](https://github.com/inspect-js/object-inspect/commit/d31b73831880254b5c6cf5691cda9a149fbc5f04) - [Dev Deps] update `core-js`, `tape` [`ff9eff6`](https://github.com/inspect-js/object-inspect/commit/ff9eff67113341ee1aaf80c1c22d683f43bfbccf) - [Docs] fix example to use `safer-buffer` [`48cae12`](https://github.com/inspect-js/object-inspect/commit/48cae12a73ec6cacc955175bc56bbe6aee6a211f) ## [v1.5.0](https://github.com/inspect-js/object-inspect/compare/v1.4.1...v1.5.0) - 2017-12-25 ### Commits - [New] add `quoteStyle` option [`f5a72d2`](https://github.com/inspect-js/object-inspect/commit/f5a72d26edb3959b048f74c056ca7100a6b091e4) - [Tests] add more test coverage [`30ebe4e`](https://github.com/inspect-js/object-inspect/commit/30ebe4e1fa943b99ecbb85be7614256d536e2759) - [Tests] require 0.6 to pass [`99a008c`](https://github.com/inspect-js/object-inspect/commit/99a008ccace189a60fd7da18bf00e32c9572b980) ## [v1.4.1](https://github.com/inspect-js/object-inspect/compare/v1.4.0...v1.4.1) - 2017-12-19 ### Commits - [Tests] up to `node` `v9.3`, `v8.9`, `v6.12` [`6674476`](https://github.com/inspect-js/object-inspect/commit/6674476cc56acaac1bde96c84fed5ef631911906) - [Fix] `inspect(Object(-0))` should be “Object(-0)”, not “Object(0)” [`d0a031f`](https://github.com/inspect-js/object-inspect/commit/d0a031f1cbb3024ee9982bfe364dd18a7e4d1bd3) ## [v1.4.0](https://github.com/inspect-js/object-inspect/compare/v1.3.0...v1.4.0) - 2017-10-24 ### Commits - [Tests] add `npm run coverage` [`3b48fb2`](https://github.com/inspect-js/object-inspect/commit/3b48fb25db037235eeb808f0b2830aad7aa36f70) - [Tests] remove commented-out osx builds [`71e24db`](https://github.com/inspect-js/object-inspect/commit/71e24db8ad6ee3b9b381c5300b0475f2ba595a73) - [New] add support for `util.inspect.custom`, in node only. [`20cca77`](https://github.com/inspect-js/object-inspect/commit/20cca7762d7e17f15b21a90793dff84acce155df) - [Tests] up to `node` `v8.6`; use `nvm install-latest-npm` to ensure new npm doesn’t break old node [`252952d`](https://github.com/inspect-js/object-inspect/commit/252952d230d8065851dd3d4d5fe8398aae068529) - [Tests] up to `node` `v8.8` [`4aa868d`](https://github.com/inspect-js/object-inspect/commit/4aa868d3a62914091d489dd6ec6eed194ee67cd3) - [Dev Deps] update `core-js`, `tape` [`59483d1`](https://github.com/inspect-js/object-inspect/commit/59483d1df418f852f51fa0db7b24aa6b0209a27a) ## [v1.3.0](https://github.com/inspect-js/object-inspect/compare/v1.2.2...v1.3.0) - 2017-07-31 ### Fixed - [Fix] Map/Set: work around core-js bug &lt; v2.5.0 [`#9`](https://github.com/inspect-js/object-inspect/issues/9) ### Commits - [New] add support for arrays with additional object keys [`0d19937`](https://github.com/inspect-js/object-inspect/commit/0d199374ee37959e51539616666f420ccb29acb9) - [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`; fix new npm breaking on older nodes [`e24784a`](https://github.com/inspect-js/object-inspect/commit/e24784a90c49117787157a12a63897c49cf89bbb) - Only apps should have lockfiles [`c6faebc`](https://github.com/inspect-js/object-inspect/commit/c6faebcb2ee486a889a4a1c4d78c0776c7576185) - [Dev Deps] update `tape` [`7345a0a`](https://github.com/inspect-js/object-inspect/commit/7345a0aeba7e91b888a079c10004d17696a7f586) ## [v1.2.2](https://github.com/inspect-js/object-inspect/compare/v1.2.1...v1.2.2) - 2017-03-24 ### Commits - [Tests] up to `node` `v7.7`, `v6.10`, `v4.8`; improve test matrix [`a2ddc15`](https://github.com/inspect-js/object-inspect/commit/a2ddc15a1f2c65af18076eea1c0eb9cbceb478a0) - [Tests] up to `node` `v7.0`, `v6.9`, `v5.12`, `v4.6`, `io.js` `v3.3`; improve test matrix [`a48949f`](https://github.com/inspect-js/object-inspect/commit/a48949f6b574b2d4d2298109d8e8d0eb3e7a83e7) - [Performance] check for primitive types as early as possible. [`3b8092a`](https://github.com/inspect-js/object-inspect/commit/3b8092a2a4deffd0575f94334f00194e2d48dad3) - [Refactor] remove unneeded `else`s. [`7255034`](https://github.com/inspect-js/object-inspect/commit/725503402e08de4f96f6bf2d8edef44ac36f26b6) - [Refactor] avoid recreating `lowbyte` function every time. [`81edd34`](https://github.com/inspect-js/object-inspect/commit/81edd3475bd15bdd18e84de7472033dcf5004aaa) - [Fix] differentiate -0 from 0 [`521d345`](https://github.com/inspect-js/object-inspect/commit/521d3456b009da7bf1c5785c8a9df5a9f8718264) - [Refactor] move object key gathering into separate function [`aca6265`](https://github.com/inspect-js/object-inspect/commit/aca626536eaeef697196c6e9db3e90e7e0355b6a) - [Refactor] consolidate wrapping logic for boxed primitives into a function. [`4e440cd`](https://github.com/inspect-js/object-inspect/commit/4e440cd9065df04802a2a1dead03f48c353ca301) - [Robustness] use `typeof` instead of comparing to literal `undefined` [`5ca6f60`](https://github.com/inspect-js/object-inspect/commit/5ca6f601937506daff8ed2fcf686363b55807b69) - [Refactor] consolidate Map/Set notations. [`4e576e5`](https://github.com/inspect-js/object-inspect/commit/4e576e5d7ed2f9ec3fb7f37a0d16732eb10758a9) - [Tests] ensure that this function remains anonymous, despite ES6 name inference. [`7540ae5`](https://github.com/inspect-js/object-inspect/commit/7540ae591278756db614fa4def55ca413150e1a3) - [Refactor] explicitly coerce Error objects to strings. [`7f4ca84`](https://github.com/inspect-js/object-inspect/commit/7f4ca8424ee8dc2c0ca5a422d94f7fac40327261) - [Refactor] split up `var` declarations for debuggability [`6f2c11e`](https://github.com/inspect-js/object-inspect/commit/6f2c11e6a85418586a00292dcec5e97683f89bc3) - [Robustness] cache `Object.prototype.toString` [`df44a20`](https://github.com/inspect-js/object-inspect/commit/df44a20adfccf31529d60d1df2079bfc3c836e27) - [Dev Deps] update `tape` [`3ec714e`](https://github.com/inspect-js/object-inspect/commit/3ec714eba57bc3f58a6eb4fca1376f49e70d300a) - [Dev Deps] update `tape` [`beb72d9`](https://github.com/inspect-js/object-inspect/commit/beb72d969653747d7cde300393c28755375329b0) ## [v1.2.1](https://github.com/inspect-js/object-inspect/compare/v1.2.0...v1.2.1) - 2016-04-09 ### Fixed - [Fix] fix Boolean `false` object inspection. [`#7`](https://github.com/substack/object-inspect/pull/7) ## [v1.2.0](https://github.com/inspect-js/object-inspect/compare/v1.1.0...v1.2.0) - 2016-04-09 ### Fixed - [New] add support for inspecting String/Number/Boolean objects. [`#6`](https://github.com/inspect-js/object-inspect/issues/6) ### Commits - [Dev Deps] update `tape` [`742caa2`](https://github.com/inspect-js/object-inspect/commit/742caa262cf7af4c815d4821c8bd0129c1446432) ## [v1.1.0](https://github.com/inspect-js/object-inspect/compare/1.0.2...v1.1.0) - 2015-12-14 ### Merged - [New] add ES6 Map/Set support. [`#4`](https://github.com/inspect-js/object-inspect/pull/4) ### Fixed - [New] add ES6 Map/Set support. [`#3`](https://github.com/inspect-js/object-inspect/issues/3) ### Commits - Update `travis.yml` to test on bunches of `iojs` and `node` versions. [`4c1fd65`](https://github.com/inspect-js/object-inspect/commit/4c1fd65cc3bd95307e854d114b90478324287fd2) - [Dev Deps] update `tape` [`88a907e`](https://github.com/inspect-js/object-inspect/commit/88a907e33afbe408e4b5d6e4e42a33143f88848c) ## [1.0.2](https://github.com/inspect-js/object-inspect/compare/1.0.1...1.0.2) - 2015-08-07 ### Commits - [Fix] Cache `Object.prototype.hasOwnProperty` in case it's deleted later. [`1d0075d`](https://github.com/inspect-js/object-inspect/commit/1d0075d3091dc82246feeb1f9871cb2b8ed227b3) - [Dev Deps] Update `tape` [`ca8d5d7`](https://github.com/inspect-js/object-inspect/commit/ca8d5d75635ddbf76f944e628267581e04958457) - gitignore node_modules since this is a reusable modules. [`ed41407`](https://github.com/inspect-js/object-inspect/commit/ed41407811743ca530cdeb28f982beb96026af82) ## [1.0.1](https://github.com/inspect-js/object-inspect/compare/1.0.0...1.0.1) - 2015-07-19 ### Commits - Make `inspect` work with symbol primitives and objects, including in node 0.11 and 0.12. [`ddf1b94`](https://github.com/inspect-js/object-inspect/commit/ddf1b94475ab951f1e3bccdc0a48e9073cfbfef4) - bump tape [`103d674`](https://github.com/inspect-js/object-inspect/commit/103d67496b504bdcfdd765d303a773f87ec106e2) - use newer travis config [`d497276`](https://github.com/inspect-js/object-inspect/commit/d497276c1da14234bb5098a59cf20de75fbc316a) ## [1.0.0](https://github.com/inspect-js/object-inspect/compare/0.4.0...1.0.0) - 2014-08-05 ### Commits - error inspect works properly [`260a22d`](https://github.com/inspect-js/object-inspect/commit/260a22d134d3a8a482c67d52091c6040c34f4299) - seen coverage [`57269e8`](https://github.com/inspect-js/object-inspect/commit/57269e8baa992a7439047f47325111fdcbcb8417) - htmlelement instance coverage [`397ffe1`](https://github.com/inspect-js/object-inspect/commit/397ffe10a1980350868043ef9de65686d438979f) - more element coverage [`6905cc2`](https://github.com/inspect-js/object-inspect/commit/6905cc2f7df35600177e613b0642b4df5efd3eca) - failing test for type errors [`385b615`](https://github.com/inspect-js/object-inspect/commit/385b6152e49b51b68449a662f410b084ed7c601a) - fn name coverage [`edc906d`](https://github.com/inspect-js/object-inspect/commit/edc906d40fca6b9194d304062c037ee8e398c4c2) - server-side element test [`362d1d3`](https://github.com/inspect-js/object-inspect/commit/362d1d3e86f187651c29feeb8478110afada385b) - custom inspect fn [`e89b0f6`](https://github.com/inspect-js/object-inspect/commit/e89b0f6fe6d5e03681282af83732a509160435a6) - fixed browser test [`b530882`](https://github.com/inspect-js/object-inspect/commit/b5308824a1c8471c5617e394766a03a6977102a9) - depth test, matches node [`1cfd9e0`](https://github.com/inspect-js/object-inspect/commit/1cfd9e0285a4ae1dff44101ad482915d9bf47e48) - exercise hasOwnProperty path [`8d753fb`](https://github.com/inspect-js/object-inspect/commit/8d753fb362a534fa1106e4d80f2ee9bea06a66d9) - more cases covered for errors [`c5c46a5`](https://github.com/inspect-js/object-inspect/commit/c5c46a569ec4606583497e8550f0d8c7ad39a4a4) - \W obj key test case [`b0eceee`](https://github.com/inspect-js/object-inspect/commit/b0eceeea6e0eb94d686c1046e99b9e25e5005f75) - coverage for explicit depth param [`e12b91c`](https://github.com/inspect-js/object-inspect/commit/e12b91cd59683362f3a0e80f46481a0211e26c15) ## [0.4.0](https://github.com/inspect-js/object-inspect/compare/0.3.1...0.4.0) - 2014-03-21 ### Commits - passing lowbyte interpolation test [`b847511`](https://github.com/inspect-js/object-inspect/commit/b8475114f5def7e7961c5353d48d3d8d9a520985) - lowbyte test [`4a2b0e1`](https://github.com/inspect-js/object-inspect/commit/4a2b0e142667fc933f195472759385ac08f3946c) ## [0.3.1](https://github.com/inspect-js/object-inspect/compare/0.3.0...0.3.1) - 2014-03-04 ### Commits - sort keys [`a07b19c`](https://github.com/inspect-js/object-inspect/commit/a07b19cc3b1521a82d4fafb6368b7a9775428a05) ## [0.3.0](https://github.com/inspect-js/object-inspect/compare/0.2.0...0.3.0) - 2014-03-04 ### Commits - [] and {} instead of [ ] and { } [`654c44b`](https://github.com/inspect-js/object-inspect/commit/654c44b2865811f3519e57bb8526e0821caf5c6b) ## [0.2.0](https://github.com/inspect-js/object-inspect/compare/0.1.3...0.2.0) - 2014-03-04 ### Commits - failing holes test [`99cdfad`](https://github.com/inspect-js/object-inspect/commit/99cdfad03c6474740275a75636fe6ca86c77737a) - regex already work [`e324033`](https://github.com/inspect-js/object-inspect/commit/e324033267025995ec97d32ed0a65737c99477a6) - failing undef/null test [`1f88a00`](https://github.com/inspect-js/object-inspect/commit/1f88a00265d3209719dda8117b7e6360b4c20943) - holes in the all example [`7d345f3`](https://github.com/inspect-js/object-inspect/commit/7d345f3676dcbe980cff89a4f6c243269ebbb709) - check for .inspect(), fixes Buffer use-case [`c3f7546`](https://github.com/inspect-js/object-inspect/commit/c3f75466dbca125347d49847c05262c292f12b79) - fixes for holes [`ce25f73`](https://github.com/inspect-js/object-inspect/commit/ce25f736683de4b92ff27dc5471218415e2d78d8) - weird null behavior [`405c1ea`](https://github.com/inspect-js/object-inspect/commit/405c1ea72cd5a8cf3b498c3eaa903d01b9fbcab5) - tape is actually a devDependency, upgrade [`703b0ce`](https://github.com/inspect-js/object-inspect/commit/703b0ce6c5817b4245a082564bccd877e0bb6990) - put date in the example [`a342219`](https://github.com/inspect-js/object-inspect/commit/a3422190eeaa013215f46df2d0d37b48595ac058) - passing the null test [`4ab737e`](https://github.com/inspect-js/object-inspect/commit/4ab737ebf862a75d247ebe51e79307a34d6380d4) ## [0.1.3](https://github.com/inspect-js/object-inspect/compare/0.1.1...0.1.3) - 2013-07-26 ### Commits - special isElement() check [`882768a`](https://github.com/inspect-js/object-inspect/commit/882768a54035d30747be9de1baf14e5aa0daa128) - oh right old IEs don't have indexOf either [`36d1275`](https://github.com/inspect-js/object-inspect/commit/36d12756c38b08a74370b0bb696c809e529913a5) ## [0.1.1](https://github.com/inspect-js/object-inspect/compare/0.1.0...0.1.1) - 2013-07-26 ### Commits - tests! [`4422fd9`](https://github.com/inspect-js/object-inspect/commit/4422fd95532c2745aa6c4f786f35f1090be29998) - fix for ie&lt;9, doesn't have hasOwnProperty [`6b7d611`](https://github.com/inspect-js/object-inspect/commit/6b7d61183050f6da801ea04473211da226482613) - fix for all IEs: no f.name [`4e0c2f6`](https://github.com/inspect-js/object-inspect/commit/4e0c2f6dfd01c306d067d7163319acc97c94ee50) - badges [`5ed0d88`](https://github.com/inspect-js/object-inspect/commit/5ed0d88e4e407f9cb327fa4a146c17921f9680f3) ## [0.1.0](https://github.com/inspect-js/object-inspect/compare/0.0.0...0.1.0) - 2013-07-26 ### Commits - [Function] for functions [`ad5c485`](https://github.com/inspect-js/object-inspect/commit/ad5c485098fc83352cb540a60b2548ca56820e0b) ## 0.0.0 - 2013-07-26 ### Commits - working browser example [`34be6b6`](https://github.com/inspect-js/object-inspect/commit/34be6b6548f9ce92bdc3c27572857ba0c4a1218d) - package.json etc [`cad51f2`](https://github.com/inspect-js/object-inspect/commit/cad51f23fc6bcf1a456ed6abe16088256c2f632f) - docs complete [`b80cce2`](https://github.com/inspect-js/object-inspect/commit/b80cce2490c4e7183a9ee11ea89071f0abec4446) - circular example [`4b4a7b9`](https://github.com/inspect-js/object-inspect/commit/4b4a7b92209e4e6b4630976cb6bcd17d14165a59) - string rep [`7afb479`](https://github.com/inspect-js/object-inspect/commit/7afb479baa798d27f09e0a178b72ea327f60f5c8)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/object-inspect/CHANGELOG.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/object-inspect/CHANGELOG.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 34765 }
# obuf - Offset buffer implementation. Byte buffer specialized for data in chunks with special cases for dropping bytes in the front, merging bytes in to various integer types and abandoning buffer without penalty for previous chunk merges. Used in spyd-transport, part of spdy support for http2. This software is licensed under the MIT License. By Fedor Indutny, 2015.
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/obuf/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/obuf/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 373 }
2.4.1 / 2022-02-22 ================== * Fix error on early async hooks implementations 2.4.0 / 2022-02-21 ================== * Prevent loss of async hooks context 2.3.0 / 2015-05-26 ================== * Add defined behavior for HTTP `CONNECT` requests * Add defined behavior for HTTP `Upgrade` requests * deps: [email protected] 2.2.1 / 2015-04-22 ================== * Fix `isFinished(req)` when data buffered 2.2.0 / 2014-12-22 ================== * Add message object to callback arguments 2.1.1 / 2014-10-22 ================== * Fix handling of pipelined requests 2.1.0 / 2014-08-16 ================== * Check if `socket` is detached * Return `undefined` for `isFinished` if state unknown 2.0.0 / 2014-08-16 ================== * Add `isFinished` function * Move to `jshttp` organization * Remove support for plain socket argument * Rename to `on-finished` * Support both `req` and `res` as arguments * deps: [email protected] 1.2.2 / 2014-06-10 ================== * Reduce listeners added to emitters - avoids "event emitter leak" warnings when used multiple times on same request 1.2.1 / 2014-06-08 ================== * Fix returned value when already finished 1.2.0 / 2014-06-05 ================== * Call callback when called on already-finished socket 1.1.4 / 2014-05-27 ================== * Support node.js 0.8 1.1.3 / 2014-04-30 ================== * Make sure errors passed as instanceof `Error` 1.1.2 / 2014-04-18 ================== * Default the `socket` to passed-in object 1.1.1 / 2014-01-16 ================== * Rename module to `finished` 1.1.0 / 2013-12-25 ================== * Call callback when called on already-errored socket 1.0.1 / 2013-12-20 ================== * Actually pass the error to the callback 1.0.0 / 2013-12-20 ================== * Initial release
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/on-finished/HISTORY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/on-finished/HISTORY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1864 }
# on-finished [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-image]][node-url] [![Build Status][ci-image]][ci-url] [![Coverage Status][coveralls-image]][coveralls-url] Execute a callback when a HTTP request closes, finishes, or errors. ## Install This is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/). Installation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): ```sh $ npm install on-finished ``` ## API ```js var onFinished = require('on-finished') ``` ### onFinished(res, listener) Attach a listener to listen for the response to finish. The listener will be invoked only once when the response finished. If the response finished to an error, the first argument will contain the error. If the response has already finished, the listener will be invoked. Listening to the end of a response would be used to close things associated with the response, like open files. Listener is invoked as `listener(err, res)`. <!-- eslint-disable handle-callback-err --> ```js onFinished(res, function (err, res) { // clean up open fds, etc. // err contains the error if request error'd }) ``` ### onFinished(req, listener) Attach a listener to listen for the request to finish. The listener will be invoked only once when the request finished. If the request finished to an error, the first argument will contain the error. If the request has already finished, the listener will be invoked. Listening to the end of a request would be used to know when to continue after reading the data. Listener is invoked as `listener(err, req)`. <!-- eslint-disable handle-callback-err --> ```js var data = '' req.setEncoding('utf8') req.on('data', function (str) { data += str }) onFinished(req, function (err, req) { // data is read unless there is err }) ``` ### onFinished.isFinished(res) Determine if `res` is already finished. This would be useful to check and not even start certain operations if the response has already finished. ### onFinished.isFinished(req) Determine if `req` is already finished. This would be useful to check and not even start certain operations if the request has already finished. ## Special Node.js requests ### HTTP CONNECT method The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: > The CONNECT method requests that the recipient establish a tunnel to > the destination origin server identified by the request-target and, > if successful, thereafter restrict its behavior to blind forwarding > of packets, in both directions, until the tunnel is closed. Tunnels > are commonly used to create an end-to-end virtual connection, through > one or more proxies, which can then be secured using TLS (Transport > Layer Security, [RFC5246]). In Node.js, these request objects come from the `'connect'` event on the HTTP server. When this module is used on a HTTP `CONNECT` request, the request is considered "finished" immediately, **due to limitations in the Node.js interface**. This means if the `CONNECT` request contains a request entity, the request will be considered "finished" even before it has been read. There is no such thing as a response object to a `CONNECT` request in Node.js, so there is no support for one. ### HTTP Upgrade request The meaning of the `Upgrade` header from RFC 7230, section 6.1: > The "Upgrade" header field is intended to provide a simple mechanism > for transitioning from HTTP/1.1 to some other protocol on the same > connection. In Node.js, these request objects come from the `'upgrade'` event on the HTTP server. When this module is used on a HTTP request with an `Upgrade` header, the request is considered "finished" immediately, **due to limitations in the Node.js interface**. This means if the `Upgrade` request contains a request entity, the request will be considered "finished" even before it has been read. There is no such thing as a response object to a `Upgrade` request in Node.js, so there is no support for one. ## Example The following code ensures that file descriptors are always closed once the response finishes. ```js var destroy = require('destroy') var fs = require('fs') var http = require('http') var onFinished = require('on-finished') http.createServer(function onRequest (req, res) { var stream = fs.createReadStream('package.json') stream.pipe(res) onFinished(res, function () { destroy(stream) }) }) ``` ## License [MIT](LICENSE) [ci-image]: https://badgen.net/github/checks/jshttp/on-finished/master?label=ci [ci-url]: https://github.com/jshttp/on-finished/actions/workflows/ci.yml [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/on-finished/master [coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master [node-image]: https://badgen.net/npm/node/on-finished [node-url]: https://nodejs.org/en/download [npm-downloads-image]: https://badgen.net/npm/dm/on-finished [npm-url]: https://npmjs.org/package/on-finished [npm-version-image]: https://badgen.net/npm/v/on-finished
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/on-finished/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/on-finished/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 5159 }
1.0.2 / 2019-02-21 ================== * Fix `res.writeHead` patch missing return value 1.0.1 / 2015-09-29 ================== * perf: enable strict mode 1.0.0 / 2014-08-10 ================== * Honor `res.statusCode` change in `listener` * Move to `jshttp` organization * Prevent `arguments`-related de-opt 0.0.0 / 2014-05-13 ================== * Initial implementation
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/on-headers/HISTORY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/on-headers/HISTORY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 386 }
# on-headers [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-version-image]][node-version-url] [![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] Execute a listener when a response is about to write headers. ## Installation This is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/). Installation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): ```sh $ npm install on-headers ``` ## API <!-- eslint-disable no-unused-vars --> ```js var onHeaders = require('on-headers') ``` ### onHeaders(res, listener) This will add the listener `listener` to fire when headers are emitted for `res`. The listener is passed the `response` object as it's context (`this`). Headers are considered to be emitted only once, right before they are sent to the client. When this is called multiple times on the same `res`, the `listener`s are fired in the reverse order they were added. ## Examples ```js var http = require('http') var onHeaders = require('on-headers') http .createServer(onRequest) .listen(3000) function addPoweredBy () { // set if not set by end of request if (!this.getHeader('X-Powered-By')) { this.setHeader('X-Powered-By', 'Node.js') } } function onRequest (req, res) { onHeaders(res, addPoweredBy) res.setHeader('Content-Type', 'text/plain') res.end('hello!') } ``` ## Testing ```sh $ npm test ``` ## License [MIT](LICENSE) [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/on-headers/master [coveralls-url]: https://coveralls.io/r/jshttp/on-headers?branch=master [node-version-image]: https://badgen.net/npm/node/on-headers [node-version-url]: https://nodejs.org/en/download [npm-downloads-image]: https://badgen.net/npm/dm/on-headers [npm-url]: https://npmjs.org/package/on-headers [npm-version-image]: https://badgen.net/npm/v/on-headers [travis-image]: https://badgen.net/travis/jshttp/on-headers/master [travis-url]: https://travis-ci.org/jshttp/on-headers
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/on-headers/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/on-headers/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2154 }
All packages under `src/` are licensed according to the terms in their respective `LICENSE` or `LICENSE.md` files. The remainder of this project is licensed under the Blue Oak Model License, as follows: ----- # Blue Oak Model License Version 1.0.0 ## Purpose This license gives everyone as much permission to work with this software as possible, while protecting contributors from liability. ## Acceptance In order to receive this license, you must agree to its rules. The rules of this license are both obligations under that agreement and conditions to your license. You must not do anything with this software that triggers a rule that you cannot or will not follow. ## Copyright Each contributor licenses you to do everything with this software that would otherwise infringe that contributor's copyright in it. ## Notices You must ensure that everyone who gets a copy of any part of this software from you, with or without changes, also gets the text of this license or a link to <https://blueoakcouncil.org/license/1.0.0>. ## Excuse If anyone notifies you in writing that you have not complied with [Notices](#notices), you can keep your license by taking all practical steps to comply within 30 days after the notice. If you do not do so, your license ends immediately. ## Patent Each contributor licenses you to do everything with this software that would otherwise infringe any patent claims they can license or become able to license. ## Reliability No contributor can revoke this license. ## No Liability ***As far as the law allows, this software comes as is, without any warranty or condition, and no contributor will be liable to anyone for any damages related to this software or this license, under any kind of legal claim.***
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/package-json-from-dist/LICENSE.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/package-json-from-dist/LICENSE.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1763 }
# package-json-from-dist Sometimes you want to load the `package.json` into your TypeScript program, and it's tempting to just `import '../package.json'`, since that seems to work. However, this requires `tsc` to make an entire copy of your `package.json` file into the `dist` folder, which is a problem if you're using something like [tshy](https://github.com/isaacs/tshy), which uses the `package.json` file in dist for another purpose. Even when that does work, it's asking the module system to do a bunch of extra fs system calls, just to load a version number or something. (See [this issue](https://github.com/isaacs/tshy/issues/61).) This module helps by just finding the package.json file appropriately, and reading and parsing it in the most normal fashion. ## Caveats This _only_ works if your code builds into a target folder called `dist`, which is in the root of the package. It also requires that you do not have a folder named `node_modules` anywhere within your dev environment, or else it'll get the wrong answers there. (But, at least, that'll be in dev, so you're pretty likely to notice.) If you build to some other location, then you'll need a different approach. (Feel free to fork this module and make it your own, or just put the code right inline, there's not much of it.) ## USAGE ```js // src/index.ts import { findPackageJson, loadPackageJson, } from 'package-json-from-dist' const pj = findPackageJson(import.meta.url) console.log(`package.json found at ${pj}`) const pkg = loadPackageJson(import.meta.url) console.log(`Hello from ${pkg.name}@${pkg.version}`) ``` If your module is not directly in the `./src` folder, then you need to specify the path that you would expect to find the `package.json` when it's _not_ built to the `dist` folder. ```js // src/components/something.ts import { findPackageJson, loadPackageJson, } from 'package-json-from-dist' const pj = findPackageJson(import.meta.url, '../../package.json') console.log(`package.json found at ${pj}`) const pkg = loadPackageJson(import.meta.url, '../../package.json') console.log(`Hello from ${pkg.name}@${pkg.version}`) ``` When running from CommmonJS, use `__filename` instead of `import.meta.url`. ```js // src/index.cts import { findPackageJson, loadPackageJson, } from 'package-json-from-dist' const pj = findPackageJson(__filename) console.log(`package.json found at ${pj}`) const pkg = loadPackageJson(__filename) console.log(`Hello from ${pkg.name}@${pkg.version}`) ``` Since [tshy](https://github.com/isaacs/tshy) builds _both_ CommonJS and ESM by default, you may find that you need a CommonJS override and some `//@ts-ignore` magic to make it work. `src/pkg.ts`: ```js import { findPackageJson, loadPackageJson, } from 'package-json-from-dist' //@ts-ignore export const pkg = loadPackageJson(import.meta.url) //@ts-ignore export const pj = findPackageJson(import.meta.url) ``` `src/pkg-cjs.cts`: ```js import { findPackageJson, loadPackageJson, } from 'package-json-from-dist' export const pkg = loadPackageJson(__filename) export const pj = findPackageJson(__filename) ```
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/package-json-from-dist/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/package-json-from-dist/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 3121 }
1.3.3 / 2019-04-15 ================== * Fix Node.js 0.8 return value inconsistencies 1.3.2 / 2017-09-09 ================== * perf: reduce overhead for full URLs * perf: unroll the "fast-path" `RegExp` 1.3.1 / 2016-01-17 ================== * perf: enable strict mode 1.3.0 / 2014-08-09 ================== * Add `parseurl.original` for parsing `req.originalUrl` with fallback * Return `undefined` if `req.url` is `undefined` 1.2.0 / 2014-07-21 ================== * Cache URLs based on original value * Remove no-longer-needed URL mis-parse work-around * Simplify the "fast-path" `RegExp` 1.1.3 / 2014-07-08 ================== * Fix typo 1.1.2 / 2014-07-08 ================== * Seriously fix Node.js 0.8 compatibility 1.1.1 / 2014-07-08 ================== * Fix Node.js 0.8 compatibility 1.1.0 / 2014-07-08 ================== * Incorporate URL href-only parse fast-path 1.0.1 / 2014-03-08 ================== * Add missing `require` 1.0.0 / 2014-03-08 ================== * Genesis from `connect`
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/parseurl/HISTORY.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/parseurl/HISTORY.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1042 }
# parseurl [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-image]][node-url] [![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] Parse a URL with memoization. ## Install This is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/). Installation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): ```sh $ npm install parseurl ``` ## API ```js var parseurl = require('parseurl') ``` ### parseurl(req) Parse the URL of the given request object (looks at the `req.url` property) and return the result. The result is the same as `url.parse` in Node.js core. Calling this function multiple times on the same `req` where `req.url` does not change will return a cached parsed object, rather than parsing again. ### parseurl.original(req) Parse the original URL of the given request object and return the result. This works by trying to parse `req.originalUrl` if it is a string, otherwise parses `req.url`. The result is the same as `url.parse` in Node.js core. Calling this function multiple times on the same `req` where `req.originalUrl` does not change will return a cached parsed object, rather than parsing again. ## Benchmark ```bash $ npm run-script bench > [email protected] bench nodejs-parseurl > node benchmark/index.js [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] modules@64 [email protected] napi@3 [email protected] [email protected] [email protected] [email protected] tz@2018c > node benchmark/fullurl.js Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy" 4 tests completed. fasturl x 2,207,842 ops/sec ±3.76% (184 runs sampled) nativeurl - legacy x 507,180 ops/sec ±0.82% (191 runs sampled) nativeurl - whatwg x 290,044 ops/sec ±1.96% (189 runs sampled) parseurl x 488,907 ops/sec ±2.13% (192 runs sampled) > node benchmark/pathquery.js Parsing URL "/foo/bar?user=tj&pet=fluffy" 4 tests completed. fasturl x 3,812,564 ops/sec ±3.15% (188 runs sampled) nativeurl - legacy x 2,651,631 ops/sec ±1.68% (189 runs sampled) nativeurl - whatwg x 161,837 ops/sec ±2.26% (189 runs sampled) parseurl x 4,166,338 ops/sec ±2.23% (184 runs sampled) > node benchmark/samerequest.js Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object 4 tests completed. fasturl x 3,821,651 ops/sec ±2.42% (185 runs sampled) nativeurl - legacy x 2,651,162 ops/sec ±1.90% (187 runs sampled) nativeurl - whatwg x 175,166 ops/sec ±1.44% (188 runs sampled) parseurl x 14,912,606 ops/sec ±3.59% (183 runs sampled) > node benchmark/simplepath.js Parsing URL "/foo/bar" 4 tests completed. fasturl x 12,421,765 ops/sec ±2.04% (191 runs sampled) nativeurl - legacy x 7,546,036 ops/sec ±1.41% (188 runs sampled) nativeurl - whatwg x 198,843 ops/sec ±1.83% (189 runs sampled) parseurl x 24,244,006 ops/sec ±0.51% (194 runs sampled) > node benchmark/slash.js Parsing URL "/" 4 tests completed. fasturl x 17,159,456 ops/sec ±3.25% (188 runs sampled) nativeurl - legacy x 11,635,097 ops/sec ±3.79% (184 runs sampled) nativeurl - whatwg x 240,693 ops/sec ±0.83% (189 runs sampled) parseurl x 42,279,067 ops/sec ±0.55% (190 runs sampled) ``` ## License [MIT](LICENSE) [coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/parseurl/master [coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master [node-image]: https://badgen.net/npm/node/parseurl [node-url]: https://nodejs.org/en/download [npm-downloads-image]: https://badgen.net/npm/dm/parseurl [npm-url]: https://npmjs.org/package/parseurl [npm-version-image]: https://badgen.net/npm/v/parseurl [travis-image]: https://badgen.net/travis/pillarjs/parseurl/master [travis-url]: https://travis-ci.org/pillarjs/parseurl
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/parseurl/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/parseurl/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 4073 }
# passport-local [![Build](https://travis-ci.org/jaredhanson/passport-local.png)](https://travis-ci.org/jaredhanson/passport-local) [![Coverage](https://coveralls.io/repos/jaredhanson/passport-local/badge.png)](https://coveralls.io/r/jaredhanson/passport-local) [![Quality](https://codeclimate.com/github/jaredhanson/passport-local.png)](https://codeclimate.com/github/jaredhanson/passport-local) [![Dependencies](https://david-dm.org/jaredhanson/passport-local.png)](https://david-dm.org/jaredhanson/passport-local) [![Tips](http://img.shields.io/gittip/jaredhanson.png)](https://www.gittip.com/jaredhanson/) [Passport](http://passportjs.org/) strategy for authenticating with a username and password. This module lets you authenticate using a username and password in your Node.js applications. By plugging into Passport, local authentication can be easily and unobtrusively integrated into any application or framework that supports [Connect](http://www.senchalabs.org/connect/)-style middleware, including [Express](http://expressjs.com/). ## Install $ npm install passport-local ## Usage #### Configure Strategy The local authentication strategy authenticates users using a username and password. The strategy requires a `verify` callback, which accepts these credentials and calls `done` providing a user. passport.use(new LocalStrategy( function(username, password, done) { User.findOne({ username: username }, function (err, user) { if (err) { return done(err); } if (!user) { return done(null, false); } if (!user.verifyPassword(password)) { return done(null, false); } return done(null, user); }); } )); #### Authenticate Requests Use `passport.authenticate()`, specifying the `'local'` strategy, to authenticate requests. For example, as route middleware in an [Express](http://expressjs.com/) application: app.post('/login', passport.authenticate('local', { failureRedirect: '/login' }), function(req, res) { res.redirect('/'); }); ## Examples For complete, working examples, refer to the multiple [examples](https://github.com/jaredhanson/passport-local/tree/master/examples) included. ## Tests $ npm install $ npm test ## Credits - [Jared Hanson](http://github.com/jaredhanson) ## License [The MIT License](http://opensource.org/licenses/MIT) Copyright (c) 2011-2014 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/passport-local/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/passport-local/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2492 }
# passport-strategy [![Build](https://travis-ci.org/jaredhanson/passport-strategy.png)](http://travis-ci.org/jaredhanson/passport-strategy) [![Coverage](https://coveralls.io/repos/jaredhanson/passport-strategy/badge.png)](https://coveralls.io/r/jaredhanson/passport-strategy) [![Dependencies](https://david-dm.org/jaredhanson/passport-strategy.png)](http://david-dm.org/jaredhanson/passport-strategy) An abstract class implementing [Passport](http://passportjs.org/)'s strategy API. ## Install $ npm install passport-strategy ## Usage This module exports an abstract `Strategy` class that is intended to be subclassed when implementing concrete authentication strategies. Once implemented, such strategies can be used by applications that utilize Passport middleware for authentication. #### Subclass Strategy Create a new `CustomStrategy` constructor which inherits from `Strategy`: ```javascript var util = require('util') , Strategy = require('passport-strategy'); function CustomStrategy(...) { Strategy.call(this); } util.inherits(CustomStrategy, Strategy); ``` #### Implement Authentication Implement `autheticate()`, performing the necessary operations required by the authentication scheme or protocol being implemented. ```javascript CustomStrategy.prototype.authenticate = function(req, options) { // TODO: authenticate request } ``` ## Tests $ npm install $ npm test ## Credits - [Jared Hanson](http://github.com/jaredhanson) ## License [The MIT License](http://opensource.org/licenses/MIT) Copyright (c) 2011-2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/passport-strategy/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/passport-strategy/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1634 }
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ## [0.7.0] - 2023-11-27 ### Changed - Set `req.authInfo` by default when using the `assignProperty` option to `authenticate()` middleware. This makes the behavior the same as when not using the option, and can be disabled by setting `authInfo` option to `false`. ## [0.6.0] - 2022-05-20 ### Added - `authenticate()`, `req#login`, and `req#logout` accept a `keepSessionInfo: true` option to keep session information after regenerating the session. ### Changed - `req#login()` and `req#logout()` regenerate the the session and clear session information by default. - `req#logout()` is now an asynchronous function and requires a callback function as the last argument. ### Security - Improved robustness against session fixation attacks in cases where there is physical access to the same system or the application is susceptible to cross-site scripting (XSS). ## [0.5.3] - 2022-05-16 ### Fixed - `initialize()` middleware extends request with `login()`, `logIn()`, `logout()`, `logOut()`, `isAuthenticated()`, and `isUnauthenticated()` functions again, reverting change from 0.5.1. ## [0.5.2] - 2021-12-16 ### Fixed - Introduced a compatibility layer for strategies that depend directly on `[email protected]` or earlier (such as `passport-azure-ad`), which were broken by the removal of private variables in `[email protected]`. ## [0.5.1] - 2021-12-15 ### Added - Informative error message in session strategy if session support is not available. ### Changed - `authenticate()` middleware, rather than `initialize()` middleware, extends request with `login()`, `logIn()`, `logout()`, `logOut()`, `isAuthenticated()`, and `isUnauthenticated()` functions. ## [0.5.0] - 2021-09-23 ### Changed - `initialize()` middleware extends request with `login()`, `logIn()`, `logout()`, `logOut()`, `isAuthenticated()`, and `isUnauthenticated()` functions. ### Removed - `login()`, `logIn()`, `logout()`, `logOut()`, `isAuthenticated()`, and `isUnauthenticated()` functions no longer added to `http.IncomingMessage.prototype`. ### Fixed - `userProperty` option to `initialize()` middleware only affects the current request, rather than all requests processed via singleton Passport instance, eliminating a race condition in situations where `initialize()` middleware is used multiple times in an application with `userProperty` set to different values. [Unreleased]: https://github.com/jaredhanson/passport/compare/v0.6.0...HEAD [0.6.0]: https://github.com/jaredhanson/passport/compare/v0.5.3...v0.6.0 [0.5.3]: https://github.com/jaredhanson/passport/compare/v0.5.2...v0.5.3 [0.5.2]: https://github.com/jaredhanson/passport/compare/v0.5.1...v0.5.2 [0.5.1]: https://github.com/jaredhanson/passport/compare/v0.5.0...v0.5.1
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/passport/CHANGELOG.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/passport/CHANGELOG.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 2989 }
[![passport banner](http://cdn.auth0.com/img/passport-banner-github.png)](http://passportjs.org) # Passport Passport is [Express](http://expressjs.com/)-compatible authentication middleware for [Node.js](http://nodejs.org/). Passport's sole purpose is to authenticate requests, which it does through an extensible set of plugins known as _strategies_. Passport does not mount routes or assume any particular database schema, which maximizes flexibility and allows application-level decisions to be made by the developer. The API is simple: you provide Passport a request to authenticate, and Passport provides hooks for controlling what occurs when authentication succeeds or fails. --- <p align="center"> <sup>Sponsors</sup> <br> <a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=passport_js&utm_source=github"><img src="https://raw.githubusercontent.com/jaredhanson/passport/master/sponsors/workos.png"></a><br/> <a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=passport_js&utm_source=github"><b>Your app, enterprise-ready.</b><br/>Start selling to enterprise customers with just a few lines of code. Add Single Sign-On (and more) in minutes instead of months.</a> <br> <br> <a href="https://www.descope.com/?utm_source=PassportJS&utm_medium=referral&utm_campaign=oss-sponsorship"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/jaredhanson/passport/master/sponsors/descope-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/jaredhanson/passport/master/sponsors/descope.svg"> <img src="https://raw.githubusercontent.com/jaredhanson/passport/master/sponsors/descope.svg" width="275"> </picture> </a><br/> <a href="https://www.descope.com/?utm_source=PassportJS&utm_medium=referral&utm_campaign=oss-sponsorship"><b>Drag and drop your auth</b><br/>Add authentication and user management to your consumer and business apps with a few lines of code.</a> <br> <br> <a href="https://fusionauth.io/?utm_source=passportjs&utm_medium=referral&utm_campaign=sponsorship"><img src="https://raw.githubusercontent.com/jaredhanson/passport/master/sponsors/fusionauth.png" width="275"></a><br/> <a href="https://fusionauth.io/?utm_source=passportjs&utm_medium=referral&utm_campaign=sponsorship"><b>Auth. Built for Devs, by Devs</b><br/>Add login, registration, SSO, MFA, and a bazillion other features to your app in minutes. Integrates with any codebase and installs on any server, anywhere in the world.</a> </p> --- Status: [![Build](https://travis-ci.org/jaredhanson/passport.svg?branch=master)](https://travis-ci.org/jaredhanson/passport) [![Coverage](https://coveralls.io/repos/jaredhanson/passport/badge.svg?branch=master)](https://coveralls.io/r/jaredhanson/passport) [![Dependencies](https://david-dm.org/jaredhanson/passport.svg)](https://david-dm.org/jaredhanson/passport) ## Install ``` $ npm install passport ``` ## Usage #### Strategies Passport uses the concept of strategies to authenticate requests. Strategies can range from verifying username and password credentials, delegated authentication using [OAuth](http://oauth.net/) (for example, via [Facebook](http://www.facebook.com/) or [Twitter](http://twitter.com/)), or federated authentication using [OpenID](http://openid.net/). Before authenticating requests, the strategy (or strategies) used by an application must be configured. ```javascript passport.use(new LocalStrategy( function(username, password, done) { User.findOne({ username: username }, function (err, user) { if (err) { return done(err); } if (!user) { return done(null, false); } if (!user.verifyPassword(password)) { return done(null, false); } return done(null, user); }); } )); ``` There are 480+ strategies. Find the ones you want at: [passportjs.org](http://passportjs.org) #### Sessions Passport will maintain persistent login sessions. In order for persistent sessions to work, the authenticated user must be serialized to the session, and deserialized when subsequent requests are made. Passport does not impose any restrictions on how your user records are stored. Instead, you provide functions to Passport which implements the necessary serialization and deserialization logic. In a typical application, this will be as simple as serializing the user ID, and finding the user by ID when deserializing. ```javascript passport.serializeUser(function(user, done) { done(null, user.id); }); passport.deserializeUser(function(id, done) { User.findById(id, function (err, user) { done(err, user); }); }); ``` #### Middleware To use Passport in an [Express](http://expressjs.com/) or [Connect](http://senchalabs.github.com/connect/)-based application, configure it with the required `passport.initialize()` middleware. If your application uses persistent login sessions (recommended, but not required), `passport.session()` middleware must also be used. ```javascript var app = express(); app.use(require('serve-static')(__dirname + '/../../public')); app.use(require('cookie-parser')()); app.use(require('body-parser').urlencoded({ extended: true })); app.use(require('express-session')({ secret: 'keyboard cat', resave: true, saveUninitialized: true })); app.use(passport.initialize()); app.use(passport.session()); ``` #### Authenticate Requests Passport provides an `authenticate()` function, which is used as route middleware to authenticate requests. ```javascript app.post('/login', passport.authenticate('local', { failureRedirect: '/login' }), function(req, res) { res.redirect('/'); }); ``` ## Strategies Passport has a comprehensive set of **over 480** authentication strategies covering social networking, enterprise integration, API services, and more. ## Search all strategies There is a **Strategy Search** at [passportjs.org](http://passportjs.org) The following table lists commonly used strategies: |Strategy | Protocol |Developer | |---------------------------------------------------------------|--------------------------|------------------------------------------------| |[Local](https://github.com/jaredhanson/passport-local) | HTML form |[Jared Hanson](https://github.com/jaredhanson) | |[OpenID](https://github.com/jaredhanson/passport-openid) | OpenID |[Jared Hanson](https://github.com/jaredhanson) | |[BrowserID](https://github.com/jaredhanson/passport-browserid) | BrowserID |[Jared Hanson](https://github.com/jaredhanson) | |[Facebook](https://github.com/jaredhanson/passport-facebook) | OAuth 2.0 |[Jared Hanson](https://github.com/jaredhanson) | |[Google](https://github.com/jaredhanson/passport-google) | OpenID |[Jared Hanson](https://github.com/jaredhanson) | |[Google](https://github.com/jaredhanson/passport-google-oauth) | OAuth / OAuth 2.0 |[Jared Hanson](https://github.com/jaredhanson) | |[Twitter](https://github.com/jaredhanson/passport-twitter) | OAuth |[Jared Hanson](https://github.com/jaredhanson) | |[Azure Active Directory](https://github.com/AzureAD/passport-azure-ad) | OAuth 2.0 / OpenID / SAML |[Azure](https://github.com/azuread) | ## Examples - For a complete, working example, refer to the [example](https://github.com/passport/express-4.x-local-example) that uses [passport-local](https://github.com/jaredhanson/passport-local). - **Local Strategy**: Refer to the following tutorials for setting up user authentication via LocalStrategy (`passport-local`): - Mongo - Express v3x - [Tutorial](http://mherman.org/blog/2016/09/25/node-passport-and-postgres/#.V-govpMrJE5) / [working example](https://github.com/mjhea0/passport-local-knex) - Express v4x - [Tutorial](http://mherman.org/blog/2015/01/31/local-authentication-with-passport-and-express-4/) / [working example](https://github.com/mjhea0/passport-local-express4) - Postgres - [Tutorial](http://mherman.org/blog/2015/01/31/local-authentication-with-passport-and-express-4/) / [working example](https://github.com/mjhea0/passport-local-express4) - **Social Authentication**: Refer to the following tutorials for setting up various social authentication strategies: - Express v3x - [Tutorial](http://mherman.org/blog/2013/11/10/social-authentication-with-passport-dot-js/) / [working example](https://github.com/mjhea0/passport-examples) - Express v4x - [Tutorial](http://mherman.org/blog/2015/09/26/social-authentication-in-node-dot-js-with-passport) / [working example](https://github.com/mjhea0/passport-social-auth) ## Related Modules - [Locomotive](https://github.com/jaredhanson/locomotive) — Powerful MVC web framework - [OAuthorize](https://github.com/jaredhanson/oauthorize) — OAuth service provider toolkit - [OAuth2orize](https://github.com/jaredhanson/oauth2orize) — OAuth 2.0 authorization server toolkit - [connect-ensure-login](https://github.com/jaredhanson/connect-ensure-login) — middleware to ensure login sessions The [modules](https://github.com/jaredhanson/passport/wiki/Modules) page on the [wiki](https://github.com/jaredhanson/passport/wiki) lists other useful modules that build upon or integrate with Passport. ## License [The MIT License](http://opensource.org/licenses/MIT) Copyright (c) 2011-2021 Jared Hanson <[https://www.jaredhanson.me/](https://www.jaredhanson.me/)>
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/passport/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/passport/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 9656 }
# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) > Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform It's usually `PATH`, but on Windows it can be any casing like `Path`... ## Install ``` $ npm install path-key ``` ## Usage ```js const pathKey = require('path-key'); const key = pathKey(); //=> 'PATH' const PATH = process.env[key]; //=> '/usr/local/bin:/usr/bin:/bin' ``` ## API ### pathKey(options?) #### options Type: `object` ##### env Type: `object`<br> Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env) Use a custom environment variables object. #### platform Type: `string`<br> Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform) Get the PATH key for a specific platform. --- <div align="center"> <b> <a href="https://tidelift.com/subscription/pkg/npm-path-key?utm_source=npm-path-key&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a> </b> <br> <sub> Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies. </sub> </div>
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/path-key/readme.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/path-key/readme.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1346 }
# path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) > Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com). ## Install ``` $ npm install --save path-parse ``` ## Usage ```js var pathParse = require('path-parse'); pathParse('/home/user/dir/file.txt'); //=> { // root : "/", // dir : "/home/user/dir", // base : "file.txt", // ext : ".txt", // name : "file" // } ``` ## API See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. ### pathParse(path) ### pathParse.posix(path) The Posix specific version. ### pathParse.win32(path) The Windows specific version. ## License MIT © [Javier Blanco](http://jbgutierrez.info)
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/path-parse/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/path-parse/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 869 }
# Blue Oak Model License Version 1.0.0 ## Purpose This license gives everyone as much permission to work with this software as possible, while protecting contributors from liability. ## Acceptance In order to receive this license, you must agree to its rules. The rules of this license are both obligations under that agreement and conditions to your license. You must not do anything with this software that triggers a rule that you cannot or will not follow. ## Copyright Each contributor licenses you to do everything with this software that would otherwise infringe that contributor's copyright in it. ## Notices You must ensure that everyone who gets a copy of any part of this software from you, with or without changes, also gets the text of this license or a link to <https://blueoakcouncil.org/license/1.0.0>. ## Excuse If anyone notifies you in writing that you have not complied with [Notices](#notices), you can keep your license by taking all practical steps to comply within 30 days after the notice. If you do not do so, your license ends immediately. ## Patent Each contributor licenses you to do everything with this software that would otherwise infringe any patent claims they can license or become able to license. ## Reliability No contributor can revoke this license. ## No Liability ***As far as the law allows, this software comes as is, without any warranty or condition, and no contributor will be liable to anyone for any damages related to this software or this license, under any kind of legal claim.***
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/path-scurry/LICENSE.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/path-scurry/LICENSE.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1551 }
# path-scurry Extremely high performant utility for building tools that read the file system, minimizing filesystem and path string munging operations to the greatest degree possible. ## Ugh, yet another file traversal thing on npm? Yes. None of the existing ones gave me exactly what I wanted. ## Well what is it you wanted? While working on [glob](http://npm.im/glob), I found that I needed a module to very efficiently manage the traversal over a folder tree, such that: 1. No `readdir()` or `stat()` would ever be called on the same file or directory more than one time. 2. No `readdir()` calls would be made if we can be reasonably sure that the path is not a directory. (Ie, a previous `readdir()` or `stat()` covered the path, and `ent.isDirectory()` is false.) 3. `path.resolve()`, `dirname()`, `basename()`, and other string-parsing/munging operations are be minimized. This means it has to track "provisional" child nodes that may not exist (and if we find that they _don't_ exist, store that information as well, so we don't have to ever check again). 4. The API is not limited to use as a stream/iterator/etc. There are many cases where an API like node's `fs` is preferrable. 5. It's more important to prevent excess syscalls than to be up to date, but it should be smart enough to know what it _doesn't_ know, and go get it seamlessly when requested. 6. Do not blow up the JS heap allocation if operating on a directory with a huge number of entries. 7. Handle all the weird aspects of Windows paths, like UNC paths and drive letters and wrongway slashes, so that the consumer can return canonical platform-specific paths without having to parse or join or do any error-prone string munging. ## PERFORMANCE JavaScript people throw around the word "blazing" a lot. I hope that this module doesn't blaze anyone. But it does go very fast, in the cases it's optimized for, if used properly. PathScurry provides ample opportunities to get extremely good performance, as well as several options to trade performance for convenience. Benchmarks can be run by executing `npm run bench`. As is always the case, doing more means going slower, doing less means going faster, and there are trade offs between speed and memory usage. PathScurry makes heavy use of [LRUCache](http://npm.im/lru-cache) to efficiently cache whatever it can, and `Path` objects remain in the graph for the lifetime of the walker, so repeated calls with a single PathScurry object will be extremely fast. However, adding items to a cold cache means "doing more", so in those cases, we pay a price. Nothing is free, but every effort has been made to reduce costs wherever possible. Also, note that a "cache as long as possible" approach means that changes to the filesystem may not be reflected in the results of repeated PathScurry operations. For resolving string paths, `PathScurry` ranges from 5-50 times faster than `path.resolve` on repeated resolutions, but around 100 to 1000 times _slower_ on the first resolution. If your program is spending a lot of time resolving the _same_ paths repeatedly (like, thousands or millions of times), then this can be beneficial. But both implementations are pretty fast, and speeding up an infrequent operation from 4µs to 400ns is not going to move the needle on your app's performance. For walking file system directory trees, a lot depends on how often a given PathScurry object will be used, and also on the walk method used. With default settings on a folder tree of 100,000 items, consisting of around a 10-to-1 ratio of normal files to directories, PathScurry performs comparably to [@nodelib/fs.walk](http://npm.im/@nodelib/fs.walk), which is the fastest and most reliable file system walker I could find. As far as I can tell, it's almost impossible to go much faster in a Node.js program, just based on how fast you can push syscalls out to the fs thread pool. On my machine, that is about 1000-1200 completed walks per second for async or stream walks, and around 500-600 walks per second synchronously. In the warm cache state, PathScurry's performance increases around 4x for async `for await` iteration, 10-15x faster for streams and synchronous `for of` iteration, and anywhere from 30x to 80x faster for the rest. ``` # walk 100,000 fs entries, 10/1 file/dir ratio # operations / ms New PathScurry object | Reuse PathScurry object stream: 1112.589 | 13974.917 sync stream: 492.718 | 15028.343 async walk: 1095.648 | 32706.395 sync walk: 527.632 | 46129.772 async iter: 1288.821 | 5045.510 sync iter: 498.496 | 17920.746 ``` A hand-rolled walk calling `entry.readdir()` and recursing through the entries can benefit even more from caching, with greater flexibility and without the overhead of streams or generators. The cold cache state is still limited by the costs of file system operations, but with a warm cache, the only bottleneck is CPU speed and VM optimizations. Of course, in that case, some care must be taken to ensure that you don't lose performance as a result of silly mistakes, like calling `readdir()` on entries that you know are not directories. ``` # manual recursive iteration functions cold cache | warm cache async: 1164.901 | 17923.320 cb: 1101.127 | 40999.344 zalgo: 1082.240 | 66689.936 sync: 526.935 | 87097.591 ``` In this case, the speed improves by around 10-20x in the async case, 40x in the case of using `entry.readdirCB` with protections against synchronous callbacks, and 50-100x with callback deferrals disabled, and _several hundred times faster_ for synchronous iteration. If you can think of a case that is not covered in these benchmarks, or an implementation that performs significantly better than PathScurry, please [let me know](https://github.com/isaacs/path-scurry/issues). ## USAGE ```ts // hybrid module, load with either method import { PathScurry, Path } from 'path-scurry' // or: const { PathScurry, Path } = require('path-scurry') // very simple example, say we want to find and // delete all the .DS_Store files in a given path // note that the API is very similar to just a // naive walk with fs.readdir() import { unlink } from 'fs/promises' // easy way, iterate over the directory and do the thing const pw = new PathScurry(process.cwd()) for await (const entry of pw) { if (entry.isFile() && entry.name === '.DS_Store') { unlink(entry.fullpath()) } } // here it is as a manual recursive method const walk = async (entry: Path) => { const promises: Promise<any> = [] // readdir doesn't throw on non-directories, it just doesn't // return any entries, to save stack trace costs. // Items are returned in arbitrary unsorted order for (const child of await pw.readdir(entry)) { // each child is a Path object if (child.name === '.DS_Store' && child.isFile()) { // could also do pw.resolve(entry, child.name), // just like fs.readdir walking, but .fullpath is // a *slightly* more efficient shorthand. promises.push(unlink(child.fullpath())) } else if (child.isDirectory()) { promises.push(walk(child)) } } return Promise.all(promises) } walk(pw.cwd).then(() => { console.log('all .DS_Store files removed') }) const pw2 = new PathScurry('/a/b/c') // pw2.cwd is the Path for /a/b/c const relativeDir = pw2.cwd.resolve('../x') // Path entry for '/a/b/x' const relative2 = pw2.cwd.resolve('/a/b/d/../x') // same path, same entry assert.equal(relativeDir, relative2) ``` ## API [Full TypeDoc API](https://isaacs.github.io/path-scurry) There are platform-specific classes exported, but for the most part, the default `PathScurry` and `Path` exports are what you most likely need, unless you are testing behavior for other platforms. Intended public API is documented here, but the full documentation does include internal types, which should not be accessed directly. ### Interface `PathScurryOpts` The type of the `options` argument passed to the `PathScurry` constructor. - `nocase`: Boolean indicating that file names should be compared case-insensitively. Defaults to `true` on darwin and win32 implementations, `false` elsewhere. **Warning** Performing case-insensitive matching on a case-sensitive filesystem will result in occasionally very bizarre behavior. Performing case-sensitive matching on a case-insensitive filesystem may negatively impact performance. - `childrenCacheSize`: Number of child entries to cache, in order to speed up `resolve()` and `readdir()` calls. Defaults to `16 * 1024` (ie, `16384`). Setting it to a higher value will run the risk of JS heap allocation errors on large directory trees. Setting it to `256` or smaller will significantly reduce the construction time and data consumption overhead, but with the downside of operations being slower on large directory trees. Setting it to `0` will mean that effectively no operations are cached, and this module will be roughly the same speed as `fs` for file system operations, and _much_ slower than `path.resolve()` for repeated path resolution. - `fs` An object that will be used to override the default `fs` methods. Any methods that are not overridden will use Node's built-in implementations. - lstatSync - readdir (callback `withFileTypes` Dirent variant, used for readdirCB and most walks) - readdirSync - readlinkSync - realpathSync - promises: Object containing the following async methods: - lstat - readdir (Dirent variant only) - readlink - realpath ### Interface `WalkOptions` The options object that may be passed to all walk methods. - `withFileTypes`: Boolean, default true. Indicates that `Path` objects should be returned. Set to `false` to get string paths instead. - `follow`: Boolean, default false. Attempt to read directory entries from symbolic links. Otherwise, only actual directories are traversed. Regardless of this setting, a given target path will only ever be walked once, meaning that a symbolic link to a previously traversed directory will never be followed. Setting this imposes a slight performance penalty, because `readlink` must be called on all symbolic links encountered, in order to avoid infinite cycles. - `filter`: Function `(entry: Path) => boolean`. If provided, will prevent the inclusion of any entry for which it returns a falsey value. This will not prevent directories from being traversed if they do not pass the filter, though it will prevent the directories themselves from being included in the results. By default, if no filter is provided, then all entries are included in the results. - `walkFilter`: Function `(entry: Path) => boolean`. If provided, will prevent the traversal of any directory (or in the case of `follow:true` symbolic links to directories) for which the function returns false. This will not prevent the directories themselves from being included in the result set. Use `filter` for that. Note that TypeScript return types will only be inferred properly from static analysis if the `withFileTypes` option is omitted, or a constant `true` or `false` value. ### Class `PathScurry` The main interface. Defaults to an appropriate class based on the current platform. Use `PathScurryWin32`, `PathScurryDarwin`, or `PathScurryPosix` if implementation-specific behavior is desired. All walk methods may be called with a `WalkOptions` argument to walk over the object's current working directory with the supplied options. #### `async pw.walk(entry?: string | Path | WalkOptions, opts?: WalkOptions)` Walk the directory tree according to the options provided, resolving to an array of all entries found. #### `pw.walkSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)` Walk the directory tree according to the options provided, returning an array of all entries found. #### `pw.iterate(entry?: string | Path | WalkOptions, opts?: WalkOptions)` Iterate over the directory asynchronously, for use with `for await of`. This is also the default async iterator method. #### `pw.iterateSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)` Iterate over the directory synchronously, for use with `for of`. This is also the default sync iterator method. #### `pw.stream(entry?: string | Path | WalkOptions, opts?: WalkOptions)` Return a [Minipass](http://npm.im/minipass) stream that emits each entry or path string in the walk. Results are made available asynchronously. #### `pw.streamSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)` Return a [Minipass](http://npm.im/minipass) stream that emits each entry or path string in the walk. Results are made available synchronously, meaning that the walk will complete in a single tick if the stream is fully consumed. #### `pw.cwd` Path object representing the current working directory for the PathScurry. #### `pw.chdir(path: string)` Set the new effective current working directory for the scurry object, so that `path.relative()` and `path.relativePosix()` return values relative to the new cwd path. #### `pw.depth(path?: Path | string): number` Return the depth of the specified path (or the PathScurry cwd) within the directory tree. Root entries have a depth of `0`. #### `pw.resolve(...paths: string[])` Caching `path.resolve()`. Significantly faster than `path.resolve()` if called repeatedly with the same paths. Significantly slower otherwise, as it builds out the cached Path entries. To get a `Path` object resolved from the `PathScurry`, use `pw.cwd.resolve(path)`. Note that `Path.resolve` only takes a single string argument, not multiple. #### `pw.resolvePosix(...paths: string[])` Caching `path.resolve()`, but always using posix style paths. This is identical to `pw.resolve(...paths)` on posix systems (ie, everywhere except Windows). On Windows, it returns the full absolute UNC path using `/` separators. Ie, instead of `'C:\\foo\\bar`, it would return `//?/C:/foo/bar`. #### `pw.relative(path: string | Path): string` Return the relative path from the PathWalker cwd to the supplied path string or entry. If the nearest common ancestor is the root, then an absolute path is returned. #### `pw.relativePosix(path: string | Path): string` Return the relative path from the PathWalker cwd to the supplied path string or entry, using `/` path separators. If the nearest common ancestor is the root, then an absolute path is returned. On posix platforms (ie, all platforms except Windows), this is identical to `pw.relative(path)`. On Windows systems, it returns the resulting string as a `/`-delimited path. If an absolute path is returned (because the target does not share a common ancestor with `pw.cwd`), then a full absolute UNC path will be returned. Ie, instead of `'C:\\foo\\bar`, it would return `//?/C:/foo/bar`. #### `pw.basename(path: string | Path): string` Return the basename of the provided string or Path. #### `pw.dirname(path: string | Path): string` Return the parent directory of the supplied string or Path. #### `async pw.readdir(dir = pw.cwd, opts = { withFileTypes: true })` Read the directory and resolve to an array of strings if `withFileTypes` is explicitly set to `false` or Path objects otherwise. Can be called as `pw.readdir({ withFileTypes: boolean })` as well. Returns `[]` if no entries are found, or if any error occurs. Note that TypeScript return types will only be inferred properly from static analysis if the `withFileTypes` option is omitted, or a constant `true` or `false` value. #### `pw.readdirSync(dir = pw.cwd, opts = { withFileTypes: true })` Synchronous `pw.readdir()` #### `async pw.readlink(link = pw.cwd, opts = { withFileTypes: false })` Call `fs.readlink` on the supplied string or Path object, and return the result. Can be called as `pw.readlink({ withFileTypes: boolean })` as well. Returns `undefined` if any error occurs (for example, if the argument is not a symbolic link), or a `Path` object if `withFileTypes` is explicitly set to `true`, or a string otherwise. Note that TypeScript return types will only be inferred properly from static analysis if the `withFileTypes` option is omitted, or a constant `true` or `false` value. #### `pw.readlinkSync(link = pw.cwd, opts = { withFileTypes: false })` Synchronous `pw.readlink()` #### `async pw.lstat(entry = pw.cwd)` Call `fs.lstat` on the supplied string or Path object, and fill in as much information as possible, returning the updated `Path` object. Returns `undefined` if the entry does not exist, or if any error is encountered. Note that some `Stats` data (such as `ino`, `dev`, and `mode`) will not be supplied. For those things, you'll need to call `fs.lstat` yourself. #### `pw.lstatSync(entry = pw.cwd)` Synchronous `pw.lstat()` #### `pw.realpath(entry = pw.cwd, opts = { withFileTypes: false })` Call `fs.realpath` on the supplied string or Path object, and return the realpath if available. Returns `undefined` if any error occurs. May be called as `pw.realpath({ withFileTypes: boolean })` to run on `pw.cwd`. #### `pw.realpathSync(entry = pw.cwd, opts = { withFileTypes: false })` Synchronous `pw.realpath()` ### Class `Path` implements [fs.Dirent](https://nodejs.org/docs/latest/api/fs.html#class-fsdirent) Object representing a given path on the filesystem, which may or may not exist. Note that the actual class in use will be either `PathWin32` or `PathPosix`, depending on the implementation of `PathScurry` in use. They differ in the separators used to split and join path strings, and the handling of root paths. In `PathPosix` implementations, paths are split and joined using the `'/'` character, and `'/'` is the only root path ever in use. In `PathWin32` implementations, paths are split using either `'/'` or `'\\'` and joined using `'\\'`, and multiple roots may be in use based on the drives and UNC paths encountered. UNC paths such as `//?/C:/` that identify a drive letter, will be treated as an alias for the same root entry as their associated drive letter (in this case `'C:\\'`). #### `path.name` Name of this file system entry. **Important**: _always_ test the path name against any test string using the `isNamed` method, and not by directly comparing this string. Otherwise, unicode path strings that the system sees as identical will not be properly treated as the same path, leading to incorrect behavior and possible security issues. #### `path.isNamed(name: string): boolean` Return true if the path is a match for the given path name. This handles case sensitivity and unicode normalization. Note: even on case-sensitive systems, it is **not** safe to test the equality of the `.name` property to determine whether a given pathname matches, due to unicode normalization mismatches. Always use this method instead of testing the `path.name` property directly. #### `path.isCWD` Set to true if this `Path` object is the current working directory of the `PathScurry` collection that contains it. #### `path.getType()` Returns the type of the Path object, `'File'`, `'Directory'`, etc. #### `path.isType(t: type)` Returns true if `is{t}()` returns true. For example, `path.isType('Directory')` is equivalent to `path.isDirectory()`. #### `path.depth()` Return the depth of the Path entry within the directory tree. Root paths have a depth of `0`. #### `path.fullpath()` The fully resolved path to the entry. #### `path.fullpathPosix()` The fully resolved path to the entry, using `/` separators. On posix systems, this is identical to `path.fullpath()`. On windows, this will return a fully resolved absolute UNC path using `/` separators. Eg, instead of `'C:\\foo\\bar'`, it will return `'//?/C:/foo/bar'`. #### `path.isFile()`, `path.isDirectory()`, etc. Same as the identical `fs.Dirent.isX()` methods. #### `path.isUnknown()` Returns true if the path's type is unknown. Always returns true when the path is known to not exist. #### `path.resolve(p: string)` Return a `Path` object associated with the provided path string as resolved from the current Path object. #### `path.relative(): string` Return the relative path from the PathWalker cwd to the supplied path string or entry. If the nearest common ancestor is the root, then an absolute path is returned. #### `path.relativePosix(): string` Return the relative path from the PathWalker cwd to the supplied path string or entry, using `/` path separators. If the nearest common ancestor is the root, then an absolute path is returned. On posix platforms (ie, all platforms except Windows), this is identical to `pw.relative(path)`. On Windows systems, it returns the resulting string as a `/`-delimited path. If an absolute path is returned (because the target does not share a common ancestor with `pw.cwd`), then a full absolute UNC path will be returned. Ie, instead of `'C:\\foo\\bar`, it would return `//?/C:/foo/bar`. #### `async path.readdir()` Return an array of `Path` objects found by reading the associated path entry. If path is not a directory, or if any error occurs, returns `[]`, and marks all children as provisional and non-existent. #### `path.readdirSync()` Synchronous `path.readdir()` #### `async path.readlink()` Return the `Path` object referenced by the `path` as a symbolic link. If the `path` is not a symbolic link, or any error occurs, returns `undefined`. #### `path.readlinkSync()` Synchronous `path.readlink()` #### `async path.lstat()` Call `lstat` on the path object, and fill it in with details determined. If path does not exist, or any other error occurs, returns `undefined`, and marks the path as "unknown" type. #### `path.lstatSync()` Synchronous `path.lstat()` #### `async path.realpath()` Call `realpath` on the path, and return a Path object corresponding to the result, or `undefined` if any error occurs. #### `path.realpathSync()` Synchornous `path.realpath()`
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/path-scurry/README.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/path-scurry/README.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 22016 }
# Path-to-RegExp Turn an Express-style path string such as `/user/:name` into a regular expression. **Note:** This is a legacy branch. You should upgrade to `1.x`. ## Usage ```javascript var pathToRegexp = require('path-to-regexp'); ``` ### pathToRegexp(path, keys, options) - **path** A string in the express format, an array of such strings, or a regular expression - **keys** An array to be populated with the keys present in the url. Once the function completes, this will be an array of strings. - **options** - **options.sensitive** Defaults to false, set this to true to make routes case sensitive - **options.strict** Defaults to false, set this to true to make the trailing slash matter. - **options.end** Defaults to true, set this to false to only match the prefix of the URL. ```javascript var keys = []; var exp = pathToRegexp('/foo/:bar', keys); //keys = ['bar'] //exp = /^\/foo\/(?:([^\/]+?))\/?$/i ``` ## Live Demo You can see a live demo of this library in use at [express-route-tester](http://forbeslindesay.github.com/express-route-tester/). ## License MIT
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/path-to-regexp/Readme.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/path-to-regexp/Readme.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 1101 }
0.0.1 / 2010-01-03 ================== * Initial release
{ "source": "ammaarreshi/Gemini-Search", "title": "node_modules/pause/History.md", "url": "https://github.com/ammaarreshi/Gemini-Search/blob/main/node_modules/pause/History.md", "date": "2025-01-04T14:07:19", "stars": 1910, "description": "Perplexity style AI Search engine clone built with Gemini 2.0 Flash and Grounding", "file_size": 58 }