Skip to content

Commit 60a2bf8

Browse files
committed
Rename 'blockStringValue' => 'dedentBlockStringValue'
1 parent 2554a3b commit 60a2bf8

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/language/__tests__/blockStringValue-test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
import { expect } from 'chai';
1111
import { describe, it } from 'mocha';
12-
import blockStringValue from '../blockStringValue';
12+
import { dedentBlockStringValue } from '../blockStringValue';
1313

14-
describe('blockStringValue', () => {
14+
describe('dedentBlockStringValue', () => {
1515
it('removes uniform indentation from a string', () => {
1616
const rawValue = [
1717
'',
@@ -21,7 +21,7 @@ describe('blockStringValue', () => {
2121
' Yours,',
2222
' GraphQL.',
2323
].join('\n');
24-
expect(blockStringValue(rawValue)).to.equal(
24+
expect(dedentBlockStringValue(rawValue)).to.equal(
2525
['Hello,', ' World!', '', 'Yours,', ' GraphQL.'].join('\n'),
2626
);
2727
});
@@ -38,7 +38,7 @@ describe('blockStringValue', () => {
3838
'',
3939
'',
4040
].join('\n');
41-
expect(blockStringValue(rawValue)).to.equal(
41+
expect(dedentBlockStringValue(rawValue)).to.equal(
4242
['Hello,', ' World!', '', 'Yours,', ' GraphQL.'].join('\n'),
4343
);
4444
});
@@ -55,7 +55,7 @@ describe('blockStringValue', () => {
5555
' ',
5656
' ',
5757
].join('\n');
58-
expect(blockStringValue(rawValue)).to.equal(
58+
expect(dedentBlockStringValue(rawValue)).to.equal(
5959
['Hello,', ' World!', '', 'Yours,', ' GraphQL.'].join('\n'),
6060
);
6161
});
@@ -68,7 +68,7 @@ describe('blockStringValue', () => {
6868
' Yours,',
6969
' GraphQL.',
7070
].join('\n');
71-
expect(blockStringValue(rawValue)).to.equal(
71+
expect(dedentBlockStringValue(rawValue)).to.equal(
7272
[' Hello,', ' World!', '', 'Yours,', ' GraphQL.'].join('\n'),
7373
);
7474
});
@@ -83,7 +83,7 @@ describe('blockStringValue', () => {
8383
' GraphQL. ',
8484
' ',
8585
].join('\n');
86-
expect(blockStringValue(rawValue)).to.equal(
86+
expect(dedentBlockStringValue(rawValue)).to.equal(
8787
[
8888
'Hello, ',
8989
' World! ',

src/language/blockStringValue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* This implements the GraphQL spec's BlockStringValue() static algorithm.
1515
*/
16-
export default function blockStringValue(rawString: string): string {
16+
export function dedentBlockStringValue(rawString: string): string {
1717
// Expand a block string's raw value into independent lines.
1818
const lines = rawString.split(/\r\n|[\n\r]/g);
1919

src/language/lexer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import defineToJSON from '../jsutils/defineToJSON';
1111
import type { Token } from './ast';
1212
import type { Source } from './source';
1313
import { syntaxError } from '../error';
14-
import blockStringValue from './blockStringValue';
14+
import { dedentBlockStringValue } from './blockStringValue';
1515

1616
/**
1717
* Given a Source object, this returns a Lexer for that source.
@@ -650,7 +650,7 @@ function readBlockString(source, start, line, col, prev, lexer): Token {
650650
line,
651651
col,
652652
prev,
653-
blockStringValue(rawValue),
653+
dedentBlockStringValue(rawValue),
654654
);
655655
}
656656

src/utilities/buildASTSchema.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import keyValMap from '../jsutils/keyValMap';
1515
import type { ObjMap } from '../jsutils/ObjMap';
1616
import { valueFromAST } from './valueFromAST';
1717
import { assertValidSDL } from '../validation/validate';
18-
import blockStringValue from '../language/blockStringValue';
18+
import { dedentBlockStringValue } from '../language/blockStringValue';
1919
import { TokenKind } from '../language/lexer';
2020
import { parse } from '../language/parser';
2121
import type { ParseOptions } from '../language/parser';
@@ -457,7 +457,7 @@ export function getDescription(
457457
if (options && options.commentDescriptions) {
458458
const rawValue = getLeadingCommentBlock(node);
459459
if (rawValue !== undefined) {
460-
return blockStringValue('\n' + rawValue);
460+
return dedentBlockStringValue('\n' + rawValue);
461461
}
462462
}
463463
}

0 commit comments

Comments
 (0)