pax_global_header00006660000000000000000000000064142315650670014523gustar00rootroot0000000000000052 comment=6cca85b9f9851798dc9cadc6a2164a8729f8f9ea intl-fallback-symbol-1.0.0/000077500000000000000000000000001423156506700155275ustar00rootroot00000000000000intl-fallback-symbol-1.0.0/.eslintrc000066400000000000000000000000531423156506700173510ustar00rootroot00000000000000{ "root": true, "extends": "@ljharb", } intl-fallback-symbol-1.0.0/.github/000077500000000000000000000000001423156506700170675ustar00rootroot00000000000000intl-fallback-symbol-1.0.0/.github/FUNDING.yml000066400000000000000000000011171423156506700207040ustar00rootroot00000000000000# These are supported funding model platforms github: [ljharb] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username tidelift: npm/intl-fallback-symbol community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] intl-fallback-symbol-1.0.0/.github/workflows/000077500000000000000000000000001423156506700211245ustar00rootroot00000000000000intl-fallback-symbol-1.0.0/.github/workflows/node-aught.yml000066400000000000000000000005161423156506700237040ustar00rootroot00000000000000name: 'Tests: node.js < 10' on: [pull_request, push] jobs: tests: uses: ljharb/actions/.github/workflows/node.yml@main with: range: '< 10' type: minors command: npm run tests-only node: name: 'node < 10' needs: [tests] runs-on: ubuntu-latest steps: - run: 'echo tests completed' intl-fallback-symbol-1.0.0/.github/workflows/node-pretest.yml000066400000000000000000000002061423156506700242560ustar00rootroot00000000000000name: 'Tests: pretest/posttest' on: [pull_request, push] jobs: tests: uses: ljharb/actions/.github/workflows/pretest.yml@main intl-fallback-symbol-1.0.0/.github/workflows/node-tens.yml000066400000000000000000000005211423156506700235410ustar00rootroot00000000000000name: 'Tests: node.js >= 10' on: [pull_request, push] jobs: tests: uses: ljharb/actions/.github/workflows/node.yml@main with: range: '>= 10' type: minors command: npm run tests-only node: name: 'node >= 10' needs: [tests] runs-on: ubuntu-latest steps: - run: 'echo tests completed' intl-fallback-symbol-1.0.0/.github/workflows/rebase.yml000066400000000000000000000004111423156506700231040ustar00rootroot00000000000000name: Automatic Rebase on: [pull_request_target] jobs: _: name: "Automatic Rebase" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ljharb/rebase@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} intl-fallback-symbol-1.0.0/.github/workflows/require-allow-edits.yml000066400000000000000000000003031423156506700255410ustar00rootroot00000000000000name: Require “Allow Edits” on: [pull_request_target] jobs: _: name: "Require “Allow Edits”" runs-on: ubuntu-latest steps: - uses: ljharb/require-allow-edits@main intl-fallback-symbol-1.0.0/.gitignore000066400000000000000000000032351423156506700175220ustar00rootroot00000000000000# Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* lerna-debug.log* # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json # Runtime data pids *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage *.lcov # nyc test coverage .nyc_output # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # TypeScript v1 declaration files typings/ # TypeScript cache *.tsbuildinfo # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ .rts2_cache_es/ .rts2_cache_umd/ # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env .env.test # parcel-bundler cache (https://parceljs.org/) .cache # Next.js build output .next # Nuxt.js build / generate output .nuxt dist # Gatsby files .cache/ # Comment in the public line in if your project uses Gatsby and *not* Next.js # https://nextjs.org/blog/next-9-1#public-directory-support # public # vuepress build output .vuepress/dist # Serverless directories .serverless/ # FuseBox cache .fusebox/ # DynamoDB Local files .dynamodb/ # TernJS port file .tern-port # Only apps should have lockfiles npm-shrinkwrap.json package-lock.json yarn.lock intl-fallback-symbol-1.0.0/.npmignore000066400000000000000000000032601423156506700175270ustar00rootroot00000000000000# Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* lerna-debug.log* # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json # Runtime data pids *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage *.lcov # nyc test coverage .nyc_output # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # TypeScript v1 declaration files typings/ # TypeScript cache *.tsbuildinfo # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ .rts2_cache_es/ .rts2_cache_umd/ # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env .env.test # parcel-bundler cache (https://parceljs.org/) .cache # Next.js build output .next # Nuxt.js build / generate output .nuxt dist # Gatsby files .cache/ # Comment in the public line in if your project uses Gatsby and *not* Next.js # https://nextjs.org/blog/next-9-1#public-directory-support # public # vuepress build output .vuepress/dist # Serverless directories .serverless/ # FuseBox cache .fusebox/ # DynamoDB Local files .dynamodb/ # TernJS port file .tern-port # Only apps should have lockfiles npm-shrinkwrap.json package-lock.json yarn.lock .github/workflows intl-fallback-symbol-1.0.0/.npmrc000066400000000000000000000000671423156506700166520ustar00rootroot00000000000000package-lock=false allow-same-version=true message=v%s intl-fallback-symbol-1.0.0/.nycrc000066400000000000000000000002131423156506700166420ustar00rootroot00000000000000{ "all": true, "check-coverage": false, "reporter": ["text-summary", "text", "html", "json"], "exclude": [ "coverage", "test" ] } intl-fallback-symbol-1.0.0/CHANGELOG.md000066400000000000000000000014671423156506700173500ustar00rootroot00000000000000# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## v1.0.0 - 2022-04-25 ### Commits - Initial implementation, tests, readme [`d510abc`](https://github.com/ljharb/intl-fallback-symbol/commit/d510abcece46cb11de2dbe4b499151788cbb1ea8) - Initial commit [`04f0c01`](https://github.com/ljharb/intl-fallback-symbol/commit/04f0c01ba32c4a8c3f0141e0a725d336ee9f835c) - npm init [`33f4b97`](https://github.com/ljharb/intl-fallback-symbol/commit/33f4b9738edbfc7f52f2a86cebcce2160b85f7af) - Only apps should have lockfiles [`af6188d`](https://github.com/ljharb/intl-fallback-symbol/commit/af6188d7eb8558088e2c33e10426b47bc12eec48) intl-fallback-symbol-1.0.0/LICENSE000066400000000000000000000020571423156506700165400ustar00rootroot00000000000000MIT License Copyright (c) 2022 Jordan Harband Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. intl-fallback-symbol-1.0.0/README.md000066400000000000000000000045271423156506700170160ustar00rootroot00000000000000# intl-fallback-symbol [![Version Badge][npm-version-svg]][package-url] [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][deps-svg]][deps-url] [![dev dependency status][dev-deps-svg]][dev-deps-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][npm-badge-png]][package-url] ECMA-402 Intl spec's internal `FallbackSymbol`. This Symbol is well-known - shared across realms. It is present in the following engines with the description `"IntlLegacyConstructedSymbol"` ([spec](https://tc39.es/ecma402/#intl-object)): - node >= 16 - Chrome >= 91 - Safari >= 14.1 - Firefox >= 54 It is present in the following engines with the description `"IntlFallback"`: (The [ES2017 Intl spec](https://402.ecma-international.org/4.0/#intl-object) did not specify a description) - node >=8 <16 - Chrome 57 - 90 When it is present, the package will export it; when not, it will export `undefined`. ## Example ```js var IntlFallbackSymbol = require('intl-fallback-symbol'); var assert = require('assert'); assert(typeof IntlFallbackSymbol === 'symbol'); ``` ## Tests Simply clone the repo, `npm install`, and run `npm test` [package-url]: https://npmjs.org/package/intl-fallback-symbol [npm-version-svg]: https://versionbadg.es/ljharb/intl-fallback-symbol.svg [deps-svg]: https://david-dm.org/ljharb/intl-fallback-symbol.svg [deps-url]: https://david-dm.org/ljharb/intl-fallback-symbol [dev-deps-svg]: https://david-dm.org/ljharb/intl-fallback-symbol/dev-status.svg [dev-deps-url]: https://david-dm.org/ljharb/intl-fallback-symbol#info=devDependencies [npm-badge-png]: https://nodei.co/npm/intl-fallback-symbol.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/intl-fallback-symbol.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/intl-fallback-symbol.svg [downloads-url]: https://npm-stat.com/charts.html?package=intl-fallback-symbol [codecov-image]: https://codecov.io/gh/ljharb/intl-fallback-symbol/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/ljharb/intl-fallback-symbol/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/intl-fallback-symbol [actions-url]: https://github.com/ljharb/intl-fallback-symbol/actions intl-fallback-symbol-1.0.0/index.js000066400000000000000000000011771423156506700172020ustar00rootroot00000000000000'use strict'; var callBound = require('call-bind/callBound'); var find = require('array.prototype.find'); var gOPS = callBound('Object.getOwnPropertySymbols', true); var symbolToString = callBound('Symbol.prototype.toString', true); module.exports = gOPS && symbolToString && typeof Intl !== 'undefined' ? find( gOPS(Intl.DateTimeFormat.call({ __proto__: Intl.DateTimeFormat.prototype })), function (x) { var str = symbolToString(x); return str === 'Symbol(IntlLegacyConstructedSymbol)' // node >=16, chrome 91+, Safari 14.1+, Firefox 54+ || str === 'Symbol(IntlFallback)'; // node >=8 <16, chrome 57-90 } ) : void undefined; intl-fallback-symbol-1.0.0/package.json000066400000000000000000000036761423156506700200310ustar00rootroot00000000000000{ "name": "intl-fallback-symbol", "version": "1.0.0", "description": "ECMA-402 Intl spec's internal `FallbackSymbol`", "main": "index.js", "exports": { ".": "./index.js", "./package.json": "./package.json" }, "sideEffects": false, "scripts": { "prepublishOnly": "safe-publish-latest", "prepublish": "not-in-publish || npm run prepublishOnly", "pretest": "npm run lint", "test": "npm run tests-only", "tests-only": "nyc tape 'test/**/*.js'", "posttest": "aud --production", "prelint": "evalmd README.md", "lint": "eslint --ext=js,mjs .", "version": "auto-changelog && git add CHANGELOG.md", "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" }, "repository": { "type": "git", "url": "git+https://github.com/ljharb/intl-fallback-symbol.git" }, "keywords": [ "javascript", "ecmascript", "intl", "fallback", "fallback-symbol", "FallbackSymbol", "symbol" ], "author": "Jordan Harband ", "funding": { "url": "https://github.com/sponsors/ljharb" }, "license": "MIT", "bugs": { "url": "https://github.com/ljharb/intl-fallback-symbol/issues" }, "homepage": "https://github.com/ljharb/intl-fallback-symbol#readme", "dependencies": { "array.prototype.find": "^2.2.0", "call-bind": "^1.0.2" }, "devDependencies": { "@ljharb/eslint-config": "^21.0.0", "aud": "^2.0.0", "auto-changelog": "^2.4.0", "eslint": "=8.8.0", "evalmd": "^0.0.19", "has-symbols": "^1.0.3", "in-publish": "^2.0.1", "nyc": "^10.3.2", "safe-publish-latest": "^2.0.0", "symbol.prototype.description": "^1.0.5", "tape": "^5.5.3" }, "testling": { "files": "test/index.js" }, "engines": { "node": ">= 0.4" }, "auto-changelog": { "output": "CHANGELOG.md", "template": "keepachangelog", "unreleased": false, "commitLimit": false, "backfillLimit": false, "hideCredit": true } } intl-fallback-symbol-1.0.0/test/000077500000000000000000000000001423156506700165065ustar00rootroot00000000000000intl-fallback-symbol-1.0.0/test/index.js000066400000000000000000000010661423156506700201560ustar00rootroot00000000000000'use strict'; var test = require('tape'); var description = require('symbol.prototype.description'); var IntlFallbackSymbol = require('../'); test('IntlFallbackSymbol', function (t) { t.match(typeof IntlFallbackSymbol, /^symbol|undefined$/, 'is a Symbol, or undefined'); t.test('Symbol present', { skip: typeof IntlFallbackSymbol !== 'symbol' }, function (st) { var desc = description(IntlFallbackSymbol); st.match( desc, /^IntlFallback|IntlLegacyConstructedSymbol$/, 'FallbackSymbol has description ' + desc ); st.end(); }); t.end(); });