pawn-requests
pawn-requests copied to clipboard
Deprecate incorrectly named "Append" and implement "Push", "Concat" and "Merge"
After some confusion I've realised that the JsonAppend
function is named incorrectly!
Appending is adding a single item to a collection of items however the current API expects the input and destination to either be both arrays or both objects. This is actually concatenation not appending.
So, the existing JsonAppend
function should be marked deprecated and two new functions introduced:
-
JsonPush
this is purely for arrays where you want to push a single item to the end. -
JsonConcat
does exactly whatJsonAppend
does but only for arrays. -
JsonMerge
does exactly whatJsonAppend
does but only for objects.