diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 5ba4143..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-08-01T02:38:44.360Z diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index 952a131..b61e587 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -81,21 +81,6 @@ jobs: id: transform-error-messages uses: stdlib-js/transform-errors-action@main - # Format error messages: - - name: 'Replace double quotes with single quotes in rewritten format string error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\( \"([a-zA-Z0-9]+)\"/Error\( format\( '\1'/g" {} \; - - # Format string literal error messages: - - name: 'Replace double quotes with single quotes in rewritten string literal error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\(\"([a-zA-Z0-9]+)\"\)/Error\( format\( '\1' \)/g" {} \; - - # Format code: - - name: 'Replace double quotes with single quotes in inserted `require` calls' - run: | - find . -name "*.js" -exec sed -E -i "s/require\( ?\"@stdlib\/error-tools-fmtprodmsg\" ?\);/require\( '@stdlib\/error-tools-fmtprodmsg' \);/g" {} \; - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - name: 'Update dependencies in package.json' run: | diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..df6f526 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +import hasInt16ArraySupport from '../docs/types/index'; +export = hasInt16ArraySupport; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..200f303 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,7 @@ +"use strict";var e=function(t,r){return function(){return r||t((r={exports:{}}).exports,r),r.exports}};var n=e(function(A,a){ +var o=typeof Int16Array=="function"?Int16Array:null;a.exports=o +});var s=e(function(q,i){ +var p=require('@stdlib/assert-is-int16array/dist'),y=require('@stdlib/constants-int16-max/dist'),I=require('@stdlib/constants-int16-min/dist'),u=n();function c(){var t,r;if(typeof u!="function")return!1;try{r=new u([1,3.14,-3.14,y+1]),t=p(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===I}catch(v){t=!1}return t}i.exports=c +});var f=s();module.exports=f; +/** @license Apache-2.0 */ +//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..4eba584 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../lib/int16array.js", "../lib/main.js", "../lib/index.js"], + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int16Array === 'function' ) ? Int16Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInt16Array = require( '@stdlib/assert-is-int16array' );\nvar INT16_MAX = require( '@stdlib/constants-int16-max' );\nvar INT16_MIN = require( '@stdlib/constants-int16-min' );\nvar GlobalInt16Array = require( './int16array.js' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Int16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int16Array` support\n*\n* @example\n* var bool = hasInt16ArraySupport();\n* // returns \n*/\nfunction hasInt16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt16Array( [ 1, 3.14, -3.14, INT16_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT16_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasInt16ArraySupport;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Int16Array` support.\n*\n* @module @stdlib/assert-has-int16array-support\n*\n* @example\n* var hasInt16ArraySupport = require( '@stdlib/assert-has-int16array-support' );\n*\n* var bool = hasInt16ArraySupport();\n* // returns \n*/\n\n// MODULES //\n\nvar hasInt16ArraySupport = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = hasInt16ArraySupport;\n"], + "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAS,OAAO,YAAe,WAAe,WAAa,KAK/DD,EAAO,QAAUC,IC3BjB,IAAAC,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAe,QAAS,8BAA+B,EACvDC,EAAY,QAAS,6BAA8B,EACnDC,EAAY,QAAS,6BAA8B,EACnDC,EAAmB,IAcvB,SAASC,GAAuB,CAC/B,IAAIC,EACAC,EAEJ,GAAK,OAAOH,GAAqB,WAChC,MAAO,GAGR,GAAI,CACHG,EAAM,IAAIH,EAAkB,CAAE,EAAG,KAAM,MAAOF,EAAU,CAAE,CAAE,EAC5DI,EACCL,EAAcM,CAAI,GAClBA,EAAK,CAAE,IAAM,GACbA,EAAK,CAAE,IAAM,GACbA,EAAK,CAAE,IAAM,IACbA,EAAK,CAAE,IAAMJ,CAEf,OAAUK,EAAM,CACfF,EAAO,EACR,CACA,OAAOA,CACR,CAKAN,EAAO,QAAUK,IC/BjB,IAAII,EAAuB,IAK3B,OAAO,QAAUA", + "names": ["require_int16array", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isInt16Array", "INT16_MAX", "INT16_MIN", "GlobalInt16Array", "hasInt16ArraySupport", "bool", "arr", "err", "hasInt16ArraySupport"] +} diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index 7a873aa..5e3e3aa 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /** * Tests for native `Int16Array` support.