Blame SPECS/nodejs-sorted-object.spec

cc07ba
%{?scl:%scl_package nodejs-sorted-object}
cc07ba
%{!?scl:%global pkg_name %{name}}
cc07ba
cc07ba
%{?nodejs_find_provides_and_requires}
cc07ba
cc07ba
Name:           %{?scl_prefix}nodejs-sorted-object
cc07ba
Version:        2.0.0
846aec
Release:        2%{?dist}
cc07ba
Summary:        Returns a copy of an object with its keys sorted
cc07ba
License:        WTFPL
cc07ba
Url:            https://github.com/domenic/sorted-object
cc07ba
Source:         http://registry.npmjs.org/sorted-object/-/sorted-object-%{version}.tgz
cc07ba
#BuildRequires:  nodejs010
cc07ba
BuildRequires:	%{?scl_prefix}runtime
cc07ba
BuildArch:      noarch
846aec
ExclusiveArch:  %{nodejs_arches} noarch
cc07ba
cc07ba
%description
cc07ba
Although objects in JavaScript are theoretically unsorted, in practice most engines use insertion order—at least, ignoring numeric keys. This manifests itself most prominently when dealing with an object's JSON serialization. 
cc07ba
cc07ba
So, for example, you might be trying to serialize some object to a JSON file. But every time you write it, it ends up being output in a different order, depending on how you created it in the first place! This makes for some ugly diffs.
cc07ba
cc07ba
sorted-object gives you the answer. Just use this package to create a version of your object with its keys sorted before serializing, and you'll get a consistent order every time.
cc07ba
cc07ba
%prep
cc07ba
%setup -q -n package
cc07ba
cc07ba
%build
cc07ba
cc07ba
%install
cc07ba
mkdir -p %{buildroot}%{nodejs_sitelib}/sorted-object
cc07ba
cp -pr package.json lib \
cc07ba
        %{buildroot}%{nodejs_sitelib}/sorted-object/
cc07ba
cc07ba
%files
cc07ba
%doc README.md LICENSE.txt
cc07ba
%{nodejs_sitelib}/sorted-object
cc07ba
cc07ba
%changelog
846aec
* Mon May 28 2018 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.0.0-2
846aec
- Resolves: RHBZ#1543198, rebuild for multiarch
846aec
cc07ba
* Tue Sep 13 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.0.0-1
cc07ba
- Updated with script
cc07ba
cc07ba
* Tue Feb 16 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 1.0.0-5
cc07ba
- Use macro in -runtime dependency
cc07ba
cc07ba
* Sun Feb 14 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 1.0.0-4
cc07ba
- Rebuilt with updated metapackage
cc07ba
cc07ba
* Tue Jan 13 2015 Tomas Hrcka <thrcka@redhat.com> - 1.0.0-3
cc07ba
- Remove undefined macro
cc07ba
cc07ba
* Mon Jan 12 2015 Tomas Hrcka <thrcka@redhat.com> - 1.0.0-2
cc07ba
- Enable software collection support
cc07ba
cc07ba
* Mon Jan 12 2015 Tomas Hrcka <thrcka@redhat.com> - 1.0.0-1
cc07ba
- Initial build