Skip to content

Commit

Permalink
SMall fixes
Browse files Browse the repository at this point in the history
* Adding condition to check node version
* Adding ndoe typings
  • Loading branch information
atomicpages committed Jun 9, 2019
1 parent a9e7741 commit 701069e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,7 @@ language: node_js
node_js:
- 8.16.0
- 10.0.0
- 12.0.0
script: yarn ci
branches:
only:
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -41,6 +41,7 @@
"@types/fs-extra": "^7.0.0",
"@types/glob": "^5.0.30",
"@types/mocha": "^2.2.40",
"@types/node": "^12.0.7",
"@types/npm-packlist": "^1.1.0",
"@types/yargs": "^6.6.0",
"clean-ts-built": "^1.0.0",
Expand Down
13 changes: 10 additions & 3 deletions src/sync-dir.ts
Expand Up @@ -4,9 +4,16 @@ import { resolve } from 'path'
import * as fs from 'fs-extra'
import { getFileHash } from './copy'

// Symbol.asyncIterator polyfill for Node 8 + 9
;(Symbol as any).asyncIterator =
Symbol.asyncIterator || Symbol('Symbol.asyncIterator')
const NODE_MAJOR_VERSION = parseInt(
(<any>process).versions.node.split('.').shift(),
10
)

if (NODE_MAJOR_VERSION >= 8 && NODE_MAJOR_VERSION < 10) {
// Symbol.asyncIterator polyfill for Node 8 + 9
;(Symbol as any).asyncIterator =
Symbol.asyncIterator || Symbol('Symbol.asyncIterator')
}

const globP = util.promisify(glob)

Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Expand Up @@ -50,6 +50,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67"
integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==

"@types/node@^12.0.7":
version "12.0.7"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.7.tgz#4f2563bad652b2acb1722d7e7aae2b0ff62d192c"
integrity sha512-1YKeT4JitGgE4SOzyB9eMwO0nGVNkNEsm9qlIt1Lqm/tG2QEiSMTD4kS3aO6L+w5SClLVxALmIBESK6Mk5wX0A==

"@types/npm-packlist@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@types/npm-packlist/-/npm-packlist-1.1.0.tgz#d14cdb7b1e759680ad54f77fe6fede5e821817d7"
Expand Down

0 comments on commit 701069e

Please sign in to comment.