@basemaps/lambda-tiler 8.9.0 → 8.10.1

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.
Files changed (158) hide show
  1. package/CHANGELOG.md +56 -22
  2. package/build/__tests__/config.data.js +14 -0
  3. package/build/__tests__/config.data.js.map +1 -1
  4. package/build/cli/render.tile.js +25 -9
  5. package/build/cli/render.tile.js.map +1 -1
  6. package/build/routes/tile.style.json.js +27 -5
  7. package/build/routes/tile.style.json.js.map +1 -1
  8. package/package.json +8 -8
  9. package/src/__tests__/config.data.ts +14 -0
  10. package/src/cli/render.tile.ts +27 -8
  11. package/src/routes/tile.style.json.ts +26 -5
  12. package/tsconfig.tsbuildinfo +1 -1
  13. package/dist/index.js +0 -94950
  14. package/dist/node_modules/.package-lock.json +0 -179
  15. package/dist/node_modules/@img/sharp-libvips-linux-arm64/README.md +0 -47
  16. package/dist/node_modules/@img/sharp-libvips-linux-arm64/lib/glib-2.0/include/glibconfig.h +0 -219
  17. package/dist/node_modules/@img/sharp-libvips-linux-arm64/lib/index.js +0 -1
  18. package/dist/node_modules/@img/sharp-libvips-linux-arm64/lib/libvips-cpp.so.42 +0 -0
  19. package/dist/node_modules/@img/sharp-libvips-linux-arm64/package.json +0 -45
  20. package/dist/node_modules/@img/sharp-libvips-linux-arm64/versions.json +0 -31
  21. package/dist/node_modules/@img/sharp-linux-arm64/LICENSE +0 -191
  22. package/dist/node_modules/@img/sharp-linux-arm64/README.md +0 -18
  23. package/dist/node_modules/@img/sharp-linux-arm64/lib/sharp-linux-arm64.node +0 -0
  24. package/dist/node_modules/@img/sharp-linux-arm64/package.json +0 -47
  25. package/dist/node_modules/color/LICENSE +0 -21
  26. package/dist/node_modules/color/README.md +0 -123
  27. package/dist/node_modules/color/index.js +0 -496
  28. package/dist/node_modules/color/package.json +0 -47
  29. package/dist/node_modules/color-convert/CHANGELOG.md +0 -54
  30. package/dist/node_modules/color-convert/LICENSE +0 -21
  31. package/dist/node_modules/color-convert/README.md +0 -68
  32. package/dist/node_modules/color-convert/conversions.js +0 -839
  33. package/dist/node_modules/color-convert/index.js +0 -81
  34. package/dist/node_modules/color-convert/package.json +0 -48
  35. package/dist/node_modules/color-convert/route.js +0 -97
  36. package/dist/node_modules/color-name/LICENSE +0 -8
  37. package/dist/node_modules/color-name/README.md +0 -11
  38. package/dist/node_modules/color-name/index.js +0 -152
  39. package/dist/node_modules/color-name/package.json +0 -28
  40. package/dist/node_modules/color-string/LICENSE +0 -21
  41. package/dist/node_modules/color-string/README.md +0 -62
  42. package/dist/node_modules/color-string/index.js +0 -242
  43. package/dist/node_modules/color-string/package.json +0 -39
  44. package/dist/node_modules/detect-libc/LICENSE +0 -201
  45. package/dist/node_modules/detect-libc/README.md +0 -163
  46. package/dist/node_modules/detect-libc/index.d.ts +0 -14
  47. package/dist/node_modules/detect-libc/lib/detect-libc.js +0 -267
  48. package/dist/node_modules/detect-libc/lib/filesystem.js +0 -41
  49. package/dist/node_modules/detect-libc/lib/process.js +0 -24
  50. package/dist/node_modules/detect-libc/package.json +0 -41
  51. package/dist/node_modules/is-arrayish/LICENSE +0 -21
  52. package/dist/node_modules/is-arrayish/README.md +0 -16
  53. package/dist/node_modules/is-arrayish/index.js +0 -9
  54. package/dist/node_modules/is-arrayish/package.json +0 -45
  55. package/dist/node_modules/is-arrayish/yarn-error.log +0 -1443
  56. package/dist/node_modules/lerc/CHANGELOG.md +0 -69
  57. package/dist/node_modules/lerc/LercDecode.d.ts +0 -61
  58. package/dist/node_modules/lerc/LercDecode.es.d.ts +0 -61
  59. package/dist/node_modules/lerc/LercDecode.es.js +0 -434
  60. package/dist/node_modules/lerc/LercDecode.es.min.js +0 -17
  61. package/dist/node_modules/lerc/LercDecode.js +0 -448
  62. package/dist/node_modules/lerc/LercDecode.min.js +0 -17
  63. package/dist/node_modules/lerc/README.md +0 -123
  64. package/dist/node_modules/lerc/lerc-wasm.wasm +0 -0
  65. package/dist/node_modules/lerc/package.json +0 -30
  66. package/dist/node_modules/semver/LICENSE +0 -15
  67. package/dist/node_modules/semver/README.md +0 -664
  68. package/dist/node_modules/semver/bin/semver.js +0 -191
  69. package/dist/node_modules/semver/classes/comparator.js +0 -143
  70. package/dist/node_modules/semver/classes/index.js +0 -7
  71. package/dist/node_modules/semver/classes/range.js +0 -556
  72. package/dist/node_modules/semver/classes/semver.js +0 -319
  73. package/dist/node_modules/semver/functions/clean.js +0 -8
  74. package/dist/node_modules/semver/functions/cmp.js +0 -54
  75. package/dist/node_modules/semver/functions/coerce.js +0 -62
  76. package/dist/node_modules/semver/functions/compare-build.js +0 -9
  77. package/dist/node_modules/semver/functions/compare-loose.js +0 -5
  78. package/dist/node_modules/semver/functions/compare.js +0 -7
  79. package/dist/node_modules/semver/functions/diff.js +0 -60
  80. package/dist/node_modules/semver/functions/eq.js +0 -5
  81. package/dist/node_modules/semver/functions/gt.js +0 -5
  82. package/dist/node_modules/semver/functions/gte.js +0 -5
  83. package/dist/node_modules/semver/functions/inc.js +0 -21
  84. package/dist/node_modules/semver/functions/lt.js +0 -5
  85. package/dist/node_modules/semver/functions/lte.js +0 -5
  86. package/dist/node_modules/semver/functions/major.js +0 -5
  87. package/dist/node_modules/semver/functions/minor.js +0 -5
  88. package/dist/node_modules/semver/functions/neq.js +0 -5
  89. package/dist/node_modules/semver/functions/parse.js +0 -18
  90. package/dist/node_modules/semver/functions/patch.js +0 -5
  91. package/dist/node_modules/semver/functions/prerelease.js +0 -8
  92. package/dist/node_modules/semver/functions/rcompare.js +0 -5
  93. package/dist/node_modules/semver/functions/rsort.js +0 -5
  94. package/dist/node_modules/semver/functions/satisfies.js +0 -12
  95. package/dist/node_modules/semver/functions/sort.js +0 -5
  96. package/dist/node_modules/semver/functions/valid.js +0 -8
  97. package/dist/node_modules/semver/index.js +0 -91
  98. package/dist/node_modules/semver/internal/constants.js +0 -37
  99. package/dist/node_modules/semver/internal/debug.js +0 -11
  100. package/dist/node_modules/semver/internal/identifiers.js +0 -25
  101. package/dist/node_modules/semver/internal/lrucache.js +0 -42
  102. package/dist/node_modules/semver/internal/parse-options.js +0 -17
  103. package/dist/node_modules/semver/internal/re.js +0 -223
  104. package/dist/node_modules/semver/package.json +0 -78
  105. package/dist/node_modules/semver/preload.js +0 -4
  106. package/dist/node_modules/semver/range.bnf +0 -16
  107. package/dist/node_modules/semver/ranges/gtr.js +0 -6
  108. package/dist/node_modules/semver/ranges/intersects.js +0 -9
  109. package/dist/node_modules/semver/ranges/ltr.js +0 -6
  110. package/dist/node_modules/semver/ranges/max-satisfying.js +0 -27
  111. package/dist/node_modules/semver/ranges/min-satisfying.js +0 -26
  112. package/dist/node_modules/semver/ranges/min-version.js +0 -63
  113. package/dist/node_modules/semver/ranges/outside.js +0 -82
  114. package/dist/node_modules/semver/ranges/simplify.js +0 -49
  115. package/dist/node_modules/semver/ranges/subset.js +0 -249
  116. package/dist/node_modules/semver/ranges/to-comparators.js +0 -10
  117. package/dist/node_modules/semver/ranges/valid.js +0 -13
  118. package/dist/node_modules/sharp/LICENSE +0 -191
  119. package/dist/node_modules/sharp/README.md +0 -118
  120. package/dist/node_modules/sharp/install/check.js +0 -36
  121. package/dist/node_modules/sharp/lib/channel.js +0 -174
  122. package/dist/node_modules/sharp/lib/colour.js +0 -182
  123. package/dist/node_modules/sharp/lib/composite.js +0 -210
  124. package/dist/node_modules/sharp/lib/constructor.js +0 -444
  125. package/dist/node_modules/sharp/lib/index.d.ts +0 -1717
  126. package/dist/node_modules/sharp/lib/index.js +0 -16
  127. package/dist/node_modules/sharp/lib/input.js +0 -657
  128. package/dist/node_modules/sharp/lib/is.js +0 -169
  129. package/dist/node_modules/sharp/lib/libvips.js +0 -171
  130. package/dist/node_modules/sharp/lib/operation.js +0 -919
  131. package/dist/node_modules/sharp/lib/output.js +0 -1561
  132. package/dist/node_modules/sharp/lib/resize.js +0 -582
  133. package/dist/node_modules/sharp/lib/sharp.js +0 -86
  134. package/dist/node_modules/sharp/lib/utility.js +0 -287
  135. package/dist/node_modules/sharp/package.json +0 -219
  136. package/dist/node_modules/sharp/src/binding.gyp +0 -277
  137. package/dist/node_modules/sharp/src/common.cc +0 -1090
  138. package/dist/node_modules/sharp/src/common.h +0 -393
  139. package/dist/node_modules/sharp/src/metadata.cc +0 -287
  140. package/dist/node_modules/sharp/src/metadata.h +0 -82
  141. package/dist/node_modules/sharp/src/operations.cc +0 -471
  142. package/dist/node_modules/sharp/src/operations.h +0 -125
  143. package/dist/node_modules/sharp/src/pipeline.cc +0 -1724
  144. package/dist/node_modules/sharp/src/pipeline.h +0 -385
  145. package/dist/node_modules/sharp/src/sharp.cc +0 -40
  146. package/dist/node_modules/sharp/src/stats.cc +0 -183
  147. package/dist/node_modules/sharp/src/stats.h +0 -59
  148. package/dist/node_modules/sharp/src/utilities.cc +0 -269
  149. package/dist/node_modules/sharp/src/utilities.h +0 -19
  150. package/dist/node_modules/simple-swizzle/LICENSE +0 -21
  151. package/dist/node_modules/simple-swizzle/README.md +0 -39
  152. package/dist/node_modules/simple-swizzle/index.js +0 -29
  153. package/dist/node_modules/simple-swizzle/package.json +0 -36
  154. package/dist/package-lock.json +0 -610
  155. package/dist/package.json +0 -40
  156. package/dist/static/expected_tile_2193_153_255_z7.png +0 -0
  157. package/dist/static/expected_tile_NZTM2000Quad_30_33_z6.png +0 -0
  158. package/dist/static/expected_tile_WebMercatorQuad_252_156_z8.png +0 -0
@@ -1,267 +0,0 @@
1
- // Copyright 2017 Lovell Fuller and others.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- 'use strict';
5
-
6
- const childProcess = require('child_process');
7
- const { isLinux, getReport } = require('./process');
8
- const { LDD_PATH, readFile, readFileSync } = require('./filesystem');
9
-
10
- let cachedFamilyFilesystem;
11
- let cachedVersionFilesystem;
12
-
13
- const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true';
14
- let commandOut = '';
15
-
16
- const safeCommand = () => {
17
- if (!commandOut) {
18
- return new Promise((resolve) => {
19
- childProcess.exec(command, (err, out) => {
20
- commandOut = err ? ' ' : out;
21
- resolve(commandOut);
22
- });
23
- });
24
- }
25
- return commandOut;
26
- };
27
-
28
- const safeCommandSync = () => {
29
- if (!commandOut) {
30
- try {
31
- commandOut = childProcess.execSync(command, { encoding: 'utf8' });
32
- } catch (_err) {
33
- commandOut = ' ';
34
- }
35
- }
36
- return commandOut;
37
- };
38
-
39
- /**
40
- * A String constant containing the value `glibc`.
41
- * @type {string}
42
- * @public
43
- */
44
- const GLIBC = 'glibc';
45
-
46
- /**
47
- * A Regexp constant to get the GLIBC Version.
48
- * @type {string}
49
- */
50
- const RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i;
51
-
52
- /**
53
- * A String constant containing the value `musl`.
54
- * @type {string}
55
- * @public
56
- */
57
- const MUSL = 'musl';
58
-
59
- const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-');
60
-
61
- const familyFromReport = () => {
62
- const report = getReport();
63
- if (report.header && report.header.glibcVersionRuntime) {
64
- return GLIBC;
65
- }
66
- if (Array.isArray(report.sharedObjects)) {
67
- if (report.sharedObjects.some(isFileMusl)) {
68
- return MUSL;
69
- }
70
- }
71
- return null;
72
- };
73
-
74
- const familyFromCommand = (out) => {
75
- const [getconf, ldd1] = out.split(/[\r\n]+/);
76
- if (getconf && getconf.includes(GLIBC)) {
77
- return GLIBC;
78
- }
79
- if (ldd1 && ldd1.includes(MUSL)) {
80
- return MUSL;
81
- }
82
- return null;
83
- };
84
-
85
- const getFamilyFromLddContent = (content) => {
86
- if (content.includes('musl')) {
87
- return MUSL;
88
- }
89
- if (content.includes('GNU C Library')) {
90
- return GLIBC;
91
- }
92
- return null;
93
- };
94
-
95
- const familyFromFilesystem = async () => {
96
- if (cachedFamilyFilesystem !== undefined) {
97
- return cachedFamilyFilesystem;
98
- }
99
- cachedFamilyFilesystem = null;
100
- try {
101
- const lddContent = await readFile(LDD_PATH);
102
- cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
103
- } catch (e) {}
104
- return cachedFamilyFilesystem;
105
- };
106
-
107
- const familyFromFilesystemSync = () => {
108
- if (cachedFamilyFilesystem !== undefined) {
109
- return cachedFamilyFilesystem;
110
- }
111
- cachedFamilyFilesystem = null;
112
- try {
113
- const lddContent = readFileSync(LDD_PATH);
114
- cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
115
- } catch (e) {}
116
- return cachedFamilyFilesystem;
117
- };
118
-
119
- /**
120
- * Resolves with the libc family when it can be determined, `null` otherwise.
121
- * @returns {Promise<?string>}
122
- */
123
- const family = async () => {
124
- let family = null;
125
- if (isLinux()) {
126
- family = await familyFromFilesystem();
127
- if (!family) {
128
- family = familyFromReport();
129
- }
130
- if (!family) {
131
- const out = await safeCommand();
132
- family = familyFromCommand(out);
133
- }
134
- }
135
- return family;
136
- };
137
-
138
- /**
139
- * Returns the libc family when it can be determined, `null` otherwise.
140
- * @returns {?string}
141
- */
142
- const familySync = () => {
143
- let family = null;
144
- if (isLinux()) {
145
- family = familyFromFilesystemSync();
146
- if (!family) {
147
- family = familyFromReport();
148
- }
149
- if (!family) {
150
- const out = safeCommandSync();
151
- family = familyFromCommand(out);
152
- }
153
- }
154
- return family;
155
- };
156
-
157
- /**
158
- * Resolves `true` only when the platform is Linux and the libc family is not `glibc`.
159
- * @returns {Promise<boolean>}
160
- */
161
- const isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC;
162
-
163
- /**
164
- * Returns `true` only when the platform is Linux and the libc family is not `glibc`.
165
- * @returns {boolean}
166
- */
167
- const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC;
168
-
169
- const versionFromFilesystem = async () => {
170
- if (cachedVersionFilesystem !== undefined) {
171
- return cachedVersionFilesystem;
172
- }
173
- cachedVersionFilesystem = null;
174
- try {
175
- const lddContent = await readFile(LDD_PATH);
176
- const versionMatch = lddContent.match(RE_GLIBC_VERSION);
177
- if (versionMatch) {
178
- cachedVersionFilesystem = versionMatch[1];
179
- }
180
- } catch (e) {}
181
- return cachedVersionFilesystem;
182
- };
183
-
184
- const versionFromFilesystemSync = () => {
185
- if (cachedVersionFilesystem !== undefined) {
186
- return cachedVersionFilesystem;
187
- }
188
- cachedVersionFilesystem = null;
189
- try {
190
- const lddContent = readFileSync(LDD_PATH);
191
- const versionMatch = lddContent.match(RE_GLIBC_VERSION);
192
- if (versionMatch) {
193
- cachedVersionFilesystem = versionMatch[1];
194
- }
195
- } catch (e) {}
196
- return cachedVersionFilesystem;
197
- };
198
-
199
- const versionFromReport = () => {
200
- const report = getReport();
201
- if (report.header && report.header.glibcVersionRuntime) {
202
- return report.header.glibcVersionRuntime;
203
- }
204
- return null;
205
- };
206
-
207
- const versionSuffix = (s) => s.trim().split(/\s+/)[1];
208
-
209
- const versionFromCommand = (out) => {
210
- const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/);
211
- if (getconf && getconf.includes(GLIBC)) {
212
- return versionSuffix(getconf);
213
- }
214
- if (ldd1 && ldd2 && ldd1.includes(MUSL)) {
215
- return versionSuffix(ldd2);
216
- }
217
- return null;
218
- };
219
-
220
- /**
221
- * Resolves with the libc version when it can be determined, `null` otherwise.
222
- * @returns {Promise<?string>}
223
- */
224
- const version = async () => {
225
- let version = null;
226
- if (isLinux()) {
227
- version = await versionFromFilesystem();
228
- if (!version) {
229
- version = versionFromReport();
230
- }
231
- if (!version) {
232
- const out = await safeCommand();
233
- version = versionFromCommand(out);
234
- }
235
- }
236
- return version;
237
- };
238
-
239
- /**
240
- * Returns the libc version when it can be determined, `null` otherwise.
241
- * @returns {?string}
242
- */
243
- const versionSync = () => {
244
- let version = null;
245
- if (isLinux()) {
246
- version = versionFromFilesystemSync();
247
- if (!version) {
248
- version = versionFromReport();
249
- }
250
- if (!version) {
251
- const out = safeCommandSync();
252
- version = versionFromCommand(out);
253
- }
254
- }
255
- return version;
256
- };
257
-
258
- module.exports = {
259
- GLIBC,
260
- MUSL,
261
- family,
262
- familySync,
263
- isNonGlibcLinux,
264
- isNonGlibcLinuxSync,
265
- version,
266
- versionSync
267
- };
@@ -1,41 +0,0 @@
1
- // Copyright 2017 Lovell Fuller and others.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- 'use strict';
5
-
6
- const fs = require('fs');
7
-
8
- /**
9
- * The path where we can find the ldd
10
- */
11
- const LDD_PATH = '/usr/bin/ldd';
12
-
13
- /**
14
- * Read the content of a file synchronous
15
- *
16
- * @param {string} path
17
- * @returns {string}
18
- */
19
- const readFileSync = (path) => fs.readFileSync(path, 'utf-8');
20
-
21
- /**
22
- * Read the content of a file
23
- *
24
- * @param {string} path
25
- * @returns {Promise<string>}
26
- */
27
- const readFile = (path) => new Promise((resolve, reject) => {
28
- fs.readFile(path, 'utf-8', (err, data) => {
29
- if (err) {
30
- reject(err);
31
- } else {
32
- resolve(data);
33
- }
34
- });
35
- });
36
-
37
- module.exports = {
38
- LDD_PATH,
39
- readFileSync,
40
- readFile
41
- };
@@ -1,24 +0,0 @@
1
- // Copyright 2017 Lovell Fuller and others.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- 'use strict';
5
-
6
- const isLinux = () => process.platform === 'linux';
7
-
8
- let report = null;
9
- const getReport = () => {
10
- if (!report) {
11
- /* istanbul ignore next */
12
- if (isLinux() && process.report) {
13
- const orig = process.report.excludeNetwork;
14
- process.report.excludeNetwork = true;
15
- report = process.report.getReport();
16
- process.report.excludeNetwork = orig;
17
- } else {
18
- report = {};
19
- }
20
- }
21
- return report;
22
- };
23
-
24
- module.exports = { isLinux, getReport };
@@ -1,41 +0,0 @@
1
- {
2
- "name": "detect-libc",
3
- "version": "2.0.4",
4
- "description": "Node.js module to detect the C standard library (libc) implementation family and version",
5
- "main": "lib/detect-libc.js",
6
- "files": [
7
- "lib/",
8
- "index.d.ts"
9
- ],
10
- "scripts": {
11
- "test": "semistandard && nyc --reporter=text --check-coverage --branches=100 ava test/unit.js",
12
- "bench": "node benchmark/detect-libc",
13
- "bench:calls": "node benchmark/call-familySync.js && sleep 1 && node benchmark/call-isNonGlibcLinuxSync.js && sleep 1 && node benchmark/call-versionSync.js"
14
- },
15
- "repository": {
16
- "type": "git",
17
- "url": "git://github.com/lovell/detect-libc"
18
- },
19
- "keywords": [
20
- "libc",
21
- "glibc",
22
- "musl"
23
- ],
24
- "author": "Lovell Fuller <npm@lovell.info>",
25
- "contributors": [
26
- "Niklas Salmoukas <niklas@salmoukas.com>",
27
- "Vinícius Lourenço <vinyygamerlol@gmail.com>"
28
- ],
29
- "license": "Apache-2.0",
30
- "devDependencies": {
31
- "ava": "^2.4.0",
32
- "benchmark": "^2.1.4",
33
- "nyc": "^15.1.0",
34
- "proxyquire": "^2.1.3",
35
- "semistandard": "^14.2.3"
36
- },
37
- "engines": {
38
- "node": ">=8"
39
- },
40
- "types": "index.d.ts"
41
- }
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015 JD Ballard
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,16 +0,0 @@
1
- # node-is-arrayish [![Travis-CI.org Build Status](https://img.shields.io/travis/Qix-/node-is-arrayish.svg?style=flat-square)](https://travis-ci.org/Qix-/node-is-arrayish) [![Coveralls.io Coverage Rating](https://img.shields.io/coveralls/Qix-/node-is-arrayish.svg?style=flat-square)](https://coveralls.io/r/Qix-/node-is-arrayish)
2
- > Determines if an object can be used like an Array
3
-
4
- ## Example
5
- ```javascript
6
- var isArrayish = require('is-arrayish');
7
-
8
- isArrayish([]); // true
9
- isArrayish({__proto__: []}); // true
10
- isArrayish({}); // false
11
- isArrayish({length:10}); // false
12
- ```
13
-
14
- ## License
15
- Licensed under the [MIT License](http://opensource.org/licenses/MIT).
16
- You can find a copy of it in [LICENSE](LICENSE).
@@ -1,9 +0,0 @@
1
- module.exports = function isArrayish(obj) {
2
- if (!obj || typeof obj === 'string') {
3
- return false;
4
- }
5
-
6
- return obj instanceof Array || Array.isArray(obj) ||
7
- (obj.length >= 0 && (obj.splice instanceof Function ||
8
- (Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));
9
- };
@@ -1,45 +0,0 @@
1
- {
2
- "name": "is-arrayish",
3
- "description": "Determines if an object can be used as an array",
4
- "version": "0.3.2",
5
- "author": "Qix (http://github.com/qix-)",
6
- "keywords": [
7
- "is",
8
- "array",
9
- "duck",
10
- "type",
11
- "arrayish",
12
- "similar",
13
- "proto",
14
- "prototype",
15
- "type"
16
- ],
17
- "license": "MIT",
18
- "scripts": {
19
- "test": "mocha --require coffeescript/register ./test/**/*.coffee",
20
- "lint": "zeit-eslint --ext .jsx,.js .",
21
- "lint-staged": "git diff --diff-filter=ACMRT --cached --name-only '*.js' '*.jsx' | xargs zeit-eslint"
22
- },
23
- "repository": {
24
- "type": "git",
25
- "url": "https://github.com/qix-/node-is-arrayish.git"
26
- },
27
- "devDependencies": {
28
- "@zeit/eslint-config-node": "^0.3.0",
29
- "@zeit/git-hooks": "^0.1.4",
30
- "coffeescript": "^2.3.1",
31
- "coveralls": "^3.0.1",
32
- "eslint": "^4.19.1",
33
- "istanbul": "^0.4.5",
34
- "mocha": "^5.2.0",
35
- "should": "^13.2.1"
36
- },
37
- "eslintConfig": {
38
- "extends": [
39
- "@zeit/eslint-config-node"
40
- ]
41
- },
42
- "git": {
43
- "pre-commit": "lint-staged"
44
- }
45
- }