pax_global_header 0000666 0000000 0000000 00000000064 14231565067 0014523 g ustar 00root root 0000000 0000000 52 comment=6cca85b9f9851798dc9cadc6a2164a8729f8f9ea
intl-fallback-symbol-1.0.0/ 0000775 0000000 0000000 00000000000 14231565067 0015527 5 ustar 00root root 0000000 0000000 intl-fallback-symbol-1.0.0/.eslintrc 0000664 0000000 0000000 00000000053 14231565067 0017351 0 ustar 00root root 0000000 0000000 {
"root": true,
"extends": "@ljharb",
}
intl-fallback-symbol-1.0.0/.github/ 0000775 0000000 0000000 00000000000 14231565067 0017067 5 ustar 00root root 0000000 0000000 intl-fallback-symbol-1.0.0/.github/FUNDING.yml 0000664 0000000 0000000 00000001117 14231565067 0020704 0 ustar 00root root 0000000 0000000 # 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/ 0000775 0000000 0000000 00000000000 14231565067 0021124 5 ustar 00root root 0000000 0000000 intl-fallback-symbol-1.0.0/.github/workflows/node-aught.yml 0000664 0000000 0000000 00000000516 14231565067 0023704 0 ustar 00root root 0000000 0000000 name: '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.yml 0000664 0000000 0000000 00000000206 14231565067 0024256 0 ustar 00root root 0000000 0000000 name: '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.yml 0000664 0000000 0000000 00000000521 14231565067 0023541 0 ustar 00root root 0000000 0000000 name: '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.yml 0000664 0000000 0000000 00000000411 14231565067 0023104 0 ustar 00root root 0000000 0000000 name: 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.yml 0000664 0000000 0000000 00000000303 14231565067 0025541 0 ustar 00root root 0000000 0000000 name: 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/.gitignore 0000664 0000000 0000000 00000003235 14231565067 0017522 0 ustar 00root root 0000000 0000000 # 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/.npmignore 0000664 0000000 0000000 00000003260 14231565067 0017527 0 ustar 00root root 0000000 0000000 # 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/.npmrc 0000664 0000000 0000000 00000000067 14231565067 0016652 0 ustar 00root root 0000000 0000000 package-lock=false
allow-same-version=true
message=v%s
intl-fallback-symbol-1.0.0/.nycrc 0000664 0000000 0000000 00000000213 14231565067 0016642 0 ustar 00root root 0000000 0000000 {
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test"
]
}
intl-fallback-symbol-1.0.0/CHANGELOG.md 0000664 0000000 0000000 00000001467 14231565067 0017350 0 ustar 00root root 0000000 0000000 # 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/LICENSE 0000664 0000000 0000000 00000002057 14231565067 0016540 0 ustar 00root root 0000000 0000000 MIT 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.md 0000664 0000000 0000000 00000004527 14231565067 0017016 0 ustar 00root root 0000000 0000000 # 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.js 0000664 0000000 0000000 00000001177 14231565067 0017202 0 ustar 00root root 0000000 0000000 '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.json 0000664 0000000 0000000 00000003676 14231565067 0020031 0 ustar 00root root 0000000 0000000 {
"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/ 0000775 0000000 0000000 00000000000 14231565067 0016506 5 ustar 00root root 0000000 0000000 intl-fallback-symbol-1.0.0/test/index.js 0000664 0000000 0000000 00000001066 14231565067 0020156 0 ustar 00root root 0000000 0000000 '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();
});