mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[sprout] Add a mutate utility function
This commit is contained in:
@@ -32,6 +32,14 @@ export const CONST_NUMBER2 = 2;
|
||||
export const CONST_TRUE = true;
|
||||
export const CONST_FALSE = false;
|
||||
|
||||
let count: number = 0;
|
||||
export function mutate(arg: any): void {
|
||||
// don't mutate primitive
|
||||
if (typeof arg != null && typeof arg === "object") {
|
||||
arg["wat" + count++] = "joe";
|
||||
}
|
||||
}
|
||||
|
||||
export function graphql(value: string): string {
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user