!1 add package

Merge pull request !1 from 付安安/master
This commit is contained in:
openeuler-ci-bot 2020-08-24 11:31:39 +08:00 committed by Gitee
commit d1ae2a3d68
4 changed files with 112 additions and 0 deletions

BIN
concat-stream-1.6.0.tar.gz Normal file

Binary file not shown.

View File

@ -0,0 +1,60 @@
commit 845a8c5172bbab80b2af72e3a73d1ccf14477a2e
Author: Tom Hughes <tom@compton.nu>
Date: Sun Jan 17 16:37:10 2016 +0000
Only require typedarray if necessary
diff --git a/test/buffer.js b/test/buffer.js
index d28f5f9..fa7127f 100644
--- a/test/buffer.js
+++ b/test/buffer.js
@@ -1,7 +1,11 @@
var concat = require('../')
var test = require('tape')
-var TA = require('typedarray')
-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array
+
+if (typeof Uint8Array === 'undefined') {
+ var U8 = require('typedarray').Uint8Array
+} else {
+ var U8 = Uint8Array
+}
test('buffer stream', function (t) {
t.plan(2)
diff --git a/test/string.js b/test/string.js
index 218c522..29001f4 100644
--- a/test/string.js
+++ b/test/string.js
@@ -1,7 +1,11 @@
var concat = require('../')
var test = require('tape')
-var TA = require('typedarray')
-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array
+
+if (typeof Uint8Array === 'undefined') {
+ var U8 = require('typedarray').Uint8Array
+} else {
+ var U8 = Uint8Array
+}
test('string -> buffer stream', function (t) {
t.plan(2)
diff --git a/test/typedarray.js b/test/typedarray.js
index ee07110..fffda88 100644
--- a/test/typedarray.js
+++ b/test/typedarray.js
@@ -1,7 +1,11 @@
var concat = require('../')
var test = require('tape')
-var TA = require('typedarray')
-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array
+
+if (typeof Uint8Array === 'undefined') {
+ var U8 = require('typedarray').Uint8Array
+} else {
+ var U8 = Uint8Array
+}
test('typed array stream', function (t) {
t.plan(2)

48
nodejs-concat-stream.spec Normal file
View File

@ -0,0 +1,48 @@
%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-concat-stream
Version: 1.6.0
Release: 1
Summary: Writable stream that concatenates data and calls a callback with the result
License: MIT
URL: https://github.com/maxogden/concat-stream
Source0: https://github.com/maxogden/concat-stream/archive/v%{version}/concat-stream-%{version}.tar.gz
Patch0: nodejs-concat-stream-typedarray.patch
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(tape) npm(inherits) npm(readable-stream)
%endif
%description
%{summary}.
%prep
%autosetup -p 1 -n concat-stream-%{version}
%nodejs_fixdep readable-stream '^2.0.5'
%nodejs_fixdep -r typedarray
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/concat-stream
cp -pr package.json index.js \
%{buildroot}%{nodejs_sitelib}/concat-stream
%nodejs_symlink_deps
%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
/usr/bin/tape test/*.js test/server/*.js
%endif
%files
%doc readme.md
%license LICENSE
%{nodejs_sitelib}/concat-stream
%changelog
* Mon Aug 17 2020 Anan Fu <fuanan3@huawei.com> - 1.6.0-1
- package init

View File

@ -0,0 +1,4 @@
version_control: github
src_repo: maxogden/concat-stream
tag_prefix: "^"
seperator: "."