Last active
March 8, 2017 03:57
Revisions
-
entrypointkr revised this gist
Mar 8, 2017 . 1 changed file with 12 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,19 @@ proc _subset_of(@arrayA, @arrayB) { if (!is_array(@arrayA) || !is_array(@arrayB) || is_associative(@arrayA) != is_associative(@arrayB)) { return(false) } foreach (@key : @valueA in @arrayA) { @valueB = array_get(@arrayB, @key, null) if (@valueB == null || typeof(@valueB) != typeof(@valueA)) { return(false) } if (is_array(@valueB) && !_subset_of(@valueA, @valueB)) { return(false) } else if (!equals(@valueA, @valueB)) { return (false) } } return(true) } -
entrypointkr revised this gist
Dec 16, 2016 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ proc _subset_of(@a, @b) { if (!is_array(@a) || !is_array(@b) || is_associative(@a) != is_associative(@b)) { return(false) } foreach (@key : @valueA in @a) { @@ -9,7 +10,8 @@ proc _subset_of(@a, @b) { return(false) } if (is_array(@valueB)) { if (is_associative(@valueA) != is_associative(@valueB) || !_subset_of(@valueA, @valueB)) { return(false) } } else { -
entrypointkr revised this gist
Dec 16, 2016 . 1 changed file with 8 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,22 @@ proc _subset_of(@a, @b) { if (!is_array(@a) || !is_array(@b)) { return(false) } foreach (@key : @valueA in @a) { @valueB = array_get(@b, @key, null) if (@valueB == null || typeof(@valueB) != typeof(@valueA)) { return(false) } if (is_array(@valueB)) { if (!_subset_of(@valueA, @valueB)) { return(false) } } else { if (!equals(@valueA, @valueB)) { return(false) } } } return(true) } -
entrypointkr revised this gist
Dec 15, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ proc _subset_of(@a, @b) { if (@valueB == null) { return(false); } if (typeof(@valueB) != typeof(@valueA)) { return(false); } if (is_array(@valueB)) { -
entrypointkr created this gist
Dec 15, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ proc _subset_of(@a, @b) { if (!is_array(@a) || !is_array(@b)) { return(false); } foreach (@key : @valueA in @a) { @valueB = array_get(@b, @key, null); if (@valueB == null) { return(false); } if (@valueB !== @valueA) { return(false); } if (is_array(@valueB)) { if (!_subset_of(@valueA, @valueB)) { return(false); } } else { if (!equals(@valueA, @valueB)) { return(false); } } } return(true); }