From cca73ca6e1a09357a27a348fc9d1c9e0208751ae Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 26 2017 10:19:00 +0000 Subject: import rh-nodejs6-nodejs-code-point-at-1.0.0-3.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cde6777 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/code-point-at-1.0.0.tgz diff --git a/.rh-nodejs6-nodejs-code-point-at.metadata b/.rh-nodejs6-nodejs-code-point-at.metadata new file mode 100644 index 0000000..e7c3b71 --- /dev/null +++ b/.rh-nodejs6-nodejs-code-point-at.metadata @@ -0,0 +1 @@ +f69b192d3f7d91e382e4b71bddb77878619ab0c6 SOURCES/code-point-at-1.0.0.tgz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/test.js b/SOURCES/test.js new file mode 100644 index 0000000..7d92f1f --- /dev/null +++ b/SOURCES/test.js @@ -0,0 +1,69 @@ +'use strict'; +var test = require('ava'); +var fn = require('./'); + +test(function (t) { + t.assert(fn('🐴') === 0x1F434); + + // borrowed from: + // https://github.com/mathiasbynens/String.prototype.codePointAt/blob/075017413b4a99568d0bf290250c8b17ff5441be/tests/tests.js + + // String that starts with a BMP symbol + t.assert(fn('abc\uD834\uDF06def', '') === 0x61); + t.assert(fn('abc\uD834\uDF06def', '_') === 0x61); + t.assert(fn('abc\uD834\uDF06def') === 0x61); + t.assert(fn('abc\uD834\uDF06def', -Infinity) === undefined); + t.assert(fn('abc\uD834\uDF06def', -1) === undefined); + t.assert(fn('abc\uD834\uDF06def', -0) === 0x61); + t.assert(fn('abc\uD834\uDF06def', 0) === 0x61); + t.assert(fn('abc\uD834\uDF06def', 3) === 0x1D306); + t.assert(fn('abc\uD834\uDF06def', 4) === 0xDF06); + t.assert(fn('abc\uD834\uDF06def', 5) === 0x64); + t.assert(fn('abc\uD834\uDF06def', 42) === undefined); + t.assert(fn('abc\uD834\uDF06def', Infinity) === undefined); + t.assert(fn('abc\uD834\uDF06def', Infinity) === undefined); + t.assert(fn('abc\uD834\uDF06def', NaN) === 0x61); + t.assert(fn('abc\uD834\uDF06def', false) === 0x61); + t.assert(fn('abc\uD834\uDF06def', null) === 0x61); + t.assert(fn('abc\uD834\uDF06def', undefined) === 0x61); + + // String that starts with an astral symbol + t.assert(fn('\uD834\uDF06def', '') === 0x1D306); + t.assert(fn('\uD834\uDF06def', '1') === 0xDF06); + t.assert(fn('\uD834\uDF06def', '_') === 0x1D306); + t.assert(fn('\uD834\uDF06def') === 0x1D306); + t.assert(fn('\uD834\uDF06def', -1) === undefined); + t.assert(fn('\uD834\uDF06def', -0) === 0x1D306); + t.assert(fn('\uD834\uDF06def', 0) === 0x1D306); + t.assert(fn('\uD834\uDF06def', 1) === 0xDF06); + t.assert(fn('\uD834\uDF06def', 42) === undefined); + t.assert(fn('\uD834\uDF06def', false) === 0x1D306); + t.assert(fn('\uD834\uDF06def', null) === 0x1D306); + t.assert(fn('\uD834\uDF06def', undefined) === 0x1D306); + + // Lone high surrogates + t.assert(fn('\uD834abc', '') === 0xD834); + t.assert(fn('\uD834abc', '_') === 0xD834); + t.assert(fn('\uD834abc') === 0xD834); + t.assert(fn('\uD834abc', -1) === undefined); + t.assert(fn('\uD834abc', -0) === 0xD834); + t.assert(fn('\uD834abc', 0) === 0xD834); + t.assert(fn('\uD834abc', false) === 0xD834); + t.assert(fn('\uD834abc', NaN) === 0xD834); + t.assert(fn('\uD834abc', null) === 0xD834); + t.assert(fn('\uD834abc', undefined) === 0xD834); + + // Lone low surrogates + t.assert(fn('\uDF06abc', '') === 0xDF06); + t.assert(fn('\uDF06abc', '_') === 0xDF06); + t.assert(fn('\uDF06abc') === 0xDF06); + t.assert(fn('\uDF06abc', -1) === undefined); + t.assert(fn('\uDF06abc', -0) === 0xDF06); + t.assert(fn('\uDF06abc', 0) === 0xDF06); + t.assert(fn('\uDF06abc', false) === 0xDF06); + t.assert(fn('\uDF06abc', NaN) === 0xDF06); + t.assert(fn('\uDF06abc', null) === 0xDF06); + t.assert(fn('\uDF06abc', undefined) === 0xDF06); + + t.end(); +}); diff --git a/SPECS/nodejs-code-point-at.spec b/SPECS/nodejs-code-point-at.spec new file mode 100644 index 0000000..00d3699 --- /dev/null +++ b/SPECS/nodejs-code-point-at.spec @@ -0,0 +1,72 @@ +%{?scl:%scl_package nodejs-nodejs-bl} +%{!?scl:%global pkg_name %{name}} + +%{?nodejs_find_provides_and_requires} + +%global packagename code-point-at +%global enable_tests 0 +# tests disabled until 'ava' is packaged for Fedora + +Name: %{?scl_prefix}nodejs-code-point-at +Version: 1.0.0 +Release: 3%{?dist} +Summary: ES2015 String#codePointAt() ponyfill + +License: MIT +URL: https://github.com/sindresorhus/code-point-at +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/code-point-at/v%{version}/test.js + + + +ExclusiveArch: %{nodejs_arches} noarch +BuildArch: noarch + +BuildRequires: %{?scl_prefix}nodejs-devel +%if 0%{?enable_tests} +BuildRequires: %{?scl_prefix}npm(ava) +BuildRequires: %{?scl_prefix}npm(number-is-nan) +%endif + +%description +ES2015 String#codePointAt() ponyfill + +%prep +%setup -q -n package +# setup the tests +cp -r %{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 + +%if 0%{?enable_tests} +%check +%nodejs_symlink_deps --check +/usr/bin/node test.js +%endif + + +%files +%{!?_licensedir:%global license %doc} +%doc *.md +%license license +%{nodejs_sitelib}/%{packagename} + +%changelog +* Tue Sep 13 2016 Zuzana Svetlikova - 1.0.0-3 +- Add scl macros + +* Mon Feb 29 2016 Jared Smith - 1.0.0-2 +- Fix test.js + +* Fri Oct 23 2015 Jared Smith - 1.0.0-1 +- Initial packaging