Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fluidframework/common-utils

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluidframework/common-utils - npm Package Compare versions

Comparing version 0.32.1 to 0.33.1000-60833

5

.eslintrc.js

@@ -8,6 +8,6 @@ /*!

"extends": [
"@fluidframework/eslint-config-fluid/eslint7"
"@fluidframework/eslint-config-fluid"
],
"parserOptions": {
"project": [ "./tsconfig.json", "./src/test/mocha/tsconfig.json", "./src/test/jest/tsconfig.json" ]
"project": [ "./tsconfig.json", "./src/test/mocha/tsconfig.json", "./src/test/jest/tsconfig.json", "./src/test/types/tsconfig.json" ]
},

@@ -19,5 +19,4 @@ "rules": {

"no-null/no-null": "off",
"prefer-arrow/prefer-arrow-functions": "off",
"prefer-rest-params": "off"
}
}

8

coverage/coverage-final.json

@@ -1,5 +0,5 @@

{"/agent/_work/1/s/common/lib/common-utils/src/assert.ts": {"path":"/agent/_work/1/s/common/lib/common-utils/src/assert.ts","statementMap":{"0":{"start":{"line":14,"column":5},"end":{"line":16,"column":null}},"1":{"start":{"line":15,"column":9},"end":{"line":15,"column":110}},"2":{"start":{"line":13,"column":1},"end":{"line":13,"column":17}}},"fnMap":{"0":{"name":"assert","decl":{"start":{"line":13,"column":17},"end":{"line":13,"column":23}},"loc":{"start":{"line":13,"column":68},"end":{"line":17,"column":2}}}},"branchMap":{"0":{"loc":{"start":{"line":14,"column":5},"end":{"line":16,"column":null}},"type":"if","locations":[{"start":{"line":14,"column":5},"end":{"line":16,"column":null}},{"start":{"line":14,"column":5},"end":{"line":16,"column":null}}]},"1":{"loc":{"start":{"line":15,"column":55},"end":{"line":15,"column":98}},"type":"cond-expr","locations":[{"start":{"line":15,"column":55},"end":{"line":15,"column":98}},{"start":{"line":15,"column":101},"end":{"line":15,"column":108}}]}},"s":{"0":4,"1":0,"2":1},"f":{"0":4},"b":{"0":[0,4],"1":[0,0]}}
,"/agent/_work/1/s/common/lib/common-utils/src/bufferBrowser.ts": {"path":"/agent/_work/1/s/common/lib/common-utils/src/bufferBrowser.ts","statementMap":{"0":{"start":{"line":6,"column":0},"end":{"line":6,"column":38}},"1":{"start":{"line":7,"column":0},"end":{"line":7,"column":34}},"2":{"start":{"line":18,"column":4},"end":{"line":30,"column":null}},"3":{"start":{"line":20,"column":12},"end":{"line":20,"column":47}},"4":{"start":{"line":25,"column":12},"end":{"line":25,"column":49}},"5":{"start":{"line":28,"column":12},"end":{"line":28,"column":60}},"6":{"start":{"line":17,"column":0},"end":{"line":17,"column":16}},"7":{"start":{"line":37,"column":30},"end":{"line":38,"column":42}},"8":{"start":{"line":38,"column":4},"end":{"line":38,"column":42}},"9":{"start":{"line":37,"column":13},"end":{"line":37,"column":30}},"10":{"start":{"line":47,"column":30},"end":{"line":48,"column":44}},"11":{"start":{"line":48,"column":5},"end":{"line":48,"column":44}},"12":{"start":{"line":47,"column":13},"end":{"line":47,"column":30}},"13":{"start":{"line":61,"column":18},"end":{"line":61,"column":81}},"14":{"start":{"line":62,"column":4},"end":{"line":68,"column":39}},"15":{"start":{"line":60,"column":0},"end":{"line":60,"column":16}},"16":{"start":{"line":82,"column":8},"end":{"line":82,"column":50}},"17":{"start":{"line":91,"column":8},"end":{"line":103,"column":null}},"18":{"start":{"line":92,"column":12},"end":{"line":92,"column":87}},"19":{"start":{"line":94,"column":15},"end":{"line":103,"column":null}},"20":{"start":{"line":96,"column":12},"end":{"line":96,"column":88}},"21":{"start":{"line":97,"column":12},"end":{"line":97,"column":113}},"22":{"start":{"line":98,"column":12},"end":{"line":98,"column":107}},"23":{"start":{"line":99,"column":15},"end":{"line":103,"column":null}},"24":{"start":{"line":100,"column":12},"end":{"line":100,"column":100}},"25":{"start":{"line":102,"column":12},"end":{"line":102,"column":34}},"26":{"start":{"line":107,"column":23},"end":{"line":107,"column":38}},"27":{"start":{"line":108,"column":28},"end":{"line":108,"column":73}},"28":{"start":{"line":109,"column":8},"end":{"line":114,"column":null}},"29":{"start":{"line":113,"column":12},"end":{"line":113,"column":35}},"30":{"start":{"line":116,"column":8},"end":{"line":116,"column":63}},"31":{"start":{"line":120,"column":8},"end":{"line":135,"column":null}},"32":{"start":{"line":122,"column":40},"end":{"line":122,"column":64}},"33":{"start":{"line":123,"column":32},"end":{"line":123,"column":69}},"34":{"start":{"line":124,"column":16},"end":{"line":124,"column":53}},"35":{"start":{"line":129,"column":32},"end":{"line":129,"column":61}},"36":{"start":{"line":130,"column":16},"end":{"line":130,"column":53}},"37":{"start":{"line":133,"column":16},"end":{"line":133,"column":64}},"38":{"start":{"line":139,"column":8},"end":{"line":139,"column":41}},"39":{"start":{"line":148,"column":27},"end":{"line":148,"column":30}},"40":{"start":{"line":151,"column":8},"end":{"line":151,"column":50}},"41":{"start":{"line":155,"column":8},"end":{"line":155,"column":61}},"42":{"start":{"line":159,"column":8},"end":{"line":162,"column":null}},"43":{"start":{"line":160,"column":33},"end":{"line":160,"column":55}},"44":{"start":{"line":161,"column":12},"end":{"line":161,"column":66}},"45":{"start":{"line":163,"column":8},"end":{"line":163,"column":28}},"46":{"start":{"line":74,"column":0},"end":{"line":74,"column":13}}},"fnMap":{"0":{"name":"Uint8ArrayToString","decl":{"start":{"line":17,"column":16},"end":{"line":17,"column":34}},"loc":{"start":{"line":17,"column":69},"end":{"line":31,"column":1}}},"1":{"name":"(anonymous_7)","decl":{"start":{"line":37,"column":30},"end":{"line":37,"column":31}},"loc":{"start":{"line":38,"column":4},"end":{"line":38,"column":42}}},"2":{"name":"(anonymous_8)","decl":{"start":{"line":47,"column":30},"end":{"line":47,"column":31}},"loc":{"start":{"line":48,"column":5},"end":{"line":48,"column":44}}},"3":{"name":"isArrayBuffer","decl":{"start":{"line":60,"column":16},"end":{"line":60,"column":29}},"loc":{"start":{"line":60,"column":38},"end":{"line":69,"column":1}}},"4":{"name":"(anonymous_10)","decl":{"start":{"line":81,"column":11},"end":{"line":81,"column":19}},"loc":{"start":{"line":81,"column":37},"end":{"line":83,"column":5}}},"5":{"name":"(anonymous_11)","decl":{"start":{"line":90,"column":4},"end":{"line":90,"column":10}},"loc":{"start":{"line":90,"column":49},"end":{"line":104,"column":5}}},"6":{"name":"(anonymous_12)","decl":{"start":{"line":106,"column":4},"end":{"line":106,"column":10}},"loc":{"start":{"line":106,"column":93},"end":{"line":117,"column":5}}},"7":{"name":"(anonymous_13)","decl":{"start":{"line":119,"column":4},"end":{"line":119,"column":10}},"loc":{"start":{"line":119,"column":52},"end":{"line":136,"column":5}}},"8":{"name":"(anonymous_14)","decl":{"start":{"line":138,"column":4},"end":{"line":138,"column":10}},"loc":{"start":{"line":138,"column":28},"end":{"line":140,"column":5}}},"9":{"name":"(anonymous_15)","decl":{"start":{"line":147,"column":12},"end":{"line":147,"column":18}},"loc":{"start":{"line":147,"column":45},"end":{"line":164,"column":5}}}},"branchMap":{"0":{"loc":{"start":{"line":19,"column":8},"end":{"line":21,"column":null}},"type":"switch","locations":[{"start":{"line":19,"column":8},"end":{"line":21,"column":null}},{"start":{"line":22,"column":8},"end":{"line":22,"column":20}},{"start":{"line":23,"column":8},"end":{"line":23,"column":21}},{"start":{"line":24,"column":8},"end":{"line":26,"column":null}},{"start":{"line":27,"column":8},"end":{"line":29,"column":null}}]},"1":{"loc":{"start":{"line":62,"column":11},"end":{"line":62,"column":37}},"type":"binary-expr","locations":[{"start":{"line":62,"column":11},"end":{"line":62,"column":37}},{"start":{"line":63,"column":8},"end":{"line":63,"column":33}},{"start":{"line":64,"column":11},"end":{"line":64,"column":25}},{"start":{"line":65,"column":11},"end":{"line":65,"column":47}},{"start":{"line":66,"column":11},"end":{"line":66,"column":44}},{"start":{"line":67,"column":11},"end":{"line":67,"column":41}},{"start":{"line":68,"column":11},"end":{"line":68,"column":37}}]},"2":{"loc":{"start":{"line":91,"column":8},"end":{"line":103,"column":null}},"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":103,"column":null}},{"start":{"line":91,"column":8},"end":{"line":103,"column":null}}]},"3":{"loc":{"start":{"line":94,"column":15},"end":{"line":103,"column":null}},"type":"if","locations":[{"start":{"line":94,"column":15},"end":{"line":103,"column":null}},{"start":{"line":94,"column":15},"end":{"line":103,"column":null}}]},"4":{"loc":{"start":{"line":94,"column":19},"end":{"line":94,"column":33}},"type":"binary-expr","locations":[{"start":{"line":94,"column":19},"end":{"line":94,"column":33}},{"start":{"line":94,"column":37},"end":{"line":94,"column":62}},{"start":{"line":94,"column":66},"end":{"line":94,"column":93}}]},"5":{"loc":{"start":{"line":99,"column":15},"end":{"line":103,"column":null}},"type":"if","locations":[{"start":{"line":99,"column":15},"end":{"line":103,"column":null}},{"start":{"line":99,"column":15},"end":{"line":103,"column":null}}]},"6":{"loc":{"start":{"line":107,"column":23},"end":{"line":107,"column":33}},"type":"cond-expr","locations":[{"start":{"line":107,"column":23},"end":{"line":107,"column":33}},{"start":{"line":107,"column":37},"end":{"line":107,"column":38}}]},"7":{"loc":{"start":{"line":107,"column":23},"end":{"line":107,"column":37}},"type":"binary-expr","locations":[{"start":{"line":107,"column":23},"end":{"line":107,"column":37}},{"start":{"line":107,"column":23},"end":{"line":107,"column":37}}]},"8":{"loc":{"start":{"line":108,"column":28},"end":{"line":108,"column":38}},"type":"cond-expr","locations":[{"start":{"line":108,"column":28},"end":{"line":108,"column":38}},{"start":{"line":108,"column":42},"end":{"line":108,"column":73}}]},"9":{"loc":{"start":{"line":108,"column":28},"end":{"line":108,"column":42}},"type":"binary-expr","locations":[{"start":{"line":108,"column":28},"end":{"line":108,"column":42}},{"start":{"line":108,"column":28},"end":{"line":108,"column":42}}]},"10":{"loc":{"start":{"line":109,"column":8},"end":{"line":114,"column":null}},"type":"if","locations":[{"start":{"line":109,"column":8},"end":{"line":114,"column":null}},{"start":{"line":109,"column":8},"end":{"line":114,"column":null}}]},"11":{"loc":{"start":{"line":109,"column":12},"end":{"line":109,"column":22}},"type":"binary-expr","locations":[{"start":{"line":109,"column":12},"end":{"line":109,"column":22}},{"start":{"line":110,"column":12},"end":{"line":110,"column":43}},{"start":{"line":111,"column":12},"end":{"line":111,"column":27}},{"start":{"line":112,"column":12},"end":{"line":112,"column":57}}]},"12":{"loc":{"start":{"line":121,"column":12},"end":{"line":125,"column":null}},"type":"switch","locations":[{"start":{"line":121,"column":12},"end":{"line":125,"column":null}},{"start":{"line":126,"column":12},"end":{"line":126,"column":24}},{"start":{"line":127,"column":12},"end":{"line":127,"column":25}},{"start":{"line":128,"column":12},"end":{"line":131,"column":null}},{"start":{"line":132,"column":12},"end":{"line":134,"column":null}}]},"13":{"loc":{"start":{"line":159,"column":8},"end":{"line":162,"column":null}},"type":"if","locations":[{"start":{"line":159,"column":8},"end":{"line":162,"column":null}},{"start":{"line":159,"column":8},"end":{"line":162,"column":null}}]}},"s":{"0":1,"1":1,"2":42,"3":21,"4":21,"5":0,"6":1,"7":1,"8":4,"9":1,"10":1,"11":6,"12":1,"13":18,"14":18,"15":1,"16":40,"17":42,"18":32,"19":10,"20":2,"21":2,"22":2,"23":8,"24":8,"25":0,"26":10,"27":10,"28":10,"29":0,"30":10,"31":32,"32":17,"33":17,"34":17,"35":15,"36":15,"37":0,"38":0,"39":17,"40":17,"41":17,"42":17,"43":9,"44":9,"45":17,"46":1},"f":{"0":42,"1":4,"2":6,"3":18,"4":40,"5":42,"6":10,"7":32,"8":0,"9":17},"b":{"0":[21,4,6,21,0],"1":[18,8,0,0,0,0,0],"2":[32,10],"3":[2,8],"4":[10,10,10],"5":[8,0],"6":[0,10],"7":[10,10],"8":[0,10],"9":[10,10],"10":[0,10],"11":[10,10,10,10],"12":[17,2,2,15,0],"13":[9,8]}}
,"/agent/_work/1/s/common/lib/common-utils/src/bufferNode.ts": {"path":"/agent/_work/1/s/common/lib/common-utils/src/bufferNode.ts","statementMap":{"0":{"start":{"line":21,"column":13},"end":{"line":21,"column":32}},"1":{"start":{"line":34,"column":4},"end":{"line":38,"column":null}},"2":{"start":{"line":35,"column":8},"end":{"line":35,"column":38}},"3":{"start":{"line":37,"column":8},"end":{"line":37,"column":51}},"4":{"start":{"line":32,"column":0},"end":{"line":32,"column":16}},"5":{"start":{"line":46,"column":16},"end":{"line":46,"column":47}},"6":{"start":{"line":50,"column":4},"end":{"line":52,"column":76}},"7":{"start":{"line":45,"column":0},"end":{"line":45,"column":16}},"8":{"start":{"line":62,"column":30},"end":{"line":63,"column":43}},"9":{"start":{"line":63,"column":4},"end":{"line":63,"column":43}},"10":{"start":{"line":62,"column":13},"end":{"line":62,"column":30}}},"fnMap":{"0":{"name":"Uint8ArrayToString","decl":{"start":{"line":32,"column":16},"end":{"line":32,"column":34}},"loc":{"start":{"line":32,"column":69},"end":{"line":39,"column":1}}},"1":{"name":"stringToBuffer","decl":{"start":{"line":45,"column":16},"end":{"line":45,"column":30}},"loc":{"start":{"line":45,"column":62},"end":{"line":53,"column":1}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":62,"column":30},"end":{"line":62,"column":31}},"loc":{"start":{"line":63,"column":4},"end":{"line":63,"column":43}}}},"branchMap":{"0":{"loc":{"start":{"line":34,"column":4},"end":{"line":38,"column":null}},"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":38,"column":null}},{"start":{"line":34,"column":4},"end":{"line":38,"column":null}}]},"1":{"loc":{"start":{"line":51,"column":10},"end":{"line":51,"column":20}},"type":"cond-expr","locations":[{"start":{"line":51,"column":10},"end":{"line":51,"column":20}},{"start":{"line":52,"column":10},"end":{"line":52,"column":75}}]}},"s":{"0":1,"1":2,"2":0,"3":2,"4":1,"5":4,"6":4,"7":1,"8":1,"9":6,"10":1},"f":{"0":2,"1":4,"2":6},"b":{"0":[0,2],"1":[0,4]}}
,"/agent/_work/1/s/common/lib/common-utils/src/hashFileNode.ts": {"path":"/agent/_work/1/s/common/lib/common-utils/src/hashFileNode.ts","statementMap":{"0":{"start":{"line":7,"column":0},"end":{"line":7,"column":31}},"1":{"start":{"line":9,"column":0},"end":{"line":9,"column":35}},"2":{"start":{"line":30,"column":4},"end":{"line":39,"column":null}},"3":{"start":{"line":32,"column":12},"end":{"line":32,"column":32}},"4":{"start":{"line":33,"column":12},"end":{"line":33,"column":18}},"5":{"start":{"line":36,"column":12},"end":{"line":36,"column":34}},"6":{"start":{"line":37,"column":12},"end":{"line":37,"column":18}},"7":{"start":{"line":40,"column":4},"end":{"line":40,"column":62}},"8":{"start":{"line":23,"column":1},"end":{"line":23,"column":8}},"9":{"start":{"line":51,"column":17},"end":{"line":51,"column":32}},"10":{"start":{"line":52,"column":23},"end":{"line":52,"column":73}},"11":{"start":{"line":53,"column":19},"end":{"line":53,"column":29}},"12":{"start":{"line":54,"column":4},"end":{"line":56,"column":33}},"13":{"start":{"line":50,"column":0},"end":{"line":50,"column":7}}},"fnMap":{"0":{"name":"hashFile","decl":{"start":{"line":23,"column":23},"end":{"line":23,"column":31}},"loc":{"start":{"line":26,"column":42},"end":{"line":41,"column":1}}},"1":{"name":"gitHashFile","decl":{"start":{"line":50,"column":22},"end":{"line":50,"column":33}},"loc":{"start":{"line":50,"column":49},"end":{"line":57,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":25,"column":37},"end":{"line":25,"column":44}},"type":"default-arg","locations":[{"start":{"line":25,"column":37},"end":{"line":25,"column":44}}]},"1":{"loc":{"start":{"line":26,"column":37},"end":{"line":26,"column":42}},"type":"default-arg","locations":[{"start":{"line":26,"column":37},"end":{"line":26,"column":42}}]},"2":{"loc":{"start":{"line":31,"column":8},"end":{"line":34,"column":null}},"type":"switch","locations":[{"start":{"line":31,"column":8},"end":{"line":34,"column":null}},{"start":{"line":35,"column":8},"end":{"line":38,"column":null}}]}},"s":{"0":1,"1":1,"2":3,"3":1,"4":1,"5":2,"6":2,"7":3,"8":1,"9":6,"10":6,"11":6,"12":6,"13":1},"f":{"0":3,"1":6},"b":{"0":[0],"1":[1],"2":[1,2]}}
{"/mnt/vss/_work/1/s/common/lib/common-utils/src/assert.ts": {"path":"/mnt/vss/_work/1/s/common/lib/common-utils/src/assert.ts","statementMap":{"0":{"start":{"line":14,"column":5},"end":{"line":16,"column":null}},"1":{"start":{"line":15,"column":9},"end":{"line":15,"column":110}},"2":{"start":{"line":13,"column":1},"end":{"line":13,"column":17}}},"fnMap":{"0":{"name":"assert","decl":{"start":{"line":13,"column":17},"end":{"line":13,"column":23}},"loc":{"start":{"line":13,"column":68},"end":{"line":17,"column":2}}}},"branchMap":{"0":{"loc":{"start":{"line":14,"column":5},"end":{"line":16,"column":null}},"type":"if","locations":[{"start":{"line":14,"column":5},"end":{"line":16,"column":null}},{"start":{"line":14,"column":5},"end":{"line":16,"column":null}}]},"1":{"loc":{"start":{"line":15,"column":55},"end":{"line":15,"column":98}},"type":"cond-expr","locations":[{"start":{"line":15,"column":55},"end":{"line":15,"column":98}},{"start":{"line":15,"column":101},"end":{"line":15,"column":108}}]}},"s":{"0":4,"1":0,"2":1},"f":{"0":4},"b":{"0":[0,4],"1":[0,0]}}
,"/mnt/vss/_work/1/s/common/lib/common-utils/src/bufferBrowser.ts": {"path":"/mnt/vss/_work/1/s/common/lib/common-utils/src/bufferBrowser.ts","statementMap":{"0":{"start":{"line":6,"column":0},"end":{"line":6,"column":38}},"1":{"start":{"line":7,"column":0},"end":{"line":7,"column":34}},"2":{"start":{"line":18,"column":4},"end":{"line":30,"column":null}},"3":{"start":{"line":20,"column":12},"end":{"line":20,"column":47}},"4":{"start":{"line":25,"column":12},"end":{"line":25,"column":49}},"5":{"start":{"line":28,"column":12},"end":{"line":28,"column":60}},"6":{"start":{"line":17,"column":0},"end":{"line":17,"column":16}},"7":{"start":{"line":37,"column":30},"end":{"line":38,"column":42}},"8":{"start":{"line":38,"column":4},"end":{"line":38,"column":42}},"9":{"start":{"line":37,"column":13},"end":{"line":37,"column":30}},"10":{"start":{"line":47,"column":30},"end":{"line":48,"column":44}},"11":{"start":{"line":48,"column":5},"end":{"line":48,"column":44}},"12":{"start":{"line":47,"column":13},"end":{"line":47,"column":30}},"13":{"start":{"line":61,"column":18},"end":{"line":61,"column":81}},"14":{"start":{"line":62,"column":4},"end":{"line":68,"column":39}},"15":{"start":{"line":60,"column":0},"end":{"line":60,"column":16}},"16":{"start":{"line":82,"column":8},"end":{"line":82,"column":50}},"17":{"start":{"line":91,"column":8},"end":{"line":103,"column":null}},"18":{"start":{"line":92,"column":12},"end":{"line":92,"column":87}},"19":{"start":{"line":94,"column":15},"end":{"line":103,"column":null}},"20":{"start":{"line":96,"column":12},"end":{"line":96,"column":88}},"21":{"start":{"line":97,"column":12},"end":{"line":97,"column":113}},"22":{"start":{"line":98,"column":12},"end":{"line":98,"column":107}},"23":{"start":{"line":99,"column":15},"end":{"line":103,"column":null}},"24":{"start":{"line":100,"column":12},"end":{"line":100,"column":100}},"25":{"start":{"line":102,"column":12},"end":{"line":102,"column":34}},"26":{"start":{"line":107,"column":23},"end":{"line":107,"column":38}},"27":{"start":{"line":108,"column":28},"end":{"line":108,"column":73}},"28":{"start":{"line":109,"column":8},"end":{"line":114,"column":null}},"29":{"start":{"line":113,"column":12},"end":{"line":113,"column":35}},"30":{"start":{"line":116,"column":8},"end":{"line":116,"column":63}},"31":{"start":{"line":120,"column":8},"end":{"line":135,"column":null}},"32":{"start":{"line":122,"column":40},"end":{"line":122,"column":64}},"33":{"start":{"line":123,"column":32},"end":{"line":123,"column":69}},"34":{"start":{"line":124,"column":16},"end":{"line":124,"column":53}},"35":{"start":{"line":129,"column":32},"end":{"line":129,"column":61}},"36":{"start":{"line":130,"column":16},"end":{"line":130,"column":53}},"37":{"start":{"line":133,"column":16},"end":{"line":133,"column":64}},"38":{"start":{"line":139,"column":8},"end":{"line":139,"column":41}},"39":{"start":{"line":148,"column":27},"end":{"line":148,"column":30}},"40":{"start":{"line":151,"column":8},"end":{"line":151,"column":50}},"41":{"start":{"line":155,"column":8},"end":{"line":155,"column":61}},"42":{"start":{"line":159,"column":8},"end":{"line":162,"column":null}},"43":{"start":{"line":160,"column":33},"end":{"line":160,"column":55}},"44":{"start":{"line":161,"column":12},"end":{"line":161,"column":66}},"45":{"start":{"line":163,"column":8},"end":{"line":163,"column":28}},"46":{"start":{"line":74,"column":0},"end":{"line":74,"column":13}}},"fnMap":{"0":{"name":"Uint8ArrayToString","decl":{"start":{"line":17,"column":16},"end":{"line":17,"column":34}},"loc":{"start":{"line":17,"column":69},"end":{"line":31,"column":1}}},"1":{"name":"(anonymous_7)","decl":{"start":{"line":37,"column":30},"end":{"line":37,"column":31}},"loc":{"start":{"line":38,"column":4},"end":{"line":38,"column":42}}},"2":{"name":"(anonymous_8)","decl":{"start":{"line":47,"column":30},"end":{"line":47,"column":31}},"loc":{"start":{"line":48,"column":5},"end":{"line":48,"column":44}}},"3":{"name":"isArrayBuffer","decl":{"start":{"line":60,"column":16},"end":{"line":60,"column":29}},"loc":{"start":{"line":60,"column":38},"end":{"line":69,"column":1}}},"4":{"name":"(anonymous_10)","decl":{"start":{"line":81,"column":11},"end":{"line":81,"column":19}},"loc":{"start":{"line":81,"column":37},"end":{"line":83,"column":5}}},"5":{"name":"(anonymous_11)","decl":{"start":{"line":90,"column":4},"end":{"line":90,"column":10}},"loc":{"start":{"line":90,"column":49},"end":{"line":104,"column":5}}},"6":{"name":"(anonymous_12)","decl":{"start":{"line":106,"column":4},"end":{"line":106,"column":10}},"loc":{"start":{"line":106,"column":93},"end":{"line":117,"column":5}}},"7":{"name":"(anonymous_13)","decl":{"start":{"line":119,"column":4},"end":{"line":119,"column":10}},"loc":{"start":{"line":119,"column":52},"end":{"line":136,"column":5}}},"8":{"name":"(anonymous_14)","decl":{"start":{"line":138,"column":4},"end":{"line":138,"column":10}},"loc":{"start":{"line":138,"column":28},"end":{"line":140,"column":5}}},"9":{"name":"(anonymous_15)","decl":{"start":{"line":147,"column":12},"end":{"line":147,"column":18}},"loc":{"start":{"line":147,"column":45},"end":{"line":164,"column":5}}}},"branchMap":{"0":{"loc":{"start":{"line":19,"column":8},"end":{"line":21,"column":null}},"type":"switch","locations":[{"start":{"line":19,"column":8},"end":{"line":21,"column":null}},{"start":{"line":22,"column":8},"end":{"line":22,"column":20}},{"start":{"line":23,"column":8},"end":{"line":23,"column":21}},{"start":{"line":24,"column":8},"end":{"line":26,"column":null}},{"start":{"line":27,"column":8},"end":{"line":29,"column":null}}]},"1":{"loc":{"start":{"line":62,"column":11},"end":{"line":62,"column":37}},"type":"binary-expr","locations":[{"start":{"line":62,"column":11},"end":{"line":62,"column":37}},{"start":{"line":63,"column":8},"end":{"line":63,"column":33}},{"start":{"line":64,"column":11},"end":{"line":64,"column":25}},{"start":{"line":65,"column":11},"end":{"line":65,"column":47}},{"start":{"line":66,"column":11},"end":{"line":66,"column":44}},{"start":{"line":67,"column":11},"end":{"line":67,"column":41}},{"start":{"line":68,"column":11},"end":{"line":68,"column":37}}]},"2":{"loc":{"start":{"line":91,"column":8},"end":{"line":103,"column":null}},"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":103,"column":null}},{"start":{"line":91,"column":8},"end":{"line":103,"column":null}}]},"3":{"loc":{"start":{"line":94,"column":15},"end":{"line":103,"column":null}},"type":"if","locations":[{"start":{"line":94,"column":15},"end":{"line":103,"column":null}},{"start":{"line":94,"column":15},"end":{"line":103,"column":null}}]},"4":{"loc":{"start":{"line":94,"column":19},"end":{"line":94,"column":33}},"type":"binary-expr","locations":[{"start":{"line":94,"column":19},"end":{"line":94,"column":33}},{"start":{"line":94,"column":37},"end":{"line":94,"column":62}},{"start":{"line":94,"column":66},"end":{"line":94,"column":93}}]},"5":{"loc":{"start":{"line":99,"column":15},"end":{"line":103,"column":null}},"type":"if","locations":[{"start":{"line":99,"column":15},"end":{"line":103,"column":null}},{"start":{"line":99,"column":15},"end":{"line":103,"column":null}}]},"6":{"loc":{"start":{"line":107,"column":23},"end":{"line":107,"column":33}},"type":"cond-expr","locations":[{"start":{"line":107,"column":23},"end":{"line":107,"column":33}},{"start":{"line":107,"column":37},"end":{"line":107,"column":38}}]},"7":{"loc":{"start":{"line":107,"column":23},"end":{"line":107,"column":37}},"type":"binary-expr","locations":[{"start":{"line":107,"column":23},"end":{"line":107,"column":37}},{"start":{"line":107,"column":23},"end":{"line":107,"column":37}}]},"8":{"loc":{"start":{"line":108,"column":28},"end":{"line":108,"column":38}},"type":"cond-expr","locations":[{"start":{"line":108,"column":28},"end":{"line":108,"column":38}},{"start":{"line":108,"column":42},"end":{"line":108,"column":73}}]},"9":{"loc":{"start":{"line":108,"column":28},"end":{"line":108,"column":42}},"type":"binary-expr","locations":[{"start":{"line":108,"column":28},"end":{"line":108,"column":42}},{"start":{"line":108,"column":28},"end":{"line":108,"column":42}}]},"10":{"loc":{"start":{"line":109,"column":8},"end":{"line":114,"column":null}},"type":"if","locations":[{"start":{"line":109,"column":8},"end":{"line":114,"column":null}},{"start":{"line":109,"column":8},"end":{"line":114,"column":null}}]},"11":{"loc":{"start":{"line":109,"column":12},"end":{"line":109,"column":22}},"type":"binary-expr","locations":[{"start":{"line":109,"column":12},"end":{"line":109,"column":22}},{"start":{"line":110,"column":12},"end":{"line":110,"column":43}},{"start":{"line":111,"column":12},"end":{"line":111,"column":27}},{"start":{"line":112,"column":12},"end":{"line":112,"column":57}}]},"12":{"loc":{"start":{"line":121,"column":12},"end":{"line":125,"column":null}},"type":"switch","locations":[{"start":{"line":121,"column":12},"end":{"line":125,"column":null}},{"start":{"line":126,"column":12},"end":{"line":126,"column":24}},{"start":{"line":127,"column":12},"end":{"line":127,"column":25}},{"start":{"line":128,"column":12},"end":{"line":131,"column":null}},{"start":{"line":132,"column":12},"end":{"line":134,"column":null}}]},"13":{"loc":{"start":{"line":159,"column":8},"end":{"line":162,"column":null}},"type":"if","locations":[{"start":{"line":159,"column":8},"end":{"line":162,"column":null}},{"start":{"line":159,"column":8},"end":{"line":162,"column":null}}]}},"s":{"0":1,"1":1,"2":42,"3":21,"4":21,"5":0,"6":1,"7":1,"8":4,"9":1,"10":1,"11":6,"12":1,"13":18,"14":18,"15":1,"16":40,"17":42,"18":32,"19":10,"20":2,"21":2,"22":2,"23":8,"24":8,"25":0,"26":10,"27":10,"28":10,"29":0,"30":10,"31":32,"32":17,"33":17,"34":17,"35":15,"36":15,"37":0,"38":0,"39":17,"40":17,"41":17,"42":17,"43":9,"44":9,"45":17,"46":1},"f":{"0":42,"1":4,"2":6,"3":18,"4":40,"5":42,"6":10,"7":32,"8":0,"9":17},"b":{"0":[21,4,6,21,0],"1":[18,8,0,0,0,0,0],"2":[32,10],"3":[2,8],"4":[10,10,10],"5":[8,0],"6":[0,10],"7":[10,10],"8":[0,10],"9":[10,10],"10":[0,10],"11":[10,10,10,10],"12":[17,2,2,15,0],"13":[9,8]}}
,"/mnt/vss/_work/1/s/common/lib/common-utils/src/bufferNode.ts": {"path":"/mnt/vss/_work/1/s/common/lib/common-utils/src/bufferNode.ts","statementMap":{"0":{"start":{"line":21,"column":13},"end":{"line":21,"column":32}},"1":{"start":{"line":34,"column":4},"end":{"line":38,"column":null}},"2":{"start":{"line":35,"column":8},"end":{"line":35,"column":38}},"3":{"start":{"line":37,"column":8},"end":{"line":37,"column":51}},"4":{"start":{"line":32,"column":0},"end":{"line":32,"column":16}},"5":{"start":{"line":46,"column":16},"end":{"line":46,"column":47}},"6":{"start":{"line":50,"column":4},"end":{"line":52,"column":76}},"7":{"start":{"line":45,"column":0},"end":{"line":45,"column":16}},"8":{"start":{"line":62,"column":30},"end":{"line":63,"column":43}},"9":{"start":{"line":63,"column":4},"end":{"line":63,"column":43}},"10":{"start":{"line":62,"column":13},"end":{"line":62,"column":30}}},"fnMap":{"0":{"name":"Uint8ArrayToString","decl":{"start":{"line":32,"column":16},"end":{"line":32,"column":34}},"loc":{"start":{"line":32,"column":69},"end":{"line":39,"column":1}}},"1":{"name":"stringToBuffer","decl":{"start":{"line":45,"column":16},"end":{"line":45,"column":30}},"loc":{"start":{"line":45,"column":62},"end":{"line":53,"column":1}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":62,"column":30},"end":{"line":62,"column":31}},"loc":{"start":{"line":63,"column":4},"end":{"line":63,"column":43}}}},"branchMap":{"0":{"loc":{"start":{"line":34,"column":4},"end":{"line":38,"column":null}},"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":38,"column":null}},{"start":{"line":34,"column":4},"end":{"line":38,"column":null}}]},"1":{"loc":{"start":{"line":51,"column":10},"end":{"line":51,"column":20}},"type":"cond-expr","locations":[{"start":{"line":51,"column":10},"end":{"line":51,"column":20}},{"start":{"line":52,"column":10},"end":{"line":52,"column":75}}]}},"s":{"0":1,"1":2,"2":0,"3":2,"4":1,"5":4,"6":4,"7":1,"8":1,"9":6,"10":1},"f":{"0":2,"1":4,"2":6},"b":{"0":[0,2],"1":[0,4]}}
,"/mnt/vss/_work/1/s/common/lib/common-utils/src/hashFileNode.ts": {"path":"/mnt/vss/_work/1/s/common/lib/common-utils/src/hashFileNode.ts","statementMap":{"0":{"start":{"line":7,"column":0},"end":{"line":7,"column":31}},"1":{"start":{"line":9,"column":0},"end":{"line":9,"column":35}},"2":{"start":{"line":30,"column":4},"end":{"line":39,"column":null}},"3":{"start":{"line":32,"column":12},"end":{"line":32,"column":32}},"4":{"start":{"line":33,"column":12},"end":{"line":33,"column":18}},"5":{"start":{"line":36,"column":12},"end":{"line":36,"column":34}},"6":{"start":{"line":37,"column":12},"end":{"line":37,"column":18}},"7":{"start":{"line":40,"column":4},"end":{"line":40,"column":62}},"8":{"start":{"line":23,"column":1},"end":{"line":23,"column":8}},"9":{"start":{"line":51,"column":17},"end":{"line":51,"column":32}},"10":{"start":{"line":52,"column":23},"end":{"line":52,"column":73}},"11":{"start":{"line":53,"column":19},"end":{"line":53,"column":29}},"12":{"start":{"line":54,"column":4},"end":{"line":56,"column":33}},"13":{"start":{"line":50,"column":0},"end":{"line":50,"column":7}}},"fnMap":{"0":{"name":"hashFile","decl":{"start":{"line":23,"column":23},"end":{"line":23,"column":31}},"loc":{"start":{"line":26,"column":42},"end":{"line":41,"column":1}}},"1":{"name":"gitHashFile","decl":{"start":{"line":50,"column":22},"end":{"line":50,"column":33}},"loc":{"start":{"line":50,"column":49},"end":{"line":57,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":25,"column":37},"end":{"line":25,"column":44}},"type":"default-arg","locations":[{"start":{"line":25,"column":37},"end":{"line":25,"column":44}}]},"1":{"loc":{"start":{"line":26,"column":37},"end":{"line":26,"column":42}},"type":"default-arg","locations":[{"start":{"line":26,"column":37},"end":{"line":26,"column":42}}]},"2":{"loc":{"start":{"line":31,"column":8},"end":{"line":34,"column":null}},"type":"switch","locations":[{"start":{"line":31,"column":8},"end":{"line":34,"column":null}},{"start":{"line":35,"column":8},"end":{"line":38,"column":null}}]}},"s":{"0":1,"1":1,"2":3,"3":1,"4":1,"5":2,"6":2,"7":3,"8":1,"9":6,"10":6,"11":6,"12":6,"13":1},"f":{"0":3,"1":6},"b":{"0":[0],"1":[1],"2":[1,2]}}
}

@@ -13,3 +13,3 @@ /*!

*/
export declare class EventForwarder<TEvent extends IEvent = IEvent> extends TypedEventEmitter<TEvent> implements IDisposable {
export declare class EventForwarder<TEvent = IEvent> extends TypedEventEmitter<TEvent> implements IDisposable {
protected static isEmitterEvent(event: string): boolean;

@@ -21,7 +21,7 @@ private static readonly newListenerEvent;

private readonly forwardingEvents;
constructor(source?: EventEmitter | IEventProvider<TEvent>);
constructor(source?: EventEmitter | IEventProvider<TEvent & IEvent>);
dispose(): void;
protected forwardEvent(source: EventEmitter | IEventProvider<TEvent>, ...events: string[]): void;
protected unforwardEvent(source: EventEmitter | IEventProvider<TEvent>, ...events: string[]): void;
protected forwardEvent(source: EventEmitter | IEventProvider<TEvent & IEvent>, ...events: string[]): void;
protected unforwardEvent(source: EventEmitter | IEventProvider<TEvent & IEvent>, ...events: string[]): void;
}
//# sourceMappingURL=eventForwarder.d.ts.map

@@ -8,3 +8,2 @@ /*!

export * from "./base64Encoding";
export * from "./batchManager";
export * from "./disposal";

@@ -11,0 +10,0 @@ export * from "./eventForwarder";

@@ -20,3 +20,2 @@ "use strict";

__exportStar(require("./base64Encoding"), exports);
__exportStar(require("./batchManager"), exports);
__exportStar(require("./disposal"), exports);

@@ -23,0 +22,0 @@ __exportStar(require("./eventForwarder"), exports);

@@ -28,7 +28,2 @@ /*!

}
export declare function extractLogSafeErrorProperties(error: any): {
message: string;
errorType?: string | undefined;
stack?: string | undefined;
};
//# sourceMappingURL=logger.d.ts.map

@@ -7,3 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.extractLogSafeErrorProperties = exports.TelemetryNullLogger = exports.BaseTelemetryNullLogger = void 0;
exports.TelemetryNullLogger = exports.BaseTelemetryNullLogger = void 0;
/**

@@ -39,33 +39,2 @@ * Null logger

exports.TelemetryNullLogger = TelemetryNullLogger;
function extractLogSafeErrorProperties(error) {
const isRegularObject = (value) => {
return value !== null && !Array.isArray(value) && typeof value === "object";
};
const removeMessageFromStack = (stack, errorName) => {
const stackFrames = stack.split("\n");
stackFrames.shift(); // Remove "[ErrorName]: [ErrorMessage]"
if (errorName !== undefined) {
stackFrames.unshift(errorName); // Add "[ErrorName]"
}
return stackFrames.join("\n");
};
const message = (typeof (error === null || error === void 0 ? void 0 : error.message) === "string")
? error.message
: String(error);
const safeProps = {
message,
};
if (isRegularObject(error)) {
const { errorType, stack, name } = error;
if (typeof errorType === "string") {
safeProps.errorType = errorType;
}
if (typeof stack === "string") {
const errorName = (typeof name === "string") ? name : undefined;
safeProps.stack = removeMessageFromStack(stack, errorName);
}
}
return safeProps;
}
exports.extractLogSafeErrorProperties = extractLogSafeErrorProperties;
//# sourceMappingURL=logger.js.map

@@ -8,3 +8,3 @@ /*!

export declare const pkgName = "@fluidframework/common-utils";
export declare const pkgVersion = "0.32.1";
export declare const pkgVersion = "0.33.1000-60833";
//# sourceMappingURL=packageVersion.d.ts.map

@@ -11,3 +11,3 @@ "use strict";

exports.pkgName = "@fluidframework/common-utils";
exports.pkgVersion = "0.32.1";
exports.pkgVersion = "0.33.1000-60833";
//# sourceMappingURL=packageVersion.js.map

@@ -20,5 +20,17 @@ /*!

/**
* Sets timeouts like the setTimeout function allowing timeouts to exceed the setTimeout's max timeout limit.
* Timeouts may not be exactly accurate due to browser implementations and the OS.
* https://stackoverflow.com/questions/21097421/what-is-the-reason-javascript-settimeout-is-so-inaccurate
* @param timeoutFn - executed when the timeout expires
* @param timeoutMs - duration of the timeout in milliseconds
* @param setTimeoutIdFn - executed to update the timeout if multiple timeouts are required when
* timeoutMs greater than maxTimeout
* @returns the initial timeout
*/
export declare function setLongTimeout(timeoutFn: () => void, timeoutMs: number, setTimeoutIdFn?: (timeoutId: ReturnType<typeof setTimeout>) => void): ReturnType<typeof setTimeout>;
/**
* This class is a thin wrapper over setTimeout and clearTimeout which
* makes it simpler to keep track of recurring timeouts with the same
* or similar handlers and timeouts.
* or similar handlers and timeouts. This class supports long timeouts
* or timeouts exceeding (2^31)-1 ms or approximately 24.8 days.
*/

@@ -25,0 +37,0 @@ export declare class Timer implements ITimer {

@@ -7,9 +7,35 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.PromiseTimer = exports.Timer = void 0;
exports.PromiseTimer = exports.Timer = exports.setLongTimeout = void 0;
const assert_1 = require("./assert");
const promises_1 = require("./promises");
const maxSetTimeoutMs = 0x7FFFFFFF; // setTimeout limit is MAX_INT32=(2^31-1).
/**
* Sets timeouts like the setTimeout function allowing timeouts to exceed the setTimeout's max timeout limit.
* Timeouts may not be exactly accurate due to browser implementations and the OS.
* https://stackoverflow.com/questions/21097421/what-is-the-reason-javascript-settimeout-is-so-inaccurate
* @param timeoutFn - executed when the timeout expires
* @param timeoutMs - duration of the timeout in milliseconds
* @param setTimeoutIdFn - executed to update the timeout if multiple timeouts are required when
* timeoutMs greater than maxTimeout
* @returns the initial timeout
*/
function setLongTimeout(timeoutFn, timeoutMs, setTimeoutIdFn) {
// The setTimeout max is 24.8 days before looping occurs.
let timeoutId;
if (timeoutMs > maxSetTimeoutMs) {
const newTimeoutMs = timeoutMs - maxSetTimeoutMs;
timeoutId = setTimeout(() => setLongTimeout(timeoutFn, newTimeoutMs, setTimeoutIdFn), maxSetTimeoutMs);
}
else {
timeoutId = setTimeout(() => timeoutFn(), timeoutMs);
}
setTimeoutIdFn === null || setTimeoutIdFn === void 0 ? void 0 : setTimeoutIdFn(timeoutId);
return timeoutId;
}
exports.setLongTimeout = setLongTimeout;
/**
* This class is a thin wrapper over setTimeout and clearTimeout which
* makes it simpler to keep track of recurring timeouts with the same
* or similar handlers and timeouts.
* or similar handlers and timeouts. This class supports long timeouts
* or timeouts exceeding (2^31)-1 ms or approximately 24.8 days.
*/

@@ -94,3 +120,7 @@ class Timer {

handler,
timeout: setTimeout(() => this.handler(), duration),
timeout: setLongTimeout(() => this.handler(), duration, (timer) => {
if (this.runningState !== undefined) {
this.runningState.timeout = timer;
}
}),
};

@@ -97,0 +127,0 @@ }

@@ -10,7 +10,7 @@ /*!

} ? E : never;
export declare type TypedEventTransform<TThis, TEvent extends IEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
export declare type TypedEventTransform<TThis, TEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent & IEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
/**
* Event Emitter helper class the supports emitting typed events
*/
export declare class TypedEventEmitter<TEvent extends IEvent> extends EventEmitter implements IEventProvider<TEvent> {
export declare class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
constructor();

@@ -17,0 +17,0 @@ readonly addListener: TypedEventTransform<this, TEvent>;

@@ -13,3 +13,3 @@ /*!

*/
export declare class EventForwarder<TEvent extends IEvent = IEvent> extends TypedEventEmitter<TEvent> implements IDisposable {
export declare class EventForwarder<TEvent = IEvent> extends TypedEventEmitter<TEvent> implements IDisposable {
protected static isEmitterEvent(event: string): boolean;

@@ -21,7 +21,7 @@ private static readonly newListenerEvent;

private readonly forwardingEvents;
constructor(source?: EventEmitter | IEventProvider<TEvent>);
constructor(source?: EventEmitter | IEventProvider<TEvent & IEvent>);
dispose(): void;
protected forwardEvent(source: EventEmitter | IEventProvider<TEvent>, ...events: string[]): void;
protected unforwardEvent(source: EventEmitter | IEventProvider<TEvent>, ...events: string[]): void;
protected forwardEvent(source: EventEmitter | IEventProvider<TEvent & IEvent>, ...events: string[]): void;
protected unforwardEvent(source: EventEmitter | IEventProvider<TEvent & IEvent>, ...events: string[]): void;
}
//# sourceMappingURL=eventForwarder.d.ts.map

@@ -8,3 +8,2 @@ /*!

export * from "./base64Encoding";
export * from "./batchManager";
export * from "./disposal";

@@ -11,0 +10,0 @@ export * from "./eventForwarder";

@@ -8,3 +8,2 @@ /*!

export * from "./base64Encoding";
export * from "./batchManager";
export * from "./disposal";

@@ -11,0 +10,0 @@ export * from "./eventForwarder";

@@ -28,7 +28,2 @@ /*!

}
export declare function extractLogSafeErrorProperties(error: any): {
message: string;
errorType?: string | undefined;
stack?: string | undefined;
};
//# sourceMappingURL=logger.d.ts.map

@@ -33,32 +33,2 @@ /*!

}
export function extractLogSafeErrorProperties(error) {
const isRegularObject = (value) => {
return value !== null && !Array.isArray(value) && typeof value === "object";
};
const removeMessageFromStack = (stack, errorName) => {
const stackFrames = stack.split("\n");
stackFrames.shift(); // Remove "[ErrorName]: [ErrorMessage]"
if (errorName !== undefined) {
stackFrames.unshift(errorName); // Add "[ErrorName]"
}
return stackFrames.join("\n");
};
const message = (typeof (error === null || error === void 0 ? void 0 : error.message) === "string")
? error.message
: String(error);
const safeProps = {
message,
};
if (isRegularObject(error)) {
const { errorType, stack, name } = error;
if (typeof errorType === "string") {
safeProps.errorType = errorType;
}
if (typeof stack === "string") {
const errorName = (typeof name === "string") ? name : undefined;
safeProps.stack = removeMessageFromStack(stack, errorName);
}
}
return safeProps;
}
//# sourceMappingURL=logger.js.map

@@ -8,3 +8,3 @@ /*!

export declare const pkgName = "@fluidframework/common-utils";
export declare const pkgVersion = "0.32.1";
export declare const pkgVersion = "0.33.1000-60833";
//# sourceMappingURL=packageVersion.d.ts.map

@@ -8,3 +8,3 @@ /*!

export const pkgName = "@fluidframework/common-utils";
export const pkgVersion = "0.32.1";
export const pkgVersion = "0.33.1000-60833";
//# sourceMappingURL=packageVersion.js.map

@@ -20,5 +20,17 @@ /*!

/**
* Sets timeouts like the setTimeout function allowing timeouts to exceed the setTimeout's max timeout limit.
* Timeouts may not be exactly accurate due to browser implementations and the OS.
* https://stackoverflow.com/questions/21097421/what-is-the-reason-javascript-settimeout-is-so-inaccurate
* @param timeoutFn - executed when the timeout expires
* @param timeoutMs - duration of the timeout in milliseconds
* @param setTimeoutIdFn - executed to update the timeout if multiple timeouts are required when
* timeoutMs greater than maxTimeout
* @returns the initial timeout
*/
export declare function setLongTimeout(timeoutFn: () => void, timeoutMs: number, setTimeoutIdFn?: (timeoutId: ReturnType<typeof setTimeout>) => void): ReturnType<typeof setTimeout>;
/**
* This class is a thin wrapper over setTimeout and clearTimeout which
* makes it simpler to keep track of recurring timeouts with the same
* or similar handlers and timeouts.
* or similar handlers and timeouts. This class supports long timeouts
* or timeouts exceeding (2^31)-1 ms or approximately 24.8 days.
*/

@@ -25,0 +37,0 @@ export declare class Timer implements ITimer {

@@ -7,6 +7,31 @@ /*!

import { Deferred } from "./promises";
const maxSetTimeoutMs = 0x7FFFFFFF; // setTimeout limit is MAX_INT32=(2^31-1).
/**
* Sets timeouts like the setTimeout function allowing timeouts to exceed the setTimeout's max timeout limit.
* Timeouts may not be exactly accurate due to browser implementations and the OS.
* https://stackoverflow.com/questions/21097421/what-is-the-reason-javascript-settimeout-is-so-inaccurate
* @param timeoutFn - executed when the timeout expires
* @param timeoutMs - duration of the timeout in milliseconds
* @param setTimeoutIdFn - executed to update the timeout if multiple timeouts are required when
* timeoutMs greater than maxTimeout
* @returns the initial timeout
*/
export function setLongTimeout(timeoutFn, timeoutMs, setTimeoutIdFn) {
// The setTimeout max is 24.8 days before looping occurs.
let timeoutId;
if (timeoutMs > maxSetTimeoutMs) {
const newTimeoutMs = timeoutMs - maxSetTimeoutMs;
timeoutId = setTimeout(() => setLongTimeout(timeoutFn, newTimeoutMs, setTimeoutIdFn), maxSetTimeoutMs);
}
else {
timeoutId = setTimeout(() => timeoutFn(), timeoutMs);
}
setTimeoutIdFn === null || setTimeoutIdFn === void 0 ? void 0 : setTimeoutIdFn(timeoutId);
return timeoutId;
}
/**
* This class is a thin wrapper over setTimeout and clearTimeout which
* makes it simpler to keep track of recurring timeouts with the same
* or similar handlers and timeouts.
* or similar handlers and timeouts. This class supports long timeouts
* or timeouts exceeding (2^31)-1 ms or approximately 24.8 days.
*/

@@ -91,3 +116,7 @@ export class Timer {

handler,
timeout: setTimeout(() => this.handler(), duration),
timeout: setLongTimeout(() => this.handler(), duration, (timer) => {
if (this.runningState !== undefined) {
this.runningState.timeout = timer;
}
}),
};

@@ -94,0 +123,0 @@ }

@@ -10,7 +10,7 @@ /*!

} ? E : never;
export declare type TypedEventTransform<TThis, TEvent extends IEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
export declare type TypedEventTransform<TThis, TEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent & IEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
/**
* Event Emitter helper class the supports emitting typed events
*/
export declare class TypedEventEmitter<TEvent extends IEvent> extends EventEmitter implements IEventProvider<TEvent> {
export declare class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
constructor();

@@ -17,0 +17,0 @@ readonly addListener: TypedEventTransform<this, TEvent>;

{
"name": "@fluidframework/common-utils",
"version": "0.32.1",
"version": "0.33.1000-60833",
"description": "Collection of utility functions for Fluid",
"homepage": "https://fluidframework.com",
"repository": "https://github.com/microsoft/FluidFramework",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "common/lib/common-utils"
},
"license": "MIT",

@@ -19,3 +23,3 @@ "author": "Microsoft and contributors",

"bench": "ts-node bench/src/index.ts",
"build": "npm run build:genver && concurrently npm:build:compile npm:lint && npm run build:docs",
"build": "npm run build:gen && concurrently npm:build:compile npm:lint && npm run build:docs",
"build:commonjs": "npm run tsc && npm run build:test",

@@ -27,8 +31,10 @@ "build:compile": "concurrently npm:build:commonjs npm:build:esnext",

"build:full:compile": "npm run build:compile",
"build:genver": "gen-version",
"build:test": "concurrently npm:build:test:mocha npm:build:test:jest",
"build:gen": "concurrently npm:build:gen:ver npm:typetests:gen",
"build:gen:ver": "gen-version",
"build:test": "concurrently npm:build:test:mocha npm:build:test:jest npm:build:test:types",
"build:test:jest": "tsc --project ./src/test/jest/tsconfig.json",
"build:test:mocha": "tsc --project ./src/test/mocha/tsconfig.json",
"bump-version": "npm version minor --no-push --no-git-tag-version && npm run build:genver",
"ci:build": "npm run build:genver && npm run build:compile",
"build:test:types": "tsc --project ./src/test/types/tsconfig.json",
"bump-version": "npm version minor --no-push --no-git-tag-version && npm run build:gen:bump",
"ci:build": "npm run build:gen && npm run build:compile",
"ci:build:docs": "api-extractor run --typescript-compiler-folder ./node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",

@@ -39,3 +45,3 @@ "ci:test": "npm run test:report",

"eslint": "eslint --format stylish src",
"eslint:fix": "eslint --format stylish src --fix",
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
"lint": "npm run eslint",

@@ -52,3 +58,5 @@ "lint:fix": "npm run eslint:fix",

"tsfmt": "tsfmt --verify",
"tsfmt:fix": "tsfmt --replace"
"tsfmt:fix": "tsfmt --replace",
"typetests:gen": "fluid-type-validator -d .",
"typetests:prepare": "fluid-type-validator -d . -p"
},

@@ -84,5 +92,8 @@ "nyc": {

"devDependencies": {
"@fluidframework/build-common": "^0.22.0",
"@fluidframework/eslint-config-fluid": "^0.23.0",
"@fluidframework/build-common": "^0.23.0",
"@fluidframework/build-tools": "^0.2.60108",
"@fluidframework/common-utils-previous": "npm:@fluidframework/common-utils@^0.32.0",
"@fluidframework/eslint-config-fluid": "^0.27.2000-59622",
"@microsoft/api-extractor": "^7.16.1",
"@rushstack/eslint-config": "^2.5.1",
"@types/base64-js": "^1.3.0",

@@ -95,14 +106,14 @@ "@types/benchmark": "^2.1.0",

"@types/sinon": "^7.0.13",
"@typescript-eslint/eslint-plugin": "~4.14.0",
"@typescript-eslint/parser": "~4.14.0",
"@typescript-eslint/eslint-plugin": "~5.9.0",
"@typescript-eslint/parser": "~5.9.0",
"benchmark": "^2.1.4",
"concurrently": "^5.2.0",
"concurrently": "^6.2.0",
"copyfiles": "^2.1.0",
"eslint": "~7.18.0",
"eslint": "~8.6.0",
"eslint-plugin-editorconfig": "~3.2.0",
"eslint-plugin-eslint-comments": "~3.2.0",
"eslint-plugin-import": "~2.22.1",
"eslint-plugin-import": "~2.25.4",
"eslint-plugin-no-null": "~1.0.2",
"eslint-plugin-prefer-arrow": "~1.2.2",
"eslint-plugin-react": "~7.22.0",
"eslint-plugin-unicorn": "~26.0.1",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-unicorn": "~40.0.0",
"jest": "^26.6.3",

@@ -125,3 +136,18 @@ "jest-junit": "^10.0.0",

"outputName": "jest-junit-report.xml"
},
"typeValidation": {
"version": "0.33.1000",
"broken": {
"0.32.1": {
"RemovedFunctionDeclaration_extractLogSafeErrorProperties": {
"forwardCompat": false,
"backCompat": false
},
"RemovedClassDeclaration_BatchManager": {
"forwardCompat": false,
"backCompat": false
}
}
}
}
}

@@ -15,3 +15,3 @@ /*!

*/
export class EventForwarder<TEvent extends IEvent = IEvent>
export class EventForwarder<TEvent = IEvent>
extends TypedEventEmitter<TEvent> implements IDisposable {

@@ -28,5 +28,6 @@ protected static isEmitterEvent(event: string): boolean {

private readonly forwardingEvents = new Map<string, Map<EventEmitter | IEventProvider<TEvent>, () => void>>();
private readonly forwardingEvents =
new Map<string, Map<EventEmitter | IEventProvider<TEvent & IEvent>, () => void>>();
constructor(source?: EventEmitter | IEventProvider<TEvent>) {
constructor(source?: EventEmitter | IEventProvider<TEvent & IEvent>) {
super();

@@ -59,3 +60,3 @@ if (source !== undefined) {

protected forwardEvent(source: EventEmitter | IEventProvider<TEvent>, ...events: string[]): void {
protected forwardEvent(source: EventEmitter | IEventProvider<TEvent & IEvent>, ...events: string[]): void {
for (const event of events) {

@@ -77,3 +78,3 @@ if (source !== undefined && event !== undefined && !EventForwarder.isEmitterEvent(event)) {

protected unforwardEvent(source: EventEmitter | IEventProvider<TEvent>, ...events: string[]): void {
protected unforwardEvent(source: EventEmitter | IEventProvider<TEvent & IEvent>, ...events: string[]): void {
for (const event of events) {

@@ -80,0 +81,0 @@ if (event !== undefined && !EventForwarder.isEmitterEvent(event)) {

@@ -9,3 +9,2 @@ /*!

export * from "./base64Encoding";
export * from "./batchManager";
export * from "./disposal";

@@ -12,0 +11,0 @@ export * from "./eventForwarder";

@@ -44,39 +44,1 @@ /*!

}
export function extractLogSafeErrorProperties(error: any) {
const isRegularObject = (value: any): boolean => {
return value !== null && !Array.isArray(value) && typeof value === "object";
};
const removeMessageFromStack = (stack: string, errorName?: string) => {
const stackFrames = stack.split("\n");
stackFrames.shift(); // Remove "[ErrorName]: [ErrorMessage]"
if (errorName !== undefined) {
stackFrames.unshift(errorName); // Add "[ErrorName]"
}
return stackFrames.join("\n");
};
const message = (typeof error?.message === "string")
? error.message as string
: String(error);
const safeProps: { message: string; errorType?: string; stack?: string } = {
message,
};
if (isRegularObject(error)) {
const { errorType, stack, name } = error;
if (typeof errorType === "string") {
safeProps.errorType = errorType;
}
if (typeof stack === "string") {
const errorName = (typeof name === "string") ? name : undefined;
safeProps.stack = removeMessageFromStack(stack, errorName);
}
}
return safeProps;
}

@@ -9,2 +9,2 @@ /*!

export const pkgName = "@fluidframework/common-utils";
export const pkgVersion = "0.32.1";
export const pkgVersion = "0.33.1000-60833";

@@ -62,4 +62,4 @@ /*!

constructor(primary: IRangeTrackerSnapshot)
constructor(primary: number, secondary: number)
constructor(primary: IRangeTrackerSnapshot);
constructor(primary: number, secondary: number);
constructor(primary: IRangeTrackerSnapshot | number, secondary?: number) {

@@ -66,0 +66,0 @@ if (typeof primary === "number") {

@@ -60,6 +60,37 @@ /*!

const maxSetTimeoutMs = 0x7FFFFFFF; // setTimeout limit is MAX_INT32=(2^31-1).
/**
* Sets timeouts like the setTimeout function allowing timeouts to exceed the setTimeout's max timeout limit.
* Timeouts may not be exactly accurate due to browser implementations and the OS.
* https://stackoverflow.com/questions/21097421/what-is-the-reason-javascript-settimeout-is-so-inaccurate
* @param timeoutFn - executed when the timeout expires
* @param timeoutMs - duration of the timeout in milliseconds
* @param setTimeoutIdFn - executed to update the timeout if multiple timeouts are required when
* timeoutMs greater than maxTimeout
* @returns the initial timeout
*/
export function setLongTimeout(
timeoutFn: () => void,
timeoutMs: number,
setTimeoutIdFn?: (timeoutId: ReturnType<typeof setTimeout>) => void,
): ReturnType<typeof setTimeout> {
// The setTimeout max is 24.8 days before looping occurs.
let timeoutId: ReturnType<typeof setTimeout>;
if (timeoutMs > maxSetTimeoutMs) {
const newTimeoutMs = timeoutMs - maxSetTimeoutMs;
timeoutId = setTimeout(() => setLongTimeout(timeoutFn, newTimeoutMs, setTimeoutIdFn), maxSetTimeoutMs);
} else {
timeoutId = setTimeout(() => timeoutFn(), timeoutMs);
}
setTimeoutIdFn?.(timeoutId);
return timeoutId;
}
/**
* This class is a thin wrapper over setTimeout and clearTimeout which
* makes it simpler to keep track of recurring timeouts with the same
* or similar handlers and timeouts.
* or similar handlers and timeouts. This class supports long timeouts
* or timeouts exceeding (2^31)-1 ms or approximately 24.8 days.
*/

@@ -147,3 +178,11 @@ export class Timer implements ITimer {

handler,
timeout: setTimeout(() => this.handler(), duration),
timeout: setLongTimeout(
() => this.handler(),
duration,
(timer: number) => {
if(this.runningState !== undefined) {
this.runningState.timeout = timer;
}
},
),
};

@@ -150,0 +189,0 @@ }

@@ -13,3 +13,3 @@ /*!

export type TypedEventTransform<TThis, TEvent extends IEvent> =
export type TypedEventTransform<TThis, TEvent> =
// Event emitter supports some special events for the emitter itself to use

@@ -22,3 +22,3 @@ // this exposes those events for the TypedEventEmitter.

// Expose all the events provides by TEvent
IEventTransformer<TThis, TEvent> &
IEventTransformer<TThis, TEvent & IEvent> &
// Add the default overload so this is covertable to EventEmitter regardless of environment

@@ -30,3 +30,3 @@ TransformedEvent<TThis, EventEmitterEventType, any[]>;

*/
export class TypedEventEmitter<TEvent extends IEvent> extends EventEmitter implements IEventProvider<TEvent> {
export class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
constructor() {

@@ -33,0 +33,0 @@ super();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc