string-character-is-astral-surrogate 2.0.4 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -20
- package/LICENSE +1 -1
- package/README.md +4 -1
- package/dist/string-character-is-astral-surrogate.esm.js +2 -27
- package/dist/string-character-is-astral-surrogate.umd.js +2 -2
- package/examples/_quickTake.js +1 -0
- package/package.json +21 -79
- package/types/index.d.ts +0 -0
- package/examples/api.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,26 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## 2.0.3 (2021-11-02)
|
|
7
|
-
|
|
8
|
-
### Bug Fixes
|
|
9
|
-
|
|
10
|
-
- bump TS and separate ESLint plugins away from this monorepo ([b1ebce1](https://github.com/codsen/codsen/commit/b1ebce1637d8c41c2d848fc24b0ba4058865bd5d))
|
|
11
|
-
|
|
12
|
-
### Features
|
|
13
|
-
|
|
14
|
-
- migrate to ES Modules ([c579dff](https://github.com/codsen/codsen/commit/c579dff3b23205e383035ca10ddcec671e35d0fe))
|
|
15
|
-
|
|
16
|
-
### BREAKING CHANGES
|
|
17
|
-
|
|
18
|
-
- programs now are in ES Modules and won't work with Common JS require()
|
|
19
|
-
|
|
20
|
-
## 2.0.1 (2021-09-13)
|
|
21
|
-
|
|
22
|
-
### Bug Fixes
|
|
23
|
-
|
|
24
|
-
- bump TS and separate ESLint plugins away from this monorepo ([2e07d42](https://github.com/codsen/codsen/commit/2e07d424222b6ffedf5fb45c83ad453627ec2904))
|
|
25
|
-
|
|
26
6
|
## 2.0.0 (2021-09-09)
|
|
27
7
|
|
|
28
8
|
### Features
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010
|
|
3
|
+
Copyright (c) 2010-2021 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@ If you need a legacy version which works with `require`, use version 1.13.0
|
|
|
38
38
|
|
|
39
39
|
```js
|
|
40
40
|
import { strict as assert } from "assert";
|
|
41
|
+
|
|
41
42
|
import {
|
|
42
43
|
isHighSurrogate,
|
|
43
44
|
isLowSurrogate,
|
|
@@ -61,7 +62,7 @@ assert.equal(isLowSurrogate("\uDDE2"), true);
|
|
|
61
62
|
|
|
62
63
|
## Documentation
|
|
63
64
|
|
|
64
|
-
Please [visit codsen.com](https://codsen.com/os/string-character-is-astral-surrogate/) for a full description of the API
|
|
65
|
+
Please [visit codsen.com](https://codsen.com/os/string-character-is-astral-surrogate/) for a full description of the API.
|
|
65
66
|
|
|
66
67
|
## Contributing
|
|
67
68
|
|
|
@@ -73,4 +74,6 @@ MIT License
|
|
|
73
74
|
|
|
74
75
|
Copyright (c) 2010-2021 Roy Revelt and other contributors
|
|
75
76
|
|
|
77
|
+
|
|
76
78
|
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
|
|
79
|
+
|
|
@@ -1,35 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-character-is-astral-surrogate
|
|
3
3
|
* @fileoverview Tells, is given character a part of astral character, specifically, a high and low surrogate
|
|
4
|
-
* @version 2.0.
|
|
4
|
+
* @version 2.0.10
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-character-is-astral-surrogate/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
function isHighSurrogate(
|
|
11
|
-
if (typeof something === "string") {
|
|
12
|
-
if (something.length === 0) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
return something.charCodeAt(0) >= 55296 && something.charCodeAt(0) <= 56319;
|
|
16
|
-
}
|
|
17
|
-
if (something === undefined) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
throw new TypeError(`string-character-is-astral-surrogate/isHighSurrogate(): the input is not string but ${typeof something}`);
|
|
21
|
-
}
|
|
22
|
-
function isLowSurrogate(something) {
|
|
23
|
-
if (typeof something === "string") {
|
|
24
|
-
if (something.length === 0) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
return something.charCodeAt(0) >= 56320 && something.charCodeAt(0) <= 57343;
|
|
28
|
-
}
|
|
29
|
-
if (something === undefined) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
throw new TypeError(`string-character-is-astral-surrogate/isLowSurrogate(): the input is not string but ${typeof something}`);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { isHighSurrogate, isLowSurrogate };
|
|
10
|
+
function t(r){if(typeof r=="string")return r.length===0?!1:r.charCodeAt(0)>=55296&&r.charCodeAt(0)<=56319;if(r===void 0)return!1;throw new TypeError(`string-character-is-astral-surrogate/isHighSurrogate(): the input is not string but ${typeof r}`)}function e(r){if(typeof r=="string")return r.length===0?!1:r.charCodeAt(0)>=56320&&r.charCodeAt(0)<=57343;if(r===void 0)return!1;throw new TypeError(`string-character-is-astral-surrogate/isLowSurrogate(): the input is not string but ${typeof r}`)}export{t as isHighSurrogate,e as isLowSurrogate};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-character-is-astral-surrogate
|
|
3
3
|
* @fileoverview Tells, is given character a part of astral character, specifically, a high and low surrogate
|
|
4
|
-
* @version 2.0.
|
|
4
|
+
* @version 2.0.10
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-character-is-astral-surrogate/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
var stringCharacterIsAstralSurrogate=(()=>{var a=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var s=r=>a(r,"__esModule",{value:!0});var d=(r,t)=>{for(var e in t)a(r,e,{get:t[e],enumerable:!0})},c=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of f(t))!o.call(r,n)&&(e||n!=="default")&&a(r,n,{get:()=>t[n],enumerable:!(i=u(t,n))||i.enumerable});return r};var l=(r=>(t,e)=>r&&r.get(t)||(e=c(s({}),t,1),r&&r.set(t,e),e))(typeof WeakMap!="undefined"?new WeakMap:0);var w={};d(w,{isHighSurrogate:()=>p,isLowSurrogate:()=>g});function p(r){if(typeof r=="string")return r.length===0?!1:r.charCodeAt(0)>=55296&&r.charCodeAt(0)<=56319;if(r===void 0)return!1;throw new TypeError(`string-character-is-astral-surrogate/isHighSurrogate(): the input is not string but ${typeof r}`)}function g(r){if(typeof r=="string")return r.length===0?!1:r.charCodeAt(0)>=56320&&r.charCodeAt(0)<=57343;if(r===void 0)return!1;throw new TypeError(`string-character-is-astral-surrogate/isLowSurrogate(): the input is not string but ${typeof r}`)}return l(w);})();
|
package/examples/_quickTake.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-character-is-astral-surrogate",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
4
4
|
"description": "Tells, is given character a part of astral character, specifically, a high and low surrogate",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astral",
|
|
@@ -37,92 +37,34 @@
|
|
|
37
37
|
},
|
|
38
38
|
"types": "types/index.d.ts",
|
|
39
39
|
"scripts": {
|
|
40
|
-
"build": "
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
|
|
53
|
-
"republish": "npm publish || :",
|
|
54
|
-
"tap": "tap",
|
|
55
|
-
"pretest": "npm run build",
|
|
56
|
-
"test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
|
|
57
|
-
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
58
|
-
"tsc": "tsc",
|
|
59
|
-
"unittest": "tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf"
|
|
40
|
+
"build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
41
|
+
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
42
|
+
"dts": "rollup -c",
|
|
43
|
+
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
44
|
+
"lect": "node '../../ops/lect/lect.js'",
|
|
45
|
+
"letspublish": "yarn publish || :",
|
|
46
|
+
"lint": "eslint . --fix",
|
|
47
|
+
"perf": "node perf/check.js",
|
|
48
|
+
"prepare": "echo 'ready'",
|
|
49
|
+
"pretest": "yarn run lect && yarn run build",
|
|
50
|
+
"test": "c8 yarn run unit && yarn run examples && yarn run lint",
|
|
51
|
+
"unit": "uvu test"
|
|
60
52
|
},
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"--no-warnings",
|
|
69
|
-
"--experimental-loader",
|
|
70
|
-
"@istanbuljs/esm-loader-hook"
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
55
|
+
},
|
|
56
|
+
"c8": {
|
|
57
|
+
"check-coverage": true,
|
|
58
|
+
"exclude": [
|
|
59
|
+
"**/test/**/*.*"
|
|
71
60
|
],
|
|
72
|
-
"
|
|
61
|
+
"lines": 100
|
|
73
62
|
},
|
|
74
63
|
"lect": {
|
|
75
64
|
"licence": {
|
|
76
65
|
"extras": [
|
|
77
66
|
""
|
|
78
67
|
]
|
|
79
|
-
},
|
|
80
|
-
"req": "{ isHighSurrogate, isLowSurrogate }",
|
|
81
|
-
"various": {
|
|
82
|
-
"devDependencies": []
|
|
83
68
|
}
|
|
84
|
-
},
|
|
85
|
-
"dependencies": {
|
|
86
|
-
"@babel/runtime": "^7.16.0"
|
|
87
|
-
},
|
|
88
|
-
"devDependencies": {
|
|
89
|
-
"@babel/cli": "^7.16.0",
|
|
90
|
-
"@babel/core": "^7.16.0",
|
|
91
|
-
"@babel/node": "^7.16.0",
|
|
92
|
-
"@babel/plugin-external-helpers": "^7.16.0",
|
|
93
|
-
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
94
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
95
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
|
96
|
-
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
97
|
-
"@babel/plugin-transform-runtime": "^7.16.0",
|
|
98
|
-
"@babel/preset-env": "^7.16.0",
|
|
99
|
-
"@babel/preset-typescript": "^7.16.0",
|
|
100
|
-
"@babel/register": "^7.16.0",
|
|
101
|
-
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
102
|
-
"@rollup/plugin-babel": "^5.3.0",
|
|
103
|
-
"@rollup/plugin-commonjs": "^21.0.1",
|
|
104
|
-
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
105
|
-
"@rollup/plugin-strip": "^2.1.0",
|
|
106
|
-
"@rollup/plugin-typescript": "^8.3.0",
|
|
107
|
-
"@types/node": "^16.11.6",
|
|
108
|
-
"@types/tap": "^15.0.5",
|
|
109
|
-
"@typescript-eslint/eslint-plugin": "^5.3.0",
|
|
110
|
-
"@typescript-eslint/parser": "^5.3.0",
|
|
111
|
-
"core-js": "^3.19.1",
|
|
112
|
-
"cross-env": "^7.0.3",
|
|
113
|
-
"eslint": "^8.1.0",
|
|
114
|
-
"lect": "^0.18.4",
|
|
115
|
-
"rollup": "^2.59.0",
|
|
116
|
-
"rollup-plugin-ascii": "^0.0.3",
|
|
117
|
-
"rollup-plugin-banner": "^0.2.1",
|
|
118
|
-
"rollup-plugin-cleanup": "^3.2.1",
|
|
119
|
-
"rollup-plugin-dts": "^4.0.0",
|
|
120
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
121
|
-
"tap": "^15.0.10",
|
|
122
|
-
"tslib": "^2.3.1",
|
|
123
|
-
"typescript": "^4.4.4"
|
|
124
|
-
},
|
|
125
|
-
"engines": {
|
|
126
|
-
"node": ">=12"
|
|
127
69
|
}
|
|
128
70
|
}
|
package/types/index.d.ts
CHANGED
|
File without changes
|
package/examples/api.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"_quickTake.js":{"title":"Quick Take","content":"import { strict as assert } from \"assert\";\nimport {\n isHighSurrogate,\n isLowSurrogate,\n} from \"string-character-is-astral-surrogate\";\n\n// 🧢 = \\uD83E\\uDDE2\n\nassert.equal(isHighSurrogate(\"\\uD83E\"), true);\n// the first character, high surrogate of the cap is indeed a high surrogate\n\nassert.equal(isHighSurrogate(\"\\uDDE2\"), false);\n// the second character, low surrogate of the cap is NOT a high surrogate\n\nassert.equal(isLowSurrogate(\"\\uD83E\"), false);\n// the first character, high surrogate of the cap is NOT a low surrogate\n// it's a high surrogate\n\nassert.equal(isLowSurrogate(\"\\uDDE2\"), true);\n// the second character, low surrogate of the cap is indeed a low surrogate"}}
|