source: trip-planner-front/node_modules/ws/lib/validation.js@ 1ad8e64

Last change on this file since 1ad8e64 was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago

primeNG components

  • Property mode set to 100644
File size: 695 bytes
Line 
1'use strict';
2
3try {
4 const isValidUTF8 = require('utf-8-validate');
5
6 exports.isValidUTF8 =
7 typeof isValidUTF8 === 'object'
8 ? isValidUTF8.Validation.isValidUTF8 // utf-8-validate@<3.0.0
9 : isValidUTF8;
10} catch (e) /* istanbul ignore next */ {
11 exports.isValidUTF8 = () => true;
12}
13
14/**
15 * Checks if a status code is allowed in a close frame.
16 *
17 * @param {Number} code The status code
18 * @return {Boolean} `true` if the status code is valid, else `false`
19 * @public
20 */
21exports.isValidStatusCode = (code) => {
22 return (
23 (code >= 1000 &&
24 code <= 1013 &&
25 code !== 1004 &&
26 code !== 1005 &&
27 code !== 1006) ||
28 (code >= 3000 && code <= 4999)
29 );
30};
Note: See TracBrowser for help on using the repository browser.