use warnings;
package WWW::Shopify::Liquid::Filter::JSON; use base 'WWW::Shopify::Liquid::Filter';
use JSON qw(encode_json decode_json from_json);
use Scalar::Util qw(blessed isweak);
use Clone qw(c
er as well.
if (defined $_[2] && !ref($_[2]) && length($_[2]) >= 2) {
my $object = eval { from_json($_[2]) };
return $object if !$@;
}
my $object = $_[2] ? (blessed($_[2]) && $_[2]->isa('WWW::S
pify::Model::Item') ? WWW::Shopify::Liquid->liquify_item($_[2]) : walk_data(clone($_[2]))) : $_[2];
return defined $object && ref($object) ? JSON->new->allow_blessed(1)->encode($object) : '{}';
}
1;
Digest::MD5 qw(md5_hex);
use JSON qw(to_json);
sub operate {
my ($self, $hash, $operand, @arguments) = @_;
$operand = '' unless defined $operand;
return md5_hex(to_json($operand, { canonical => 1 }
else {
$final->{$key} = undef;
}
}
$final->{$key} = ($item->$key ? $item->$key->to_json() : undef) if ($fields->{$key}->is_one() && $fields->{$key}->is_own());
} elsif (ref($fields->{
compile'
or 'watch'.
files The list of files and folders to check.
--json Takes in either a file name, or a JSON
string. If filename, will also check
for changes to this file before re
ut
=head1 EXAMPLES
shopify-liquid-compile.pl *.liquid
=cut
my @ARGS;
GetOptions(
'json=s' => \my $json,
'help' => \my $help,
'fullhelp' => \my $fullhelp,
'base=s' => \my @bases,
'class=s'