|
|
11b48c |
%{?scl:%scl_package nodejs-sorted-object}
|
|
|
11b48c |
%{!?scl:%global pkg_name %{name}}
|
|
|
11b48c |
|
|
|
11b48c |
%nodejs_find_provides_and_requires
|
|
|
11b48c |
|
|
|
11b48c |
Name: %{?scl_prefix}nodejs-sorted-object
|
|
|
11b48c |
Version: 1.0.0
|
|
|
11b48c |
Release: 5%{?dist}
|
|
|
11b48c |
Summary: Returns a copy of an object with its keys sorted
|
|
|
11b48c |
License: WTFPL
|
|
|
11b48c |
Url: https://github.com/domenic/sorted-object
|
|
|
11b48c |
Source: http://registry.npmjs.org/sorted-object/-/sorted-object-%{version}.tgz
|
|
|
11b48c |
#BuildRequires: nodejs010
|
|
|
11b48c |
BuildRequires: %{?scl_prefix}runtime
|
|
|
11b48c |
BuildArch: noarch
|
|
|
11b48c |
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
|
|
|
11b48c |
|
|
|
11b48c |
%description
|
|
|
11b48c |
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.
|
|
|
11b48c |
|
|
|
11b48c |
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.
|
|
|
11b48c |
|
|
|
11b48c |
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.
|
|
|
11b48c |
|
|
|
11b48c |
%prep
|
|
|
11b48c |
%setup -q -n package
|
|
|
11b48c |
|
|
|
11b48c |
%build
|
|
|
11b48c |
|
|
|
11b48c |
%install
|
|
|
11b48c |
mkdir -p %{buildroot}%{nodejs_sitelib}/sorted-object
|
|
|
11b48c |
cp -pr package.json lib \
|
|
|
11b48c |
%{buildroot}%{nodejs_sitelib}/sorted-object/
|
|
|
11b48c |
|
|
|
11b48c |
%files
|
|
|
11b48c |
%doc README.md LICENSE.txt
|
|
|
11b48c |
%{nodejs_sitelib}/sorted-object
|
|
|
11b48c |
|
|
|
11b48c |
%changelog
|
|
|
11b48c |
* Tue Feb 16 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 1.0.0-5
|
|
|
11b48c |
- Use macro in -runtime dependency
|
|
|
11b48c |
|
|
|
11b48c |
* Sun Feb 14 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 1.0.0-4
|
|
|
11b48c |
- Rebuilt with updated metapackage
|
|
|
11b48c |
|
|
|
11b48c |
* Tue Jan 13 2015 Tomas Hrcka <thrcka@redhat.com> - 1.0.0-3
|
|
|
11b48c |
- Remove undefined macro
|
|
|
11b48c |
|
|
|
11b48c |
* Mon Jan 12 2015 Tomas Hrcka <thrcka@redhat.com> - 1.0.0-2
|
|
|
11b48c |
- Enable software collection support
|
|
|
11b48c |
|
|
|
11b48c |
* Mon Jan 12 2015 Tomas Hrcka <thrcka@redhat.com> - 1.0.0-1
|
|
|
11b48c |
- Initial build
|