Blame SPECS/nodejs-sorted-object.spec

a65a06
%{?scl:%scl_package nodejs-sorted-object}
a65a06
%{!?scl:%global pkg_name %{name}}
a65a06
a65a06
%nodejs_find_provides_and_requires
a65a06
Name:           %{?scl_prefix}nodejs-sorted-object
a65a06
Version:        1.0.0
a65a06
Release:        3%{?dist}
a65a06
Summary:        Returns a copy of an object with its keys sorted
a65a06
License:        WTFPL
a65a06
Group:          Development/Languages/Other
a65a06
Url:            https://github.com/domenic/sorted-object
a65a06
Source:         http://registry.npmjs.org/sorted-object/-/sorted-object-%{version}.tgz
a65a06
BuildRequires:  nodejs010
a65a06
BuildRoot:      %{_tmppath}/%{pkg_name}-%{version}-build
a65a06
BuildArch:      noarch
a65a06
ExclusiveArch:  %{ix86} x86_64 %{arm} noarch
a65a06
a65a06
%description
a65a06
Although objects in JavaScript are theoretically unsorted, in practice most engines use insertion orderat least, ignoring numeric keys. This manifests itself most prominently when dealing with an object's JSON serialization. 
a65a06
a65a06
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.
a65a06
a65a06
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.
a65a06
a65a06
%prep
a65a06
%setup -q -n package
a65a06
a65a06
%build
a65a06
a65a06
%install
a65a06
mkdir -p %{buildroot}%{nodejs_sitelib}/sorted-object
a65a06
cp -pr package.json lib \
a65a06
        %{buildroot}%{nodejs_sitelib}/sorted-object/
a65a06
a65a06
%files
a65a06
%defattr(-,root,root,-)
a65a06
%doc README.md LICENSE.txt
a65a06
%{nodejs_sitelib}/sorted-object
a65a06
a65a06
%changelog
a65a06
* Tue Jan 13 2015 Tomas Hrcka <thrcka@redhat.com> - 1.0.0-3
a65a06
- Remove undefined macro
a65a06
a65a06
* Mon Jan 12 2015 Tomas Hrcka <thrcka@redhat.com> - 1.0.0-2
a65a06
- Enable software collection support
a65a06
a65a06
* Mon Jan 12 2015 Tomas Hrcka <thrcka@redhat.com> - 1.0.0-1
a65a06
- Initial build