The package rpms/nodejs-sort-keys.git has added or updated architecture specific content
in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/nodejs-sort-keys.git/commit/?id=0....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 02b4f4d214803aa940e9d6bdece4507bc87caa29
Author: Jared K. Smith <jaredsmith(a)jaredsmith.net>
Date: Wed May 3 13:42:24 2017 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
index e69de29..ea9fecb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/sort-keys-1.1.2.tgz
diff --git a/nodejs-sort-keys.spec b/nodejs-sort-keys.spec
new file mode 100644
index 0000000..78ecbb3
--- /dev/null
+++ b/nodejs-sort-keys.spec
@@ -0,0 +1,63 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename sort-keys
+
+# tests missing due to missing npm(ava)
+%global enable_tests 0
+
+Name: nodejs-sort-keys
+Version: 1.1.2
+Release: 1%{?dist}
+Summary: Sort the keys of an object
+
+License: MIT
+URL:
https://github.com/sindresorhus/sort-keys
+Source0:
https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
+# The test files are not included in the npm tarball.
+Source1:
https://raw.githubusercontent.com/sindresorhus/sort-keys/v%{version}/test.js
+
+ExclusiveArch: %{nodejs_arches} noarch
+BuildArch: noarch
+
+BuildRequires: nodejs-packaging
+BuildRequires: npm(is-plain-obj)
+%if 0%{?enable_tests}
+BuildRequires: npm(ava)
+%endif
+
+%description
+Sort the keys of an object
+
+
+%prep
+%autosetup -n package
+# setup the tests
+cp -p %{SOURCE1} .
+
+%build
+# nothing to do!
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
+cp -pr package.json index.js \
+ %{buildroot}%{nodejs_sitelib}/%{packagename}
+
+%nodejs_symlink_deps
+
+%check
+%nodejs_symlink_deps --check
+%{__nodejs} -e 'require("./")'
+%if 0%{?enable_tests}
+%{_bindir}/ava
+%else
+%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
+%endif
+
+%files
+%doc readme.md
+%license license
+%{nodejs_sitelib}/%{packagename}
+
+%changelog
+* Thu Apr 20 2017 Jared Smith <jsmith(a)fedoraproject.org> - 1.1.2-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..a6b86b1 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (sort-keys-1.1.2.tgz) =
bf39fc692a8a832b558a4d22c1d0448becdebdb4d866881ec1350ce9db69986c0471dcdbb9bfd35f86c2cd185e6c30910b74335e026c2d1281d95fcea1fec75e
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..c5e41ea
--- /dev/null
+++ b/test.js
@@ -0,0 +1,78 @@
+'use strict';
+/* eslint-env mocha */
+var assert = require('assert');
+var sortKeys = require('./');
+
+it('should sort the keys of an object', function () {
+ assert.strictEqual(
+ JSON.stringify(sortKeys({c: 0, a: 0, b: 0})),
+ JSON.stringify({a: 0, b: 0, c: 0})
+ );
+});
+
+it('DEPRECATED - should sort the keys of an object with a custom sort function',
function () {
+ var sortFn = function (a, b) {
+ return -a.localeCompare(b);
+ };
+
+ assert.strictEqual(
+ JSON.stringify(sortKeys({c: 0, a: 0, b: 0}, sortFn)),
+ JSON.stringify({c: 0, b: 0, a: 0})
+ );
+});
+
+it('custom compare function', function () {
+ var compare = function (a, b) {
+ return -a.localeCompare(b);
+ };
+
+ assert.strictEqual(
+ JSON.stringify(sortKeys({c: 0, a: 0, b: 0}, {compare: compare})),
+ JSON.stringify({c: 0, b: 0, a: 0})
+ );
+});
+
+it('deep option', function () {
+ assert.strictEqual(
+ JSON.stringify(sortKeys({c: {c: 0, a: 0, b: 0}, a: 0, b: 0}, {deep: true})),
+ JSON.stringify({a: 0, b: 0, c: {a: 0, b: 0, c: 0}})
+ );
+
+ assert.doesNotThrow(function () {
+ var obj = {a: 0};
+ obj.circular = obj;
+ sortKeys(obj, {deep: true});
+ });
+
+ var obj = {z: 0};
+ obj.circular = obj;
+ var sortedObj = sortKeys(obj, {deep: true});
+ assert.strictEqual(sortedObj, sortedObj.circular);
+ assert.strictEqual(
+ JSON.stringify(Object.keys(sortedObj)),
+ JSON.stringify(['circular', 'z'])
+ );
+
+ var obj1 = {b: 0};
+ var obj2 = {d: 0};
+ obj1.a = obj2;
+ obj2.c = obj1;
+
+ assert.doesNotThrow(function () {
+ sortKeys(obj1, {deep: true});
+ sortKeys(obj2, {deep: true});
+ });
+
+ var sorted = sortKeys(obj1, {deep: true});
+
+ assert.strictEqual(sorted, sorted.a.c);
+ assert.strictEqual(
+ JSON.stringify(Object.keys(sorted)),
+ JSON.stringify(['a', 'b'])
+ );
+
+ assert.strictEqual(
+ JSON.stringify(sortKeys({c: {c: 0, a: 0, b: 0}, a: 0, b: 0, z: [9, 8, 7, 6, 5]}, {deep:
true})),
+ JSON.stringify({a: 0, b: 0, c: {a: 0, b: 0, c: 0}, z: [9, 8, 7, 6, 5]})
+ );
+});