The package rpms/nodejs-yn.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-yn.git/commit/?id=149b9264....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 149b92645169522a14d4372c35f113008e847b75
Author: Jared Smith <jsmith(a)fedoraproject.org>
Date: Thu May 24 15:49:07 2018 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e026ff8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/yn-2.0.0.tgz
diff --git a/README.md b/README.md
deleted file mode 100644
index 39a9923..0000000
--- a/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# nodejs-yn
-
-'Parse yes/no like values'
\ No newline at end of file
diff --git a/nodejs-yn.spec b/nodejs-yn.spec
new file mode 100644
index 0000000..2d5b2b3
--- /dev/null
+++ b/nodejs-yn.spec
@@ -0,0 +1,65 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename yn
+
+# Tests require npm(ava), which is not yet in Fedora
+%global enable_tests 0
+
+Name: nodejs-yn
+Version: 2.0.0
+Release: 1%{?dist}
+Summary: Parse yes/no like values
+
+License: MIT
+URL:
https://github.com/sindresorhus/yn.git
+Source0:
https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
+# version control repository.
+Source1:
https://raw.githubusercontent.com/sindresorhus/yn/v%{version}/test.js
+
+
+BuildArch: noarch
+ExclusiveArch: %{nodejs_arches} noarch
+
+BuildRequires: nodejs-packaging
+
+%if 0%{?enable_tests}
+BuildRequires: ava
+%endif
+
+%description
+Parse yes/no like values
+
+
+%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 lenient.js \
+ %{buildroot}%{nodejs_sitelib}/%{packagename}
+
+%nodejs_symlink_deps
+
+%check
+%nodejs_symlink_deps --check
+%{__nodejs} -e 'require("./")'
+%if 0%{?enable_tests}
+%{_bindir}/ava -v
+%else
+%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
+%endif
+
+%files
+%doc *.md
+%license license
+%{nodejs_sitelib}/%{packagename}
+
+%changelog
+* Wed May 23 2018 Jared K. Smith <jsmith(a)fedoraproject.org> - 2.0.0-1
+- Initial packaging
diff --git a/sources b/sources
new file mode 100644
index 0000000..3d10905
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (yn-2.0.0.tgz) =
b93bfc27fc225938144e0fbdbcb4e2fff95e525e6f0d04baba28bf7a67936f6b2c63bbe5e9059fd9f15b2081a39e18ef6dd2a553479ded03e063586d4c2f3a8d
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..1f50fd0
--- /dev/null
+++ b/test.js
@@ -0,0 +1,102 @@
+import test from 'ava';
+import m from '.';
+
+const truthyCases = [
+ 'y',
+ 'Y',
+ 'yes',
+ 'YES',
+ 'Yes',
+ 'true',
+ 'TRUE',
+ 'True',
+ true,
+ '1',
+ 1
+];
+test('truthy cases', t => {
+ for (const el of truthyCases) {
+ t.true(m(el));
+ t.true(m(el, {lenient: true}));
+ }
+});
+
+const falseyCases = [
+ 'n',
+ 'N',
+ 'no',
+ 'NO',
+ 'No',
+ 'false',
+ 'FALSE',
+ 'False',
+ false,
+ '0',
+ 0
+];
+test('falsey cases', t => {
+ for (const el of falseyCases) {
+ t.false(m(el));
+ t.false(m(el, {lenient: true}));
+ }
+});
+
+const nullCases = [
+ // Falsey cases that don't work
+ NaN,
+ null,
+ undefined,
+ '',
+ [],
+ {},
+ // Numbers: only works on 0 and 1
+ '10',
+ 10,
+ '-1',
+ -1,
+ '0.5',
+ 0.5,
+ '1BadIntParsing',
+ '0x000',
+ // Strings with a low edit-distance don't work
+ 'flase',
+ 'ture',
+ 'n o',
+ 'yn',
+ // Other
+ 'unicorn'
+];
+test('null cases', t => {
+ for (const el of nullCases) {
+ t.is(m(el), null);
+ t.is(m(el, {lenient: true}), null);
+ }
+});
+
+test('lenient option - truthy value cases', t => {
+ t.true(m('ues', {lenient: true}));
+ t.true(m('ywa', {lenient: true}));
+ t.true(m('tes', {lenient: true}));
+ t.true(m('twa', {lenient: true}));
+ t.true(m('urd', {lenient: true}));
+});
+
+test('lenient option - falsey value cases', t => {
+ t.false(m('ni', {lenient: true}));
+ t.false(m('bi', {lenient: true}));
+ t.false(m('mo', {lenient: true}));
+});
+
+test('default option throws error if not a boolean type', t => {
+ t.throws(() => m('10', {default: 10}), 'Expected the `default` option to
be of type `boolean`, got `number`');
+});
+
+test('default option', t => {
+ t.true(m('10', {default: true}));
+ t.false(m('10', {default: false}));
+});
+
+test('default option with lenient option', t => {
+ t.true(m('10', {default: true, lenient: true}));
+ t.false(m('10', {default: false, lenient: true}));
+});