Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

664 | ref (core & schema): use string .substr method #672

Merged
merged 2 commits into from
Feb 13, 2022

Conversation

arcbjorn
Copy link
Contributor

@arcbjorn arcbjorn commented Feb 8, 2022

No description provided.

@arcbjorn arcbjorn changed the base branch from prealpha to prealpha-dev February 8, 2022 22:57
@arcbjorn arcbjorn linked an issue Feb 8, 2022 that may be closed by this pull request
} else {
const nullType = toWasm()(value, render);
const nullable = "Nullable";
const nullOptional = "| null";

if (nullType.substr(-nullOptional.length) === nullOptional) {
if (nullType.substring(-nullOptional.length) === nullOptional) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, This won't work and should be refactored with endsWith anyway.

if (nullType.endsWith(nullOptional))

@@ -22,9 +22,9 @@ export function extractImportedDefinition(
const typeName = node.name.value;

const queryIdentifier = "_Query";
const queryTest = typeName.substr(-queryIdentifier.length);
const queryTest = typeName.substring(-queryIdentifier.length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here can be refactored with endsWith syntax

@dOrgJelli dOrgJelli merged commit 0b242ad into prealpha-dev Feb 13, 2022
@dOrgJelli dOrgJelli deleted the 664-use-string-substr-method branch February 2, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use string.subsring instead of deprecated string.substr method.
3 participants