diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0aeb8c8..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/serialize-error-1.1.0.tgz diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..5204a84 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +Orphaned for 6+ weeks diff --git a/nodejs-serialize-error.spec b/nodejs-serialize-error.spec deleted file mode 100644 index 921d0c2..0000000 --- a/nodejs-serialize-error.spec +++ /dev/null @@ -1,98 +0,0 @@ -%{?nodejs_find_provides_and_requires} - -%global packagename serialize-error -%global enable_tests 0 -# tests disabled due to missing npm(ava) - -Name: nodejs-serialize-error -Version: 1.1.0 -Release: 10%{?dist} -Summary: Serialize an error into a plain object - -License: MIT -URL: https://github.com/sindresorhus/serialize-error -Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz -Source1: https://raw.githubusercontent.com/sindresorhus/serialize-error/v%{version}/test.js - - - -BuildArch: noarch -%if 0%{?fedora} >= 19 -ExclusiveArch: %{nodejs_arches} noarch -%else -ExclusiveArch: %{ix86} x86_64 %{arm} noarch -%endif - -BuildRequires: nodejs-packaging -%if 0%{?enable_tests} -BuildRequires: npm(ava) -%endif - -%description -Serialize an error into a plain object - - -%prep -%setup -q -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 -%{!?_licensedir:%global license %doc} -%doc *.md -%license license -%{nodejs_sitelib}/%{packagename} - - -%changelog -* Sat Aug 01 2020 Fedora Release Engineering - 1.1.0-10 -- Second attempt - Rebuilt for - https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue Jul 28 2020 Fedora Release Engineering - 1.1.0-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Wed Jan 29 2020 Fedora Release Engineering - 1.1.0-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Thu Jul 25 2019 Fedora Release Engineering - 1.1.0-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Fri Feb 01 2019 Fedora Release Engineering - 1.1.0-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Fri Jul 13 2018 Fedora Release Engineering - 1.1.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Thu Feb 08 2018 Fedora Release Engineering - 1.1.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 1.1.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Fri Feb 10 2017 Fedora Release Engineering - 1.1.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Mon Feb 15 2016 Jared Smith - 1.1.0-1 -- Initial packaging diff --git a/sources b/sources deleted file mode 100644 index da0dbdb..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -9159c584e20ce4d24cfdc648c0692b93 serialize-error-1.1.0.tgz diff --git a/test.js b/test.js deleted file mode 100644 index b6eac82..0000000 --- a/test.js +++ /dev/null @@ -1,102 +0,0 @@ -import test from 'ava'; -import serialize from './'; - -test(t => { - const serialized = serialize(new Error('foo')); - const x = Object.keys(serialized); - t.not(x.indexOf('name'), -1); - t.not(x.indexOf('stack'), -1); - t.not(x.indexOf('message'), -1); - t.end(); -}); - -test('should destroy circular references', t => { - const obj = {}; - obj.child = {parent: obj}; - - const serialized = serialize(obj); - - t.is(typeof serialized, 'object'); - t.is(serialized.child.parent, '[Circular]'); - t.end(); -}); - -test('should not affect the original object', t => { - const obj = {}; - obj.child = {parent: obj}; - - const serialized = serialize(obj); - - t.not(serialized, obj); - t.is(obj.child.parent, obj); - t.end(); -}); - -test('should only destroy parent references', t => { - const obj = {}; - const common = {thing: obj}; - obj.one = {firstThing: common}; - obj.two = {secondThing: common}; - - const serialized = serialize(obj); - - t.is(typeof serialized.one.firstThing, 'object'); - t.is(typeof serialized.two.secondThing, 'object'); - t.is(serialized.one.firstThing.thing, '[Circular]'); - t.is(serialized.two.secondThing.thing, '[Circular]'); - t.end(); -}); - -test('should work on arrays', t => { - const obj = {}; - const common = [obj]; - const x = [common]; - const y = [['test'], common]; - y[0][1] = y; - obj.a = {x: x}; - obj.b = {y: y}; - - const serialized = serialize(obj); - - t.true(Array.isArray(serialized.a.x)); - t.is(serialized.a.x[0][0], '[Circular]'); - t.is(serialized.b.y[0][0], 'test'); - t.is(serialized.b.y[1][0], '[Circular]'); - t.is(serialized.b.y[0][1], '[Circular]'); - t.end(); -}); - -test('should discard nested functions', t => { - function a() {} - function b() {} - a.b = b; - const obj = {a: a}; - - const serialized = serialize(obj); - - t.same(serialized, {}); - t.end(); -}); - -test('should replace top-level functions with a helpful string', t => { - function a() {} - function b() {} - a.b = b; - - const serialized = serialize(a); - - t.is(serialized, '[Function: a]'); - t.end(); -}); - -test('should drop functions', t => { - function a() {} - a.foo = 'bar;'; - a.b = a; - const obj = {a: a}; - - const serialized = serialize(obj); - t.same(serialized, {}); - t.false(serialized.hasOwnProperty('a')); - t.end(); -});