Skip to content
Permalink
Browse files

Chore: Update packages to use @hint/utils-string

  • Loading branch information
sarvaje committed Nov 7, 2019
1 parent 78cfe24 commit 0d37aded21950358da7fb20ffd3288bc54b08da9
Showing with 141 additions and 133 deletions.
  1. +1 βˆ’0 packages/create-hint/package.json
  2. +6 βˆ’4 packages/create-hint/src/create-hint.ts
  3. +1 βˆ’0 packages/create-hint/tsconfig.json
  4. +2 βˆ’1 packages/create-parser/package.json
  5. +2 βˆ’2 packages/create-parser/src/new-parser.ts
  6. +2 βˆ’1 packages/create-parser/tsconfig.json
  7. +1 βˆ’0 packages/formatter-codeframe/package.json
  8. +2 βˆ’1 packages/formatter-codeframe/src/formatter.ts
  9. +1 βˆ’6 packages/formatter-codeframe/tests/tests.ts
  10. +1 βˆ’0 packages/formatter-codeframe/tsconfig.json
  11. +1 βˆ’0 packages/formatter-stylish/package.json
  12. +2 βˆ’1 packages/formatter-stylish/src/formatter.ts
  13. +1 βˆ’6 packages/formatter-stylish/tests/tests.ts
  14. +1 βˆ’0 packages/formatter-stylish/tsconfig.json
  15. +1 βˆ’1 packages/hint-apple-touch-icons/package.json
  16. +1 βˆ’1 packages/hint-apple-touch-icons/src/hint.ts
  17. +1 βˆ’1 packages/hint-apple-touch-icons/tsconfig.json
  18. +1 βˆ’0 packages/hint-content-type/package.json
  19. +1 βˆ’0 packages/hint-content-type/tsconfig.json
  20. +1 βˆ’1 packages/hint-disown-opener/package.json
  21. +1 βˆ’1 packages/hint-disown-opener/tests/tests.ts
  22. +1 βˆ’1 packages/hint-disown-opener/tsconfig.json
  23. +1 βˆ’1 packages/hint-highest-available-document-mode/package.json
  24. +1 βˆ’1 packages/hint-highest-available-document-mode/tsconfig.json
  25. +1 βˆ’0 packages/hint-http-compression/package.json
  26. +27 βˆ’27 packages/hint-http-compression/src/hint.ts
  27. +1 βˆ’0 packages/hint-http-compression/tsconfig.json
  28. +1 βˆ’0 packages/hint-image-optimization-cloudinary/package.json
  29. +2 βˆ’1 packages/hint-image-optimization-cloudinary/src/hint.ts
  30. +1 βˆ’0 packages/hint-image-optimization-cloudinary/tsconfig.json
  31. +1 βˆ’1 packages/hint-manifest-exists/package.json
  32. +1 βˆ’1 packages/hint-manifest-exists/src/hint.ts
  33. +1 βˆ’1 packages/hint-manifest-exists/tsconfig.json
  34. +1 βˆ’1 packages/hint-manifest-file-extension/package.json
  35. +1 βˆ’1 packages/hint-manifest-file-extension/src/hint.ts
  36. +1 βˆ’1 packages/hint-manifest-file-extension/tsconfig.json
  37. +1 βˆ’1 packages/hint-manifest-is-valid/package.json
  38. +1 βˆ’1 packages/hint-manifest-is-valid/src/hint.ts
  39. +1 βˆ’1 packages/hint-manifest-is-valid/tsconfig.json
  40. +1 βˆ’1 packages/hint-meta-charset-utf-8/package.json
  41. +1 βˆ’1 packages/hint-meta-charset-utf-8/src/hint.ts
  42. +1 βˆ’1 packages/hint-meta-charset-utf-8/tsconfig.json
  43. +1 βˆ’1 packages/hint-meta-theme-color/package.json
  44. +1 βˆ’1 packages/hint-meta-theme-color/src/hint.ts
  45. +1 βˆ’1 packages/hint-meta-theme-color/tsconfig.json
  46. +1 βˆ’1 packages/hint-meta-viewport/package.json
  47. +1 βˆ’1 packages/hint-meta-viewport/src/hint.ts
  48. +1 βˆ’1 packages/hint-meta-viewport/tsconfig.json
  49. +1 βˆ’1 packages/hint-no-disallowed-headers/package.json
  50. +1 βˆ’1 packages/hint-no-disallowed-headers/tests/tests.ts
  51. +1 βˆ’1 packages/hint-no-disallowed-headers/tsconfig.json
  52. +1 βˆ’1 packages/hint-no-html-only-headers/package.json
  53. +1 βˆ’1 packages/hint-no-html-only-headers/tests/tests.ts
  54. +1 βˆ’1 packages/hint-no-html-only-headers/tsconfig.json
  55. +1 βˆ’1 packages/hint-no-http-redirects/package.json
  56. +1 βˆ’1 packages/hint-no-http-redirects/src/hint.ts
  57. +1 βˆ’1 packages/hint-no-http-redirects/tsconfig.json
  58. +1 βˆ’1 packages/hint-no-p3p/package.json
  59. +1 βˆ’1 packages/hint-no-p3p/src/hint.ts
  60. +1 βˆ’1 packages/hint-no-p3p/tsconfig.json
  61. +1 βˆ’1 packages/hint-no-protocol-relative-urls/package.json
  62. +1 βˆ’1 packages/hint-no-protocol-relative-urls/src/hint.ts
  63. +1 βˆ’1 packages/hint-no-protocol-relative-urls/tsconfig.json
  64. +1 βˆ’1 packages/hint-sri/package.json
  65. +1 βˆ’1 packages/hint-sri/tsconfig.json
  66. +1 βˆ’1 packages/hint-strict-transport-security/package.json
  67. +1 βˆ’1 packages/hint-strict-transport-security/tsconfig.json
  68. +1 βˆ’1 packages/hint-validate-set-cookie-header/package.json
  69. +1 βˆ’1 packages/hint-validate-set-cookie-header/tsconfig.json
  70. +1 βˆ’1 packages/hint-x-content-type-options/package.json
  71. +1 βˆ’1 packages/hint-x-content-type-options/tsconfig.json
  72. +1 βˆ’0 packages/hint/package.json
  73. +2 βˆ’4 packages/hint/src/lib/analyzer.ts
  74. +1 βˆ’5 packages/hint/tests/lib/analyzer.ts
  75. +0 βˆ’1 packages/hint/tests/lib/cli/analyze.ts
  76. +1 βˆ’0 packages/hint/tsconfig.json
  77. +1 βˆ’0 packages/parser-css/package.json
  78. +1 βˆ’1 packages/parser-css/src/parser.ts
  79. +2 βˆ’1 packages/parser-css/tsconfig.json
  80. +1 βˆ’1 packages/parser-less/package.json
  81. +1 βˆ’1 packages/parser-less/src/parser.ts
  82. +2 βˆ’2 packages/parser-less/tsconfig.json
  83. +1 βˆ’1 packages/parser-manifest/package.json
  84. +1 βˆ’1 packages/parser-manifest/tsconfig.json
  85. +1 βˆ’1 packages/parser-sass/package.json
  86. +1 βˆ’1 packages/parser-sass/src/parser.ts
  87. +2 βˆ’2 packages/parser-sass/tsconfig.json
  88. +1 βˆ’0 packages/utils-connector-tools/package.json
  89. +2 βˆ’4 packages/utils-connector-tools/src/requester.ts
  90. +1 βˆ’0 packages/utils-connector-tools/tsconfig.json
  91. +1 βˆ’1 packages/utils-create-server/package.json
  92. +1 βˆ’1 packages/utils-create-server/src/same-thread-server.ts
  93. +2 βˆ’2 packages/utils-create-server/tsconfig.json
  94. +1 βˆ’0 packages/utils-network/package.json
  95. +1 βˆ’1 packages/utils-network/src/capitalize-header-name.ts
  96. +1 βˆ’1 packages/utils-network/src/included-headers.ts
  97. +1 βˆ’1 packages/utils-network/src/is-regular-protocol.ts
  98. +1 βˆ’1 packages/utils-network/src/normalize-header-value.ts
  99. +1 βˆ’0 packages/utils-network/tsconfig.json
@@ -12,6 +12,7 @@
},
"dependencies": {
"@hint/utils-fs": "^1.0.0",
"@hint/utils-string": "^1.0.0",
"@hint/utils-types": "^1.0.0"
},
"description": "webhint's hint initializer package",
@@ -7,16 +7,18 @@ import * as mkdirp from 'mkdirp';

import {
logger,
isOfficial,
normalizeStringByDelimiter,
toCamelCase,
toPascalCase
isOfficial
} from '@hint/utils';
import {
cwd,
readFile,
writeFileAsync
} from '@hint/utils-fs';
import {
normalizeStringByDelimiter,
toCamelCase,
toPascalCase
} from '@hint/utils-string';
import { Category } from '@hint/utils-types';
import { HintScope } from 'hint';

@@ -16,6 +16,7 @@
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-fs" },
{ "path": "../utils-string" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -11,7 +11,8 @@
"create-parser": "./dist/src/create-parser.js"
},
"dependencies": {
"@hint/utils-fs": "^1.0.0"
"@hint/utils-fs": "^1.0.0",
"@hint/utils-string": "^1.0.0"
},
"description": "webhint's parser initializer package",
"devDependencies": {
@@ -8,9 +8,9 @@ import * as mkdirp from 'mkdirp';
import {
appInsights,
isOfficial,
logger,
normalizeStringByDelimiter
logger
} from '@hint/utils';
import { normalizeStringByDelimiter } from '@hint/utils-string';
import { writeFileAsync } from '@hint/utils-fs';

import { escapeSafeString, compileTemplate } from './handlebars-utils';
@@ -15,6 +15,7 @@
"references": [
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-fs" }
{ "path": "../utils-fs" },
{ "path": "../utils-string" }
]
}
@@ -13,6 +13,7 @@
"@hint/utils-debug": "^1.0.0",
"@hint/utils-fs": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-string": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"chalk": "^2.4.2",
"lodash": "^4.17.15",
@@ -18,7 +18,8 @@ import sortBy = require('lodash/sortBy');
import * as logSymbols from 'log-symbols';
const stripAnsi = require('strip-ansi');

import { cutString, logger } from '@hint/utils';
import { logger } from '@hint/utils';
import { cutString } from '@hint/utils-string';
import { writeFileAsync } from '@hint/utils-fs';
import { debug as d } from '@hint/utils-debug';
import { FormatterOptions, IFormatter } from 'hint';
@@ -5,8 +5,6 @@ import * as proxyquire from 'proxyquire';
import * as logSymbols from 'log-symbols';
const stripAnsi = require('strip-ansi');

import * as utils from '@hint/utils';

import * as problems from './fixtures/list-of-problems';

type Logging = {
@@ -33,10 +31,7 @@ const initContext = (t: ExecutionContext<CodeframeContext>) => {

const loadScript = (context: CodeframeContext) => {
const script = proxyquire('../src/formatter', {
'@hint/utils': {
cutString: utils.cutString,
logger: context.logging
},
'@hint/utils': { logger: context.logging },
'@hint/utils-fs': { writeFileAsync: context.writeFileAsync }
});

@@ -18,6 +18,7 @@
{ "path": "../utils-debug" },
{ "path": "../utils-fs" },
{ "path": "../utils-i18n" },
{ "path": "../utils-string" },
{ "path": "../utils-types" }
]
}
@@ -13,6 +13,7 @@
"@hint/utils-debug": "^1.0.0",
"@hint/utils-fs": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-string": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"chalk": "^2.4.2",
"lodash": "^4.17.15",
@@ -19,7 +19,8 @@ import * as logSymbols from 'log-symbols';
import * as table from 'text-table';
const stripAnsi = require('strip-ansi');

import { cutString, logger } from '@hint/utils';
import { logger } from '@hint/utils';
import { cutString } from '@hint/utils-string';
import { writeFileAsync } from '@hint/utils-fs';
import { debug as d } from '@hint/utils-debug';
import { FormatterOptions, IFormatter } from 'hint';
@@ -6,8 +6,6 @@ import * as sinon from 'sinon';
import * as table from 'text-table';
const stripAnsi = require('strip-ansi');

import * as utils from '@hint/utils';

import * as problems from './fixtures/list-of-problems';

type Logging = {
@@ -34,10 +32,7 @@ const initContext = (t: ExecutionContext<StylishContext>) => {

const loadScript = (context: StylishContext) => {
const script = proxyquire('../src/formatter', {
'@hint/utils': {
cutString: utils.cutString,
logger: context.logging
},
'@hint/utils': { logger: context.logging },
'@hint/utils-fs': { writeFileAsync: context.writeFileAsync }
});

@@ -18,6 +18,7 @@
{ "path": "../utils-debug" },
{ "path": "../utils-fs" },
{ "path": "../utils-i18n" },
{ "path": "../utils-string" },
{ "path": "../utils-types" }
]
}
@@ -7,10 +7,10 @@
"timeout": "1m"
},
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-string": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"image-size": "^0.8.3"
},
@@ -3,7 +3,7 @@
*/
import { imageSize as getImageData } from 'image-size';

import { normalizeString } from '@hint/utils';
import { normalizeString } from '@hint/utils-string';
import { isRegularProtocol } from '@hint/utils-network';
import { debug as d } from '@hint/utils-debug';
import { HintContext, IHint, NetworkData, TraverseEnd } from 'hint';
@@ -14,11 +14,11 @@
],
"references": [
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-debug" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" },
{ "path": "../utils-string" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -12,6 +12,7 @@
"@hint/utils-debug": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-string": "^1.0.0",
"content-type": "^1.0.4",
"@hint/utils-types": "^1.0.0"
},
@@ -18,6 +18,7 @@
{ "path": "../utils-debug" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" },
{ "path": "../utils-string" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -8,11 +8,11 @@
"timeout": "1m"
},
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-compat-data": "^1.0.1",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-string": "^1.0.0",
"@hint/utils-types": "^1.0.0"
},
"description": "hint that that checks if external links disown the opener",
@@ -1,4 +1,4 @@
import { cutString, prettyPrintArray } from '@hint/utils';
import { cutString, prettyPrintArray } from '@hint/utils-string';

import { generateHTMLPage, getHintPath, HintTest, testHint } from '@hint/utils-tests-helpers';

@@ -14,12 +14,12 @@
],
"references": [
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-compat-data" },
{ "path": "../utils-debug" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" },
{ "path": "../utils-string" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -8,9 +8,9 @@
"timeout": "1m"
},
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-string": "^1.0.0",
"@hint/utils-types": "^1.0.0"
},
"description": "hint for best practices related to usage of the X-UA-Compatible meta tag and response header",
@@ -14,10 +14,10 @@
],
"references": [
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" },
{ "path": "../utils-string" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -11,6 +11,7 @@
"@hint/utils": "^6.1.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-string": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"iltorb": "^2.4.3"
},
@@ -14,9 +14,9 @@ import * as brotli from 'iltorb';
import {
asyncTry,
getFileExtension,
isTextMediaType,
normalizeString
isTextMediaType
} from '@hint/utils';
import { normalizeString } from '@hint/utils-string';
import { HttpHeaders } from '@hint/utils-types';
import { HTMLElement } from '@hint/utils-dom';
import { isHTTP, isRegularProtocol, normalizeHeaderValue } from '@hint/utils-network';
@@ -445,34 +445,34 @@ export default class HttpCompressionHint implements IHint {
return isCompressedWithGzip(rawResponse) ||
await isCompressedWithBrotli(rawResponse) ||

/*
* Other compression methods may be used, but there
* is no way to check for all possible cases. So, if
* this point is reached, consider 'content-encoding'
* header as a possible indication of the response
* being compressed.
*/
/*
* Other compression methods may be used, but there
* is no way to check for all possible cases. So, if
* this point is reached, consider 'content-encoding'
* header as a possible indication of the response
* being compressed.
*/

(!!contentEncodingHeaderValue &&

/*
* Although `identity` should not be sent as a value
* for `content-encoding`, if sent, for the scope of
* this function, ignore it and consider no encoding
* was specified.
*
* From (now kinda obsolete)
* https://tools.ietf.org/html/rfc2616#page-24:
*
* " identity
*
* The default (identity) encoding; the use of no
* transformation whatsoever. This content-coding
* is used only in the Accept-Encoding header, and
* SHOULD NOT be used in the Content-Encoding header. "
*
* See also: http://httpwg.org/specs/rfc7231.html#content.coding.registration
*/
/*
* Although `identity` should not be sent as a value
* for `content-encoding`, if sent, for the scope of
* this function, ignore it and consider no encoding
* was specified.
*
* From (now kinda obsolete)
* https://tools.ietf.org/html/rfc2616#page-24:
*
* " identity
*
* The default (identity) encoding; the use of no
* transformation whatsoever. This content-coding
* is used only in the Accept-Encoding header, and
* SHOULD NOT be used in the Content-Encoding header. "
*
* See also: http://httpwg.org/specs/rfc7231.html#content.coding.registration
*/

(contentEncodingHeaderValue !== 'identity'));
};
@@ -18,6 +18,7 @@
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" },
{ "path": "../utils-string" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -10,6 +10,7 @@
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-string": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"cloudinary": "^1.16.0",
"fs-extra": "^8.0.1",
@@ -9,7 +9,8 @@ import * as fs from 'fs-extra';
import { imageSize as getImageData } from 'image-size';

import { FetchEnd, HintContext, IHint, ScanEnd } from 'hint';
import { cutString, logger } from '@hint/utils';
import { logger } from '@hint/utils';
import { cutString } from '@hint/utils-string';
import { cloudinaryResult } from './cloudinary-types';

import meta from './meta';
@@ -17,6 +17,7 @@
{ "path": "../utils" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-string" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -8,8 +8,8 @@
"timeout": "1m"
},
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-string": "^1.0.0",
"@hint/utils-types": "^1.0.0"
},
"description": "hint that that checks if a web app manifest file was specified and it exists",

0 comments on commit 0d37ade

Please sign in to comment.
You can’t perform that action at this time.