Son CV dans un terminal web en Javascript!
https://terminal-cv.gregandev.fr
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
715 B
26 lines
715 B
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = canUnquote;
|
|
|
|
/**
|
|
* Can unquote attribute detection from mothereff.in
|
|
* Copyright Mathias Bynens <https://mathiasbynens.be/>
|
|
* https://github.com/mathiasbynens/mothereff.in
|
|
*/
|
|
const escapes = /\\([0-9A-Fa-f]{1,6})[ \t\n\f\r]?/g; // eslint-disable-next-line no-control-regex
|
|
|
|
const range = /[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;
|
|
|
|
function canUnquote(value) {
|
|
if (value === '-' || value === '') {
|
|
return false;
|
|
}
|
|
|
|
value = value.replace(escapes, 'a').replace(/\\./g, 'a');
|
|
return !(range.test(value) || /^(?:-?\d|--)/.test(value));
|
|
}
|
|
|
|
module.exports = exports.default; |