Changeset 79a0317 for imaps-frontend/node_modules/jsesc
- Timestamp:
- 01/21/25 03:08:24 (3 days ago)
- Branches:
- main
- Parents:
- 0c6b92a
- Location:
- imaps-frontend/node_modules/jsesc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/jsesc/README.md
r0c6b92a r79a0317 1 # 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)1 # jsesc 2 2 3 3 Given some data, _jsesc_ returns a stringified representation of that data. jsesc is similar to `JSON.stringify()` except: -
imaps-frontend/node_modules/jsesc/jsesc.js
r0c6b92a r79a0317 55 55 return typeof value == 'number' || 56 56 toString.call(value) == '[object Number]'; 57 }; 58 const isBigInt = (value) => { 59 return typeof value == 'bigint'; 57 60 }; 58 61 const isFunction = (value) => { … … 198 201 return '[' + newLine + result.join(',' + newLine) + newLine + 199 202 (compact ? '' : oldIndent) + ']'; 200 } else if (isNumber(argument) ) {203 } else if (isNumber(argument) || isBigInt(argument)) { 201 204 if (json) { 202 205 // Some number values (e.g. `Infinity`) cannot be represented in JSON. 203 return JSON.stringify(argument); 204 } 206 // `BigInt` values less than `-Number.MAX_VALUE` or greater than 207 // `Number.MAX_VALUE` cannot be represented in JSON so they will become 208 // `-Infinity` or `Infinity`, respectively, and then become `null` when 209 // stringified. 210 return JSON.stringify(Number(argument)); 211 } 212 213 let result; 205 214 if (useDecNumbers) { 206 return String(argument); 207 } 208 if (useHexNumbers) { 215 result = String(argument); 216 } else if (useHexNumbers) { 209 217 let hexadecimal = argument.toString(16); 210 218 if (!lowercaseHex) { 211 219 hexadecimal = hexadecimal.toUpperCase(); 212 220 } 213 return '0x' + hexadecimal; 214 } 215 if (useBinNumbers) { 216 return '0b' + argument.toString(2); 217 } 218 if (useOctNumbers) { 219 return '0o' + argument.toString(8); 220 } 221 } else if (!isObject(argument)) { 221 result = '0x' + hexadecimal; 222 } else if (useBinNumbers) { 223 result = '0b' + argument.toString(2); 224 } else if (useOctNumbers) { 225 result = '0o' + argument.toString(8); 226 } 227 228 if (isBigInt(argument)) { 229 return result + 'n'; 230 } 231 return result; 232 } else if (isBigInt(argument)) { 233 if (json) { 234 // `BigInt` values less than `-Number.MAX_VALUE` or greater than 235 // `Number.MAX_VALUE` will become `-Infinity` or `Infinity`, 236 // respectively, and cannot be represented in JSON. 237 return JSON.stringify(Number(argument)); 238 } 239 return argument + 'n'; 240 } else if (!isObject(argument)) { 222 241 if (json) { 223 242 // For some values (e.g. `undefined`, `function` objects), -
imaps-frontend/node_modules/jsesc/package.json
r0c6b92a r79a0317 1 1 { 2 "name": "jsesc", 3 "version": "3.0.2", 2 "_from": "jsesc@^3.0.2", 3 "_id": "jsesc@3.1.0", 4 "_inBundle": false, 5 "_integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", 6 "_location": "/jsesc", 7 "_phantomChildren": {}, 8 "_requested": { 9 "type": "range", 10 "registry": true, 11 "raw": "jsesc@^3.0.2", 12 "name": "jsesc", 13 "escapedName": "jsesc", 14 "rawSpec": "^3.0.2", 15 "saveSpec": null, 16 "fetchSpec": "^3.0.2" 17 }, 18 "_requiredBy": [ 19 "/@babel/generator" 20 ], 21 "_resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", 22 "_shasum": "74d335a234f67ed19907fdadfac7ccf9d409825d", 23 "_spec": "jsesc@^3.0.2", 24 "_where": "/home/stevetosak/Proekt/IMaps/imaps-frontend/node_modules/@babel/generator", 25 "author": { 26 "name": "Mathias Bynens", 27 "url": "https://mathiasbynens.be/" 28 }, 29 "bin": { 30 "jsesc": "bin/jsesc" 31 }, 32 "bugs": { 33 "url": "https://github.com/mathiasbynens/jsesc/issues" 34 }, 35 "bundleDependencies": false, 36 "deprecated": false, 4 37 "description": "Given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data.", 5 "homepage": "https://mths.be/jsesc", 38 "devDependencies": { 39 "coveralls": "^2.11.6", 40 "grunt": "^0.4.5", 41 "grunt-cli": "^1.3.2", 42 "grunt-template": "^0.2.3", 43 "istanbul": "^0.4.2", 44 "mocha": "^5.2.0", 45 "regenerate": "^1.3.0", 46 "requirejs": "^2.1.22", 47 "unicode-13.0.0": "0.8.0" 48 }, 6 49 "engines": { 7 50 "node": ">=6" 8 51 }, 9 "main": "jsesc.js", 10 "bin": "bin/jsesc", 11 "man": "man/jsesc.1", 52 "files": [ 53 "LICENSE-MIT.txt", 54 "jsesc.js", 55 "bin/", 56 "man/" 57 ], 58 "homepage": "https://mths.be/jsesc", 12 59 "keywords": [ 13 60 "buffer", … … 22 69 ], 23 70 "license": "MIT", 24 "author": { 25 "name": "Mathias Bynens", 26 "url": "https://mathiasbynens.be/" 27 }, 71 "main": "jsesc.js", 72 "man": [ 73 "man/jsesc.1" 74 ], 75 "name": "jsesc", 28 76 "repository": { 29 77 "type": "git", 30 "url": " https://github.com/mathiasbynens/jsesc.git"78 "url": "git+https://github.com/mathiasbynens/jsesc.git" 31 79 }, 32 "bugs": "https://github.com/mathiasbynens/jsesc/issues",33 "files": [34 "LICENSE-MIT.txt",35 "jsesc.js",36 "bin/",37 "man/"38 ],39 80 "scripts": { 40 81 "build": "grunt template", 82 "cover": "istanbul cover --report 'html' --verbose --dir 'coverage' 'tests/tests.js'", 41 83 "coveralls": "istanbul cover --verbose --dir 'coverage' 'tests/tests.js' && coveralls < coverage/lcov.info'", 42 "cover": "istanbul cover --report 'html' --verbose --dir 'coverage' 'tests/tests.js'",43 84 "test": "mocha tests" 44 85 }, 45 "devDependencies": { 46 "coveralls": "^2.11.6", 47 "grunt": "^0.4.5", 48 "grunt-cli": "^1.3.2", 49 "grunt-template": "^0.2.3", 50 "istanbul": "^0.4.2", 51 "mocha": "^5.2.0", 52 "regenerate": "^1.3.0", 53 "requirejs": "^2.1.22", 54 "unicode-13.0.0": "0.8.0" 55 } 86 "version": "3.1.0" 56 87 }
Note:
See TracChangeset
for help on using the changeset viewer.