demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/escape-html-1.0.3/index.js

Path
demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/escape-html-1.0.3/index.js
Status
scanned
Type
file
Name
index.js
Extension
.js
Programming language
JavaScript
Mime type
text/plain
File type
ASCII text
Tag

      
    
Rootfs path

      
    
Size
1362 (1.3 KB)
MD5
0c95e46d0f08bd96b93cfbea66888afc
SHA1
dfbb19c79eb0ca7ff2625fb1975a35cf47be378a
SHA256
42a7f91883d0c5ce9292dda4e017e1f8664d34b09276d89fb6f3859c29d1ca9b
SHA512

      
    
SHA1_git
bf9e226f4e872bee53a930739e5381d013c47568
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
index.js | 1.3 KB |

/*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk * Copyright(c) 2015 Andreas Lubbe * Copyright(c) 2015 Tiancheng "Timothy" Gu * MIT Licensed */ 'use strict'; /** * Module variables. * @private */ var matchHtmlRegExp = /["'&<>]/; /** * Module exports. * @public */ module.exports = escapeHtml; /** * Escape special characters in the given string of html. * * @param {string} string The string to escape for inserting into HTML * @return {string} * @public */ function escapeHtml(string) { var str = '' + string; var match = matchHtmlRegExp.exec(str); if (!match) { return str; } var escape; var html = ''; var index = 0; var lastIndex = 0; for (index = match.index; index < str.length; index++) { switch (str.charCodeAt(index)) { case 34: // " escape = '&quot;'; break; case 38: // & escape = '&amp;'; break; case 39: // ' escape = '&#39;'; break; case 60: // < escape = '&lt;'; break; case 62: // > escape = '&gt;'; break; default: continue; } if (lastIndex !== index) { html += str.substring(lastIndex, index); } lastIndex = index + 1; html += escape; } return lastIndex !== index ? html + str.substring(lastIndex, index) : html; }
Detected license expression
mit
Detected license expression (SPDX)
MIT
Percentage of license text
1.44
Copyrights
- end_line: 3
  copyright: Copyright (c) 2012-2013 TJ Holowaychuk
  start_line: 3
- end_line: 4
  copyright: Copyright (c) 2015 Andreas Lubbe
  start_line: 4
- end_line: 5
  copyright: Copyright (c) 2015 Tiancheng Timothy Gu
  start_line: 5
Holders
- holder: TJ Holowaychuk
  end_line: 3
  start_line: 3
- holder: Andreas Lubbe
  end_line: 4
  start_line: 4
- holder: Tiancheng Timothy Gu
  end_line: 5
  start_line: 5
Authors

      
    
License detections License expression License expression SPDX
mit-4e7803e6-e54b-c9ca-bcd2-bee9755c0dd7 mit MIT
Package URL License Primary language
pkg:npm/escape-html@1.0.3 mit JavaScript
pkg:npm/acme-demo-app@1.0.0 JavaScript