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

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/escape-string-regexp/index.js

    rd565449 r0c6b92a  
    11'use strict';
    22
    3 var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
    4 
    5 module.exports = function (str) {
    6         if (typeof str !== 'string') {
     3module.exports = string => {
     4        if (typeof string !== 'string') {
    75                throw new TypeError('Expected a string');
    86        }
    97
    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');
    1113};
Note: See TracChangeset for help on using the changeset viewer.