mirror of
https://github.com/status-im/sourcecred.git
synced 2025-01-14 06:35:18 +00:00
mirror: rename helper _primitivesTableName
(#861)
Summary: Some clients want to write const primitivesTableName = _primitivesTableName(typename); which they cannot if the function is also called `primitivesTableName`, due to ECMAScript shadowing semantics. Test Plan: Running `yarn flow` suffices; running `yarn unit` really suffices. wchargin-branch: mirror-rename-primitivestablename
This commit is contained in:
parent
1d18652459
commit
5debae414e
@ -237,7 +237,7 @@ export class Mirror {
|
|||||||
throw new Error("invalid field name: " + JSON.stringify(fieldname));
|
throw new Error("invalid field name: " + JSON.stringify(fieldname));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const tableName = primitivesTableName(typename);
|
const tableName = _primitivesTableName(typename);
|
||||||
const tableSpec = [
|
const tableSpec = [
|
||||||
"id TEXT NOT NULL PRIMARY KEY",
|
"id TEXT NOT NULL PRIMARY KEY",
|
||||||
...type.primitiveFieldNames.map((fieldname) => `"${fieldname}"`),
|
...type.primitiveFieldNames.map((fieldname) => `"${fieldname}"`),
|
||||||
@ -402,7 +402,7 @@ function isSqlSafe(token: string) {
|
|||||||
*
|
*
|
||||||
* Note that the resulting string is double-quoted.
|
* Note that the resulting string is double-quoted.
|
||||||
*/
|
*/
|
||||||
function primitivesTableName(typename: Schema.Typename) {
|
function _primitivesTableName(typename: Schema.Typename) {
|
||||||
// istanbul ignore if
|
// istanbul ignore if
|
||||||
if (!isSqlSafe(typename)) {
|
if (!isSqlSafe(typename)) {
|
||||||
// This shouldn't be reachable---we should have caught it earlier.
|
// This shouldn't be reachable---we should have caught it earlier.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user