@apollo/utils.printwithreducedwhitespace
Advanced tools
Comparing version 1.1.0 to 2.0.0
{ | ||
"name": "@apollo/utils.printwithreducedwhitespace", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Print an AST with as little whitespace as possible", | ||
@@ -10,3 +10,3 @@ "main": "dist/index.js", | ||
"url": "git+https://github.com/apollographql/apollo-utils.git", | ||
"directory": "printWithReducedWhitespace/" | ||
"directory": "packages/printWithReducedWhitespace/" | ||
}, | ||
@@ -22,7 +22,4 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=12.13.0" | ||
"node": ">=14" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"peerDependencies": { | ||
@@ -29,0 +26,0 @@ "graphql": "14.x || 15.x || 16.x" |
@@ -5,31 +5,25 @@ import gql from "graphql-tag"; | ||
describe("printWithReducedWhitespace", () => { | ||
const cases = [ | ||
{ | ||
name: "lots of whitespace", | ||
// Note: there's a tab after "tab->", which prettier wants to keep as a | ||
// literal tab rather than \t. In the output, there should be a literal | ||
// backslash-t. | ||
input: gql` | ||
query Foo($a: Int) { | ||
user( | ||
name: " tab-> yay" | ||
other: """ | ||
apple | ||
bag | ||
cat | ||
""" | ||
) { | ||
name | ||
} | ||
it("removes whitespace", () => { | ||
// Note: there's a tab after "tab->", which prettier wants to keep as a | ||
// literal tab rather than \t. In the output, there should be a literal | ||
// backslash-t. | ||
const document = gql` | ||
query Foo($a: Int) { | ||
user( | ||
name: " tab-> yay" | ||
other: """ | ||
apple | ||
bag | ||
cat | ||
""" | ||
) { | ||
name | ||
} | ||
`, | ||
output: | ||
'query Foo($a:Int){user(name:" tab->\\tyay"other:"apple\\n bag\\ncat"){name}}', | ||
}, | ||
]; | ||
cases.forEach(({ name, input, output }) => { | ||
test(name, () => { | ||
expect(printWithReducedWhitespace(input)).toEqual(output); | ||
}); | ||
} | ||
`; | ||
expect(printWithReducedWhitespace(document)).toBe( | ||
`query Foo($a:Int){user(name:" tab->\\tyay"other:"apple\\n bag\\ncat"){name}}`, | ||
); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
6810
10
0
21
87