pax_global_header 0000666 0000000 0000000 00000000064 14730573045 0014522 g ustar 00root root 0000000 0000000 52 comment=de5544641d413a07e82e69afe4a0962f3af22e05
ljharb-intl-fallback-symbol-5d91f92/ 0000775 0000000 0000000 00000000000 14730573045 0017335 5 ustar 00root root 0000000 0000000 ljharb-intl-fallback-symbol-5d91f92/.eslintrc 0000664 0000000 0000000 00000000053 14730573045 0021157 0 ustar 00root root 0000000 0000000 {
"root": true,
"extends": "@ljharb",
}
ljharb-intl-fallback-symbol-5d91f92/.github/ 0000775 0000000 0000000 00000000000 14730573045 0020675 5 ustar 00root root 0000000 0000000 ljharb-intl-fallback-symbol-5d91f92/.github/FUNDING.yml 0000664 0000000 0000000 00000001117 14730573045 0022512 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']
ljharb-intl-fallback-symbol-5d91f92/.github/workflows/ 0000775 0000000 0000000 00000000000 14730573045 0022732 5 ustar 00root root 0000000 0000000 ljharb-intl-fallback-symbol-5d91f92/.github/workflows/node-aught.yml 0000664 0000000 0000000 00000000533 14730573045 0025511 0 ustar 00root root 0000000 0000000 name: 'Tests: node.js < 10'
on: [pull_request, push]
permissions:
contents: read
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: true
ljharb-intl-fallback-symbol-5d91f92/.github/workflows/node-pretest.yml 0000664 0000000 0000000 00000000245 14730573045 0026067 0 ustar 00root root 0000000 0000000 name: 'Tests: pretest/posttest'
on: [pull_request, push]
permissions:
contents: read
jobs:
tests:
uses: ljharb/actions/.github/workflows/pretest.yml@main
ljharb-intl-fallback-symbol-5d91f92/.github/workflows/node-tens.yml 0000664 0000000 0000000 00000000547 14730573045 0025357 0 ustar 00root root 0000000 0000000 name: 'Tests: node.js 10 - 20'
on: [pull_request, push]
permissions:
contents: read
jobs:
tests:
uses: ljharb/actions/.github/workflows/node.yml@main
with:
range: '>= 10 < 20'
type: minors
command: npm run tests-only
node:
name: 'node 10 - 20'
needs: [tests]
runs-on: ubuntu-latest
steps:
- run: true
ljharb-intl-fallback-symbol-5d91f92/.github/workflows/node-twenties.yml 0000664 0000000 0000000 00000000536 14730573045 0026246 0 ustar 00root root 0000000 0000000 name: 'Tests: node.js >= 20'
on: [pull_request, push]
permissions:
contents: read
jobs:
tests:
uses: ljharb/actions/.github/workflows/node.yml@main
with:
range: '>= 20'
type: minors
command: npm run tests-only
node:
name: 'node >= 20'
needs: [tests]
runs-on: ubuntu-latest
steps:
- run: true
ljharb-intl-fallback-symbol-5d91f92/.github/workflows/rebase.yml 0000664 0000000 0000000 00000000257 14730573045 0024722 0 ustar 00root root 0000000 0000000 name: Automatic Rebase
on: [pull_request_target]
jobs:
_:
uses: ljharb/actions/.github/workflows/rebase.yml@main
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
ljharb-intl-fallback-symbol-5d91f92/.github/workflows/require-allow-edits.yml 0000664 0000000 0000000 00000000515 14730573045 0027354 0 ustar 00root root 0000000 0000000 name: Require “Allow Edits”
on: [pull_request_target]
permissions:
contents: read
jobs:
_:
permissions:
pull-requests: read # for ljharb/require-allow-edits to check 'allow edits' on PR
name: "Require “Allow Edits”"
runs-on: ubuntu-latest
steps:
- uses: ljharb/require-allow-edits@main
ljharb-intl-fallback-symbol-5d91f92/.gitignore 0000664 0000000 0000000 00000003251 14730573045 0021326 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
.npmignore
ljharb-intl-fallback-symbol-5d91f92/.npmrc 0000664 0000000 0000000 00000000067 14730573045 0020460 0 ustar 00root root 0000000 0000000 package-lock=false
allow-same-version=true
message=v%s
ljharb-intl-fallback-symbol-5d91f92/.nycrc 0000664 0000000 0000000 00000000213 14730573045 0020450 0 ustar 00root root 0000000 0000000 {
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test"
]
}
ljharb-intl-fallback-symbol-5d91f92/CHANGELOG.md 0000664 0000000 0000000 00000005610 14730573045 0021150 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.1.1](https://github.com/ljharb/intl-fallback-symbol/compare/v1.1.0...v1.1.1) - 2024-12-18
### Commits
- [actions] split out node 10-20, and 20+ [`5f0a813`](https://github.com/ljharb/intl-fallback-symbol/commit/5f0a8130ebf0f6544e649f035676705a25f00154)
- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `auto-changelog`, `has-symbols`, `tape` [`139a406`](https://github.com/ljharb/intl-fallback-symbol/commit/139a40638da1c82e623d0ad20a2eb22824a3c5b1)
- [Refactor] use `call-bound` directly [`d191f54`](https://github.com/ljharb/intl-fallback-symbol/commit/d191f54ab0d0229ff88b703f4451dc72d6d002cb)
- [Dev Deps] update `@types/tape` [`1d3f606`](https://github.com/ljharb/intl-fallback-symbol/commit/1d3f6061100c6a4799dad2ca4268efb6899a3762)
- [Deps] update `call-bind` [`e243755`](https://github.com/ljharb/intl-fallback-symbol/commit/e2437552826af1f316c2d819ec89548e0472c823)
## [v1.1.0](https://github.com/ljharb/intl-fallback-symbol/compare/v1.0.0...v1.1.0) - 2024-08-06
### Commits
- [meta] use `npmignore` to autogenerate an npmignore file [`7fa49f3`](https://github.com/ljharb/intl-fallback-symbol/commit/7fa49f38043ba33932bb84d60437b4d88911a531)
- [New] add TS types [`6c409dc`](https://github.com/ljharb/intl-fallback-symbol/commit/6c409dc53d91ccfe2e590adaf212c1d32946496f)
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `symbol.prototype.description`, `tape` [`99075c7`](https://github.com/ljharb/intl-fallback-symbol/commit/99075c7bf6457a7a6e8551b95e0982df9fc7e0ee)
- [actions] update checkout action [`a30893a`](https://github.com/ljharb/intl-fallback-symbol/commit/a30893a40c94c359df07863b4a3db588bc942394)
- [Deps] update `array.prototype.find`, `call-bind` [`0767a7e`](https://github.com/ljharb/intl-fallback-symbol/commit/0767a7e6b3a3d6a834653353d7801cc6b057d928)
- [Dev Deps] update `aud`, `tape` [`2527f60`](https://github.com/ljharb/intl-fallback-symbol/commit/2527f60b1ade4609437b61fca79602ba8a4813f0)
- [Tests] replace `aud` with `npm audit` [`e0649f8`](https://github.com/ljharb/intl-fallback-symbol/commit/e0649f86770e9d7059c9a2910babb6226de88a6a)
## 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)
ljharb-intl-fallback-symbol-5d91f92/LICENSE 0000664 0000000 0000000 00000002057 14730573045 0020346 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.
ljharb-intl-fallback-symbol-5d91f92/README.md 0000664 0000000 0000000 00000004527 14730573045 0020624 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
ljharb-intl-fallback-symbol-5d91f92/index.d.ts 0000664 0000000 0000000 00000000123 14730573045 0021232 0 ustar 00root root 0000000 0000000 declare const IntlFallbackSymbol: symbol | undefined;
export = IntlFallbackSymbol; ljharb-intl-fallback-symbol-5d91f92/index.js 0000664 0000000 0000000 00000001364 14730573045 0021006 0 ustar 00root root 0000000 0000000 'use strict';
var callBound = require('call-bound');
var find = require('array.prototype.find');
var gOPS = callBound('Object.getOwnPropertySymbols', true);
var symbolToString = callBound('Symbol.prototype.toString', true);
/** @type {import('.')} */
module.exports = gOPS && symbolToString && typeof Intl !== 'undefined' ? find(
gOPS(Intl.DateTimeFormat.call({ __proto__: Intl.DateTimeFormat.prototype })),
function (x) {
// eslint-disable-next-line no-extra-parens
var str = /** @type {NonNullable} */ (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;
ljharb-intl-fallback-symbol-5d91f92/package.json 0000664 0000000 0000000 00000004645 14730573045 0021634 0 ustar 00root root 0000000 0000000 {
"name": "intl-fallback-symbol",
"version": "1.1.1",
"description": "ECMA-402 Intl spec's internal `FallbackSymbol`",
"main": "index.js",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"types": "./index.d.ts",
"sideEffects": false,
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"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": "npx npm@'>= 10.2' audit --production",
"prelint": "evalmd README.md",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc && attw -P",
"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.3",
"call-bound": "^1.0.3"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.1",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.2",
"@types/array.prototype.find": "^2.2.0",
"@types/get-symbol-description": "^1.0.0",
"@types/node": "^0.12.25",
"@types/tape": "^5.8.0",
"auto-changelog": "^2.5.0",
"encoding": "^0.1.13",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"has-symbols": "^1.1.0",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"symbol.prototype.description": "^1.0.6",
"tape": "^5.9.0",
"typescript": "next"
},
"testling": {
"files": "test/index.js"
},
"engines": {
"node": ">= 0.4"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows",
"types"
]
}
}
ljharb-intl-fallback-symbol-5d91f92/test/ 0000775 0000000 0000000 00000000000 14730573045 0020314 5 ustar 00root root 0000000 0000000 ljharb-intl-fallback-symbol-5d91f92/test/index.js 0000664 0000000 0000000 00000001174 14730573045 0021764 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) {
// eslint-disable-next-line no-extra-parens
var desc = description(/** @type {symbol} */ (IntlFallbackSymbol));
st.match(
desc,
/^IntlFallback|IntlLegacyConstructedSymbol$/,
'FallbackSymbol has description ' + desc
);
st.end();
});
t.end();
});
ljharb-intl-fallback-symbol-5d91f92/tsconfig.json 0000664 0000000 0000000 00000000260 14730573045 0022042 0 ustar 00root root 0000000 0000000 {
"extends": "@ljharb/tsconfig",
"compilerOptions": {
"maxNodeModuleJsDepth": 0,
"target": "es2021",
},
"exclude": [
"coverage",
],
"typeRoots": [
"types",
],
}
ljharb-intl-fallback-symbol-5d91f92/types/ 0000775 0000000 0000000 00000000000 14730573045 0020501 5 ustar 00root root 0000000 0000000 ljharb-intl-fallback-symbol-5d91f92/types/symbol.prototype.description/ 0000775 0000000 0000000 00000000000 14730573045 0026374 5 ustar 00root root 0000000 0000000 ljharb-intl-fallback-symbol-5d91f92/types/symbol.prototype.description/implementation.d.ts 0000664 0000000 0000000 00000000221 14730573045 0032206 0 ustar 00root root 0000000 0000000 declare module 'symbol.prototype.description/implementation' {
function implementation(this: symbol): string;
export = implementation;
} ljharb-intl-fallback-symbol-5d91f92/types/symbol.prototype.description/index.d.ts 0000664 0000000 0000000 00000000670 14730573045 0030300 0 ustar 00root root 0000000 0000000 declare module 'symbol.prototype.description' {
function getSymbolDescription(sym: symbol): string;
const symbolDescription: typeof getSymbolDescription & {
getPolyfill: typeof import('symbol.prototype.description/polyfill'),
implementation: typeof import('symbol.prototype.description/implementation'),
shim: typeof import('symbol.prototype.description/shim'),
};
export = symbolDescription;
}
ljharb-intl-fallback-symbol-5d91f92/types/symbol.prototype.description/polyfill.d.ts 0000664 0000000 0000000 00000000265 14730573045 0031023 0 ustar 00root root 0000000 0000000 declare module 'symbol.prototype.description/polyfill' {
function getPolyfill(): () => typeof import('symbol.prototype.description/implementation');
export = getPolyfill;
} ljharb-intl-fallback-symbol-5d91f92/types/symbol.prototype.description/shim.d.ts 0000664 0000000 0000000 00000000235 14730573045 0030126 0 ustar 00root root 0000000 0000000 declare module 'symbol.prototype.description/shim' {
function shim(): typeof import('symbol.prototype.description/implementation');
export = shim;
}