source: trip-planner-front/node_modules/postcss-minify-selectors/dist/lib/canUnquote.js@ bdd6491

Last change on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 715 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = canUnquote;
7
8/**
9 * Can unquote attribute detection from mothereff.in
10 * Copyright Mathias Bynens <https://mathiasbynens.be/>
11 * https://github.com/mathiasbynens/mothereff.in
12 */
13const escapes = /\\([0-9A-Fa-f]{1,6})[ \t\n\f\r]?/g; // eslint-disable-next-line no-control-regex
14
15const range = /[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;
16
17function canUnquote(value) {
18 if (value === '-' || value === '') {
19 return false;
20 }
21
22 value = value.replace(escapes, 'a').replace(/\\./g, 'a');
23 return !(range.test(value) || /^(?:-?\d|--)/.test(value));
24}
25
26module.exports = exports.default;
Note: See TracBrowser for help on using the repository browser.