Changeset 0c6b92a for imaps-frontend/node_modules/escape-string-regexp
- Timestamp:
- 12/12/24 17:06:06 (5 weeks ago)
- Branches:
- main
- Parents:
- d565449
- Location:
- imaps-frontend/node_modules/escape-string-regexp
- Files:
-
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/escape-string-regexp/index.js
rd565449 r0c6b92a 1 1 'use strict'; 2 2 3 var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; 4 5 module.exports = function (str) { 6 if (typeof str !== 'string') { 3 module.exports = string => { 4 if (typeof string !== 'string') { 7 5 throw new TypeError('Expected a string'); 8 6 } 9 7 10 return str.replace(matchOperatorsRe, '\\$&'); 8 // Escape characters with special meaning either inside or outside character sets. 9 // Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. 10 return string 11 .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') 12 .replace(/-/g, '\\x2d'); 11 13 }; -
imaps-frontend/node_modules/escape-string-regexp/license
rd565449 r0c6b92a 1 The MIT License (MIT) 1 MIT License 2 2 3 Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> ( sindresorhus.com)3 Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) 4 4 5 Permission is hereby granted, free of charge, to any person obtaining a copy 6 of this software and associated documentation files (the "Software"), to deal 7 in the Software without restriction, including without limitation the rights 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 copies of the Software, and to permit persons to whom the Software is 10 furnished to do so, subject to the following conditions: 5 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: 11 6 12 The above copyright notice and this permission notice shall be included in 13 all copies or substantial portions of the Software. 7 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 8 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 THE SOFTWARE. 9 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. -
imaps-frontend/node_modules/escape-string-regexp/package.json
rd565449 r0c6b92a 1 1 { 2 "name": "escape-string-regexp", 3 "version": "1.0.5", 4 "description": "Escape RegExp special characters", 5 "license": "MIT", 6 "repository": "sindresorhus/escape-string-regexp", 7 "author": { 8 "name": "Sindre Sorhus", 9 "email": "sindresorhus@gmail.com", 10 "url": "sindresorhus.com" 11 }, 12 "maintainers": [ 13 "Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)", 14 "Joshua Boy Nicolai Appelman <joshua@jbna.nl> (jbna.nl)" 15 ], 16 "engines": { 17 "node": ">=0.8.0" 18 }, 19 "scripts": { 20 "test": "xo && ava" 21 }, 22 "files": [ 23 "index.js" 24 ], 25 "keywords": [ 26 "escape", 27 "regex", 28 "regexp", 29 "re", 30 "regular", 31 "expression", 32 "string", 33 "str", 34 "special", 35 "characters" 36 ], 37 "devDependencies": { 38 "ava": "*", 39 "xo": "*" 40 } 2 "name": "escape-string-regexp", 3 "version": "4.0.0", 4 "description": "Escape RegExp special characters", 5 "license": "MIT", 6 "repository": "sindresorhus/escape-string-regexp", 7 "funding": "https://github.com/sponsors/sindresorhus", 8 "author": { 9 "name": "Sindre Sorhus", 10 "email": "sindresorhus@gmail.com", 11 "url": "https://sindresorhus.com" 12 }, 13 "engines": { 14 "node": ">=10" 15 }, 16 "scripts": { 17 "test": "xo && ava && tsd" 18 }, 19 "files": [ 20 "index.js", 21 "index.d.ts" 22 ], 23 "keywords": [ 24 "escape", 25 "regex", 26 "regexp", 27 "regular", 28 "expression", 29 "string", 30 "special", 31 "characters" 32 ], 33 "devDependencies": { 34 "ava": "^1.4.1", 35 "tsd": "^0.11.0", 36 "xo": "^0.28.3" 37 } 41 38 } -
imaps-frontend/node_modules/escape-string-regexp/readme.md
rd565449 r0c6b92a 3 3 > Escape RegExp special characters 4 4 5 6 5 ## Install 7 6 8 7 ``` 9 $ npm install --saveescape-string-regexp8 $ npm install escape-string-regexp 10 9 ``` 11 12 10 13 11 ## Usage … … 16 14 const escapeStringRegexp = require('escape-string-regexp'); 17 15 18 const escapedString = escapeStringRegexp(' how much $ for a unicorn?');19 //=> ' how much \$ for a unicorn\?'16 const escapedString = escapeStringRegexp('How much $ for a 🦄?'); 17 //=> 'How much \\$ for a 🦄\\?' 20 18 21 19 new RegExp(escapedString); 22 20 ``` 23 21 22 You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. 24 23 25 ## License 24 --- 26 25 27 MIT © [Sindre Sorhus](http://sindresorhus.com) 26 <div align="center"> 27 <b> 28 <a href="https://tidelift.com/subscription/pkg/npm-escape-string-regexp?utm_source=npm-escape-string-regexp&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a> 29 </b> 30 <br> 31 <sub> 32 Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies. 33 </sub> 34 </div>
Note:
See TracChangeset
for help on using the changeset viewer.